共用方式為


Ending Expressions

Design criteria such as standard compliance, performance, reliability and security framed the design of IE8 as whole, for new as well as existing features. As a result, CSS expressions are no longer supported in IE8 standards mode. This change was announced previously on the IE blog, however, this post will provide a few more details about that decision. The following FAQ will give a quick overview of the feature, the rationale behind our design decision and what it may mean for your own site.

What is a CSS expression ?

Also known as ‘Dynamic Properties’, this proprietary CSS extension was introduced in Internet Explorer 5. Long before JavaScript libraries such as jQuery or Dojo were conceived, it allowed web developers to dynamically bind script to the page through CSS selectors. As an example, the following CSS declaration updates the background color of certain page blocks depending on the time of day :

div.title { background-color: expression( (new Date()).getHours()%2 ? "#B8D4FF" : "#F08A00" ); }

Why end support for expressions ?

  • To comply with standards
    • Expressions are proprietary to Internet Explorer and as such not interoperable.
    • A common use-case for expressions was to fix IE bugs or to emulate those CSS 2.1 features not yet supported by the browser, for example, min-width and max-width. We have not only worked hard to fix these bugs in IE8 but our new layout engine supports the missing features natively.
  • To improve performance
  • To reduce the browser attack surface
    • Because they expose a script execution context, CSS expressions constitute a possible script injection attack vector.

Are expressions still available in IE7 and Quirks mode ?

Yes. For backward compatibility, CSS expressions are still executed in Quirks and IE7 Strict modes. But starting with IE8 Beta 2, they are ignored in IE8 Standards mode.

Pages on my web site depend on CSS expressions. How does this affect me ?

Thanks to IE8’s new layout engine, most expressions written to work around CSS 2.1 bugs and shortcomings should no longer be needed; we expect unsupported or incorrectly interpreted properties to work in a standard, interoperable way. For those expressions supporting more specific purposes, anything they do is inherently achievable using standard JavaScript, usually interoperably and at lower runtime costs. The specifics will of course depend on your application. Based on your feedback to this post, we may visit examples in future installments.

Ending support for expressions - a feature often used to fix the very issues we have worked hard to address in this release – helps make IE8 more standard, faster and more secure for our users.

Sylvain Galineau
Program Manager

