No Clean Feed - Stop Internet Censorship in Australia

IE7: sane and rational?

mezzoblue § IE7 Conditional Comments relates back a Question & Answer session with Chris Wilson and Brian Goldfarb of Microsoft, about IE7 and conditional comments. Transcribed by Molly Holzschlag (she has also posted about the rest of the meeting: molly.com » WaSP Microsoft Task Force Update: Upcoming Products, XAML, Acid2, SXSW, and IE7 Revealed).

One particular quote really has me stumped.

Why not implement conditional comments in CSS syntax, so we can move our filtering into external files and keep our markup clean?

Chris replies:

"I think it would be great if we provided a mechanism like conditional comments inside CSS. We’ve [Microsoft] thought about it, we’re not going to do it in IE7 because we want to do it in a sane, rational way. You’ll want conditional comments to be backward and forward compatible. Tough to design that into CSS so that it will actually work."

Microsoft wants us to do this to all our documents, to allow for IE6:

<!--[if IE]>
...link to IE-specific CSS file...
<![endif]-->

As I've said already, I think it would have been much better to provide conditional comments in the CSS rather than the page source. All they had to add to IE7 was the ability to parse something like this in a CSS file:

/* [if IE 7] 
...css...
[endif] */

...which both validates and works in other browsers (as in, it's ignored). So why on earth was it not a "sane and rational" approach?

ARGH.

Comments

  1. Anonymous Cam, November 07, 2005 10:24 AM: 

    <![if !IE]>
    ...link to IE-specific CSS file...
    <![endif]>

    Doesn't this mean "if not IE"? In most programming/scripting languages I've come across, the exclamation mark signifies "not".

    It would make more sense if it read:

    <![if !IE]>
    ...link to non-IE CSS file...
    <![endif]>

    ... or...

    <![if IE]>
    ...link to IE-specific CSS file...
    <![endif]>

    Not 100% on conditional comments, so happy to be corrected.

  2. Blogger 200ok, November 14, 2005 4:39 PM: 

    My mistake Cam, I grabbed the wrong bit of code from MSDN's conditional comment info. I've updated it to read <!--[if IE]> (leaving out the optional version number).

  3. Anonymous tedd, November 16, 2005 2:17 AM: 

    Hi:

    Chris said, as quoted from above (not that far above)

    "I think it would be great if we provided a mechanism like conditional comments inside CSS. We’ve [Microsoft] thought about it, we’re not going to do it in IE7 because we want to do it in a sane, rational way. You’ll want conditional comments to be backward and forward compatible. Tough to design that into CSS so that it will actually work."

    Three things:

    1. While it might be entertaining for CSS to include conditional comments, but the development direction of CSS has been, and probably will remain, against providing such.

    2. I can understand why Microsoft would want someone else to deal with the conditional statement problem because they haven't been able to get them to work in all their browsers. For example, neither IE 4 Windows 98, IE 5.1 Mac OS-9, nor IE 5.2 Mac OS-X can handle conditional statements.

    3. There are other languages that can easily handle conditional statements, such as php. With a few simple statements, you handle all the conditional comments you want.

    So, in my opinion there is no need to wait for CSS to include it, or Microsoft to finally get things right (besides, they can't correct past mistakes anyway), just let the "powers that be" ponder what problems they're going to create for us next, and fix what problems we can now with tools that work.

    tedd

about

Web development and standards, as seen by Ben Buchanan.

subscribe