The Exclamation Invalid Filter
Or, the WebKit Build 85 Stiletto
This should be green not red
It is green in:
- Mozilla (0.92, 0.94, 1.0, 1.01, 1.4, 1.6 versions tested)
- Camino 0.7
- Safari 1.2 (WebCore build 125)
- Safari 1.0.1 (WebCore build 85.6)
- iCab 2.9.7
- IE 6.0 Windows
- IE 5.5 Windows
- IE 5.0 Windows (but only with the comment hack included)
- IE 4.0 Windows (but only with the comment hack included)
- IE 5.2.3 (Mac OS X)
- IE 5.0 (Mac OS 9)
- IE 4.5 (Mac OS 9)
- IE 4.01 (Mac OS 9)
- Opera 7.x (Windows)
- Opera 6 (OS X and Windows)
- Opera 5 (OS X and Windows)
- Opera 3.5 (Windows)
- Netscape 7.0&endash;7.1
- Netscape 6.x
- Netscape 4.77 (OS 9)
- Netscape 4.61 (OS 9)
- Netscape 4.04 (OS 9)
It is red in:
- OmniWeb 4.5 (presumably also Safari 1.0)
- OmniWeb 5.0 beta (using WebKit build 85)
The CSS used is:
p.thing {color:green;}
.doofus ! p.thing/**/ {color:red;}
It is based on one of the tests of
forward-compatible parsing
in the W3C CSS1 Test Suite, combined with a comment that hides the second rule from IE 4.0 and 5.0 for Windows.
It is not valid according to the W3C CSS validator, as the exclamation point
in not a recognised operator in any current version of CSS. Thanks to Tony Leggett and Chris Nott for testing.
CodeBitch
11 February 2004