Comments

  • Anonymous
    October 16, 2008
    Hurray! More interop and less proprietary! I'm staring to think that Miscrosoft isn't so bad!

  • Anonymous
    October 16, 2008
    Don't be so quick to celebrate, they're just replacing one proprietary evil(haslayout, expressions and other IE only stuff) with another closed proprietary vendor lock-in evil, Silverlight.

  • Anonymous
    October 16, 2008
    OWS: yes, yes, microsoft is evil and kills puppies and so on... yawn... troll elsewhere? IE is making big strides in making the web platform richer...  if you don't like silverlight, don't use it...  if you want to uselessly whine about silverlight, at least target your complaints in the right direction.

  • Anonymous
    October 16, 2008
    The comment has been removed

  • Anonymous
    October 16, 2008
    TTEF, "An industry consortium of Microsoft's failed competitors complains about a Microsoft product." How is this remotely interesting?  If it at least referenced Silverlight at all, you could claim it was relevent, but it doesn't even do that.  Quick, have someone from Adobe write up a new complaint and have ECIS sign it!

  • Anonymous
    October 16, 2008
    "To comply with standards",  yea Why Open the Web? http://my.opera.com/community/openweb/info/

  • Anonymous
    October 16, 2008
    The comment has been removed

  • Anonymous
    October 16, 2008
    @keith, An argument from ignorance is worthless, some people actually know how to use CSS; But at any rate, congratulations to the IE team on moving forward and removing a feature that is no longer needed. There is still a long way for you to go to catch up with your competitors, but at least steps are being made in the right direction

  • Anonymous
    October 16, 2008
    The comment has been removed

  • Anonymous
    October 16, 2008
    even when one has historically ignored it*

  • Anonymous
    October 16, 2008
    Thanks for the great work....I appreciate all your efforts...keep up the good work...

  • Anonymous
    October 16, 2008
    IE8의 표준 랜더링 모드에서 CSS expression이 지원되지 않는답니다.

  • Anonymous
    October 16, 2008
    I'm in shock and awe. Guys, you're making a huge step to bringing better interoperability to the table. I'm very positively pleased with the things you are trying to accomplish with IE8. I know those are just words for now, words that can change any minute. But I keep my fingers crossed for all of this to happen.

  • Anonymous
    October 16, 2008
    Great work IE team! Could we please have a troll and off topic filter for the comments on this blog? :-)

  • Anonymous
    October 16, 2008
    when will IE8 be released? i thought it was supposed to come at october, no?

  • Anonymous
    October 16, 2008
    Good move. Keith Humm: JavaScript was bad, but it's getting better and better, thanks to much improved browser implementations, as well as powerful libs like JQuery. MS even said JS was the number 1 competitor against Silverlight. And it seems you don't understand what CSS is about...

  • Anonymous
    October 16, 2008
    I think this is good news. Leave it up to scripting like javascript to render dynamic content.

  • Anonymous
    October 16, 2008
    I don't Javascript has ever been bad. There have just been bad coders misusing it. I'm not entirely sure the new libraries are at all beneficial, since we now have a new wave of web developers who can't programme actual JS but just regurgitate library-based code they've plagirised from various blogs.

  • Anonymous
    October 16, 2008
    Sometimes I feel surprised with the things that anti-MS people says. Comparing CSS proprietary properties with Silverlight? That's the most stupid affirmative I've ever heard.

  • Anonymous
    October 17, 2008
    The comment has been removed

  • Anonymous
    October 17, 2008
    jbot: as you just said yourself, even before libs appeared, there were already bad coders. Libs don't change that. And JQuery is certainly remarkable, as many companies (including Microsoft!) rely on it.

  • Anonymous
    October 17, 2008
    I don't understand: Q. Why are you removing this? A. To reduce the attack surface. Q. Will it be available in Quirks mode? A. Yes. In what way is the attack surface reduced, if all the bad guy has to do is use Quirks mode? Besides, are expressions JavaScript? JavaScript is already an attack surface. The only answer I can imagine is that it protects site designers who didn't sanitize their input properly from another XSS vector, but that's not really what you explain. I'm not a web developer, so if there's some kind of obvious meaning, I'm missing it. Why don't you explain things robustly enough to stand up to momentary scrutiny in the time it takes to read the article?

  • Anonymous
    October 17, 2008
    @James S. Quirksmode will be gone in a few years (I hope).

  • Anonymous
    October 17, 2008
    The comment has been removed

  • Anonymous
    October 17, 2008
    @James S. The reasoning here is that the bad guy will always be in full control of his own web site; but this is one less avenue for him to try inject code in your users' browser through your site. As most web sites today do render in standard mode, this should reduce the overall XSS attack surface over time as IE8 rolls out.

  • Anonymous
    October 17, 2008
    For the love of standards! Can you please, please, please fix the mess with the "Compatability Mode" for intRAnet sites. ALL of my INTRANET sites are DESIGNED to Web Standards, serving up DOCTYPEs and all that jazz. In IE8 Beta 2, you've gone against your word and made QUIRKS not only the DEFAULT rendering, but LOCKED IT IN! so I can't as a user (or developer) turn the IE7Quirks Mode off! If I were a conspiracy theorist, this would SCREAM of Shinanigans! So 2 questions: 1.) How do I turn if off right now 2.) Will this issue be fixed in Beta 3? Houston

  • Anonymous
    October 17, 2008
    @Steve Yes, behavior is still supported. But we do support and recommend a stricter syntax. See http://blogs.msdn.com/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspx.

  • Anonymous
    October 17, 2008
    Nice, but anyway, when will application/xhtml+xml mime type supported ?

  • Anonymous
    October 17, 2008
    @for the love of standards, You can easily turn this off through Tools-Compatibility View Settings, then uncheck 'Display intranet sites in Compatibility View'. This can also be controlled through Group Policy.

  • Anonymous
    October 17, 2008
    not to mention, that addEventListener() is still not supported,

  • Anonymous
    October 17, 2008
    I'm wondering what is going to happen with behaviors, HTC? No one talks about these any more.

  • Anonymous
    October 17, 2008
    The comment has been removed

  • Anonymous
    October 17, 2008
    The comment has been removed

  • Anonymous
    October 17, 2008
    Great! Good riddance to this ugly, slow and pathologically unreliable feature (and the one extra script injection possibility it brought with it).

  • Anonymous
    October 17, 2008
    Could you make IE 8 at least the second or third fastest browser

  • Anonymous
    October 17, 2008
    Even though this is going to break a whole load of sites built to work on IE, it's a splendid move from Microsoft.

  • Anonymous
    October 17, 2008
    I wonder if IE8 will do better than IE7 about the suppport for application/xhtml+xml and doctype declarations. I tested it on http://www.browsershots.org with my website, which have the following doctype : <!DOCTYPE html PUBLIC "-//GABSOFTWARE//DTD XHTML 1.1 Extended//EN" "http://gabsoftware.com/DTD/xhtml11extended.dtd" [ <!ENTITY user "webmaster"> <!ENTITY domain "gabsoftware.com"> <!ENTITY at "@"> <!ENTITY mailto "mailto:"> ]> That's a very valid doctype. It seems that IE8 is badly displaying the website as IE7 do. I am disapointed and would ask you if you plan to fix this one day, as every other browser is able to display properly application/xhtml+xml mimetypes.

  • Anonymous
    October 17, 2008
    A nice move and much appreciated; although I have one concern here: <q>most expressions written to work around CSS 2.1 bugs and shortcomings should no longer be needed</q> That's not entirely reassuring - do you have a list of the expression-hacked bugs that haven't been fixed, so we know what we're dealing with? That would be a useful lookup table for the transition.

  • Anonymous
    October 18, 2008
    The comment has been removed

  • Anonymous
    October 18, 2008
    The comment has been removed

  • Anonymous
    October 18, 2008
    The comment has been removed

  • Anonymous
    October 18, 2008
    @Pipo, you should look at the reasons why people don't consider it open nor standard: http://en.wikipedia.org/wiki/Ooxml#Criticism But that is off topic anyway

  • Anonymous
    October 18, 2008
    This is good news. Leave it up to scripting like javascript to render dynamic content.

  • Anonymous
    October 18, 2008
    The comment has been removed

  • Anonymous
    October 19, 2008
    Reading the comments, I see folks comparing CSS with scripting, and the original blog post seems to imply "user scripting instead of CSS". If I'm browsing web sites, I want to take the acceptably small risk of viewing data, not the higher risk of allowing the site to program my system.  So I'd want to disable (or set to Prompt) all active content, to bloch scripts unless I choose to run them. Where does CSS fall, in this situation?  If it's permitted, then I'd want it to be as safe as script-less HTML, and with the extensions facility in place, it may not be.   In which case, good riddance to those CSS extensions, though I hope this doesn't mean sites that don't actually need to script anything, don't start chucking JavaScript around to do basic formatting. I'm writing this from the perspective of a web consumer.  Folks who write web pages may want as much power as possible, but from my perspective, I don't trust web sites as far as I can throw them, so I'd want y'all in straitjackets  :-)

  • Anonymous
    October 19, 2008
    En el blog de Internet Explorer, anuncia que su próxima versión 8 no soportará las expressiones (&quot;expression&quot;) que se utilicen en las hojas de estilo para cumplir con los estándares, mejorar el rendimiento y evitar ataques contra el navegador

  • Anonymous
    October 19, 2008
    Good move... embedded javascript in CSS is bad. Makes XSS easier and is a performance overhead. @keith. Stick to frontpage mate. As for Silverlight best avoided.

  • Anonymous
    October 19, 2008
    Internet explorer is getting standardized with version 8.

  • Anonymous
    October 20, 2008
    Looking good, but fix the comments!

  • Anonymous
    October 20, 2008
    The comment has been removed

  • Anonymous
    October 20, 2008
    @Sylvain How about ending the lock up of the UI? How about asking Dean to have a real discussion about the UI, not just the colors of tabs. How about just giving us back the ability to change the UI like we had in IE 6,5,4,3? What is so wrong with that? what is so wrong with wanting to be able to put my home button next to my address bar? Again DEAN WHY THE WALL? Sylvain, can you explain why the wall of silence, when it comes to the UI? Why have a beta at all? DEAN again why the WALL OF SILENCE?

  • Anonymous
    October 20, 2008
    Off topic: Dear IE team, do you check up the problem of highlighting text in zoomed page? although it is scarcely use,but I thinkn you should fix it

  • Anonymous
    October 21, 2008
    A nice move and much appreciated; although I have one concern here: <q>most expressions written to work around CSS 2.1 bugs and shortcomings should no longer be needed</q> That's not entirely reassuring - do you have a list of the expression-hacked bugs that haven't been fixed, so we know what we're dealing with? That would be a useful lookup table for the transition.

  • Anonymous
    October 21, 2008
    The comment has been removed

  • Anonymous
    October 21, 2008
    Eghost: Please go away.  Your whining is pointless and annoying.

  • Anonymous
    October 21, 2008
    @Ted - you may interperet Eghost's comments as whining and to you they may be annoying, but they certainly aren't pointless. I have yet to meet an IE user that is "happy" with the new IE7 UI, and/or "excited" that the UI is locked down not only in IE7, but in the next releases to come. Are you the infamous "Ted" that trolls on any anti-ms/anti-ie comment? If so I think you should read your own comment, and "Please go away" The whole idea of this blog and the comments is to provide a basic forum to provide IE news and solicit feedback on IE development. Since IE suffers from UI, usability, & standards support in the browser marketplace I for one welcome all comments on IE, especially the ones that get MSFT to pay attention and ship better products. Now Ted, Please go away.

  • Anonymous
    October 21, 2008
    Good step! It will hurt a little for some old sites that don't comply, but there has to be a day you take this step, so why not today?

  • Anonymous
    October 21, 2008
    IEBlog的消息,CSS expression就是可以在CSS value裡面進行一些簡單運算,像是「10%+4px」這樣的長度設定,雖然記憶中W3C也曾經有過草稿,不過總之這就是不太有人使用的東西,所以一直以來也只有IE支援,然後這次IE Team終於決定要把它拿掉了,不過Ajaxian上的第一篇回文很XD: I can't believe they're doing such big changes and don't want to rename their XMLHttpRequest

  • Anonymous
    October 21, 2008
    The comment has been removed

  • Anonymous
    October 22, 2008
    when opening a new tab sometimes a 2-3 sec pause occurs. This always seem to happen when creating the first new tabs after creating another second new tabs it quickly appear

  • Anonymous
    October 22, 2008
    The comment has been removed

  • Anonymous
    October 22, 2008
    @Brez: - re slow new tab. Ah yes bug 342 http://webbugtrack.blogspot.com/2008/08/bug-342-connecting-in-ie7-ie8-takes-f-o.html It was slow enough in IE7 but its only gotten worse with each IE8 release.  I certainly hope that this is fixed in Beta 3. william jr.

  • Anonymous
    October 22, 2008
    When filing bugs, it's helpful to put actionable data in them. In the case of your "342 bug" this is almost always entirely related by the load time of your browser extensions.  Start IE in no-addons mode, and you'll likely find that new tabs appear almost instantly. In IE8 Beta2, you can click Tools / Manage Addons, and view the startup time for each addon.  Disable the slow ones, and check out the improvement.  

  • Anonymous
    October 22, 2008
    Uhm sure... zero addons installed on either a fully patched XPSP3 PC or a VPC Image (same specs) EVERY version of IE7 and IE8 suffers from this, regardless of any addons installed. I think every single IE chat, or post on this blog has mentioned this. On any IE7+ install you can open a new tab, and press paste (CTRL+V) 2 or 3 times and still not get the value into the address bar because it hasn't rendered yet.... or worse yet, it gets merged with about:blank.

  • Anonymous
    October 22, 2008
    TURN OFF THE DEFAULT MICROSOFT RESEARCH ADDON It takes over a second to load on every tab, which is just plain dumb considering that NO ONE uses it! Why it is installed by default is beyond me.

  • Anonymous
    October 22, 2008
    Ok thanks for the tips indeed a add-on AVG safe search is slowing the new tabs. Are there any other way you could fix tab slow down without telling user to disable the slow add-ons.

  • Anonymous
    October 22, 2008
    The "Research" addon is from Office, not IE.  Go complain to them. Brez, please explain how Microsoft can make someone else's code run faster??

  • Anonymous
    October 22, 2008
    Lately smart address bar autocomple started displaying .url or <this page has note set a title> instead of the website name and address.

  • Anonymous
    October 22, 2008
    All browsers have some addons/plugins, but it seems to only be IE that has significantly slow tab opening issues.  So if addons are the whole cause of the issue the other browsers must have a better architecture where slow addons don't prevent the user from using a new tab until they have loaded.

  • Anonymous
    October 23, 2008
    More users have more addons loaded in IE than in any other browser, and especially more that the user knows nothing about, owing to the fact that it's much easier to programmatically install an IE extension, so many client applications do. For compatibility reasons, IE spins up new add-on instances for every tab. Because most add-ons are COM-based, and many of them are poorly written, this leads to significant overhead.  This is why in IE8, we've introduced the "Load time" column in Manage Addons-- to help put the user in control of performance.

  • Anonymous
    October 23, 2008
    I suppose the ability to apply a behavior through expression is being deprecated too:

  • {behavior: expression((function(anElement){//do something with anElement;anElement.runtimeStyle.behavior = 'none';})(this));} Is IE8 going to expose prototypes of DOM elements allowing to extend these like it is possible with FireFox and WebKit? Are htcs still supported?

  • Anonymous
    October 23, 2008
    @Benoit: Yes, IE8 supports HTCs and mutable DOM prototypes.

  • Anonymous
    October 24, 2008
    The comment has been removed

  • Anonymous
    October 26, 2008
    testing comments

  • Anonymous
    October 26, 2008
    test comment

  • Anonymous
    October 28, 2008
    Did you guys ever try to close the browser? I know I can just wait a bit for IE to crash, but what about scenarios when I just want to close the browser? Seems that IE design team misplaced the "Restore tabs on next launch" button that was there in IE7. Can you plese fix it and send me a working version tomorrow?

  • Anonymous
    October 28, 2008
    The comment has been removed

  • Anonymous
    October 28, 2008
    The IE8 will be released in octobre and I don't thin that IE will compete with Firefox3!

  • Anonymous
    March 18, 2009
    IE8标准模式不再支持CSS表达式(Expression) 原文地址:EndingExpressions 标准遵守情况、性能、可靠性和安全性等设计标准构成了IE8的设计整体,包括新的和已经存在功...