Internet Explorer dumping CSS hacks to comply with standards

Posted on 18th October 2008 in Browsers, Open Standards | 6 Comments »

Years ago, for Internet Explorer 5, Microsoft took a shortcut to ‘extended CSS support’ that they called the Dynamic Properties. Despite the fancy name it had nothing to do with W3C Cascading Style Sheet standards nor was it available cross-platform. Now, as the software giant has realized the impact of open standards, they are giving up on these non-standard developments.

Dynamic Properties work in a way that make it possible to execute JavaScript from within the CSS definition, e.g.

#myDiv {
    width:expression( (/* JavaScript here */) ? "100px" : "200px" );
}

vs. the standard-compliant code:

#myDiv {
    min-width:100px;
    max-width:200px;
}

Microsoft’s goal with the above expression hack was to emulate CSS 2.1 support as the simplest properties of CSS were missing. For instance max-width and min-width properties are still not available for nearly 25%(1) of users, the percentage representing IE6 market share. Fortunately the situation is different for IE 7 and 8(2):

spacer
max-width in MSIE6
spacer
max-width in MSIE7
spacer
max-width in MSIE8

Any script execution at the Style Sheet stack of the browser is surely a performance issue and more importantly a security threat. No wonder it makes IE the most insecure browser on the market.

Good news for the developers who have respected W3C standards and not used JavaScript expressions in CSS, is that IE8 will run in Standards mode by default. For those who haven’t, Microsoft will provide backward compatibility with Quirks and IE7 Strict modes. Will it cause a whole load of sites to break with the release of IE8? Sure.

IE team confirmed ending expressions on Thursday.(3)

References:
1 IE6 usage statistics from Market Share by Network Applications
2 CSS 2.1 minimum and maximum height and width test case
3 Ending Expressions (IEBlog)

Related articles:
- Internet Explorer 8 to pass Acid2

  • 6 Responses

  • shafiur

    Phew! Thank god that there is some justice in this world, eh?

  • Ain Tohvri

    Many of the DoS vulnerabilities in IE and Windows in general were and still are caused by things like these expressions. A wrong move from the very start like many other features Microsoft has introduced. Like the EOT development to name just one.

  • Hillary Martin

    Lots of content, but worth the read. Keep it coming.

  • flash tekkie » Blog Archive » Testing standards compliance of Microsoft Outlook 2007

    [...] Internet Explorer dumping CSS hacks to comply with standards [...]

  • a

    It’s lie. IE7 doesnt support min/max css properties.

  • Ain Tohvri

    Yes it does. See the screenshot or Google for it.

Leave a Reply

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.