No more conditional comments in IE10

It’s not exactly news—it was announced in July in HTML5 Parsing in IE10—but in case you missed it, Microsoft are removing support for conditional comments from IE10.

I don’t expect this to be a big deal. Actually I’m not sure it will have any impact at all, at least not for me. It’s already a rare thing to need to do something special for IE9.

One of Microsoft’s goals with IE10 is to make sure that it parses HTML the same as all other browsers, removing the need for markup hacks. Now, that’s not really where conditional comments have been used the most. The most common use is likely to feed IE-specific CSS files to older IE versions to keep the hacks out of your real CSS.

Since IE has been getting much better and less buggy support for CSS—including CSS3—the need for CSS targeted at IE only has been greatly reduced. With a much wider acceptance of progressive enhancement among both developers and clients, it has become a lot more ok for some visual and sometimes functional details to differ between browsers.

So no, I very much doubt I’ll miss conditional comments. In the future we’ll just need to handle any critical differences in feature support or rendering in IE the same way we handle it with any other browser—progressive enhancement, feature detection, and accepting that there are differences. If all else fails, well, I guess we’ll have to resort to browser sniffing. I can’t remember the last time I did that for any of the other browsers, so hopefully it just won’t be necessary.

Posted on October 27, 2011 in Browsers