Internet Explorer dumping CSS hacks to comply with standards
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:
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.(2)
References:
1 IE6 usage statistics from Market Share by Network Applications
2 Ending Expressions (IEBlog)
Related articles:
- Internet Explorer 8 to pass Acid2