molly.com

Thursday 22 December 2005

Star HTML and Microsoft IE7

Chris Wilson, Group Program Manager for IE Platform and Security at Microsoft, and Position is Everything‘s Big John Gallant have been having a conversation about * html in Microsoft’s upcoming Internet Explorer 7 for Windows (IE7). Wilson has been encouraging CSS designers and developers to repair any bug-specific hacks for several months now. Gallant remains unconvinced the solution is that easy and is afraid countless, unpaid hours of repair work will wind up on the shoulders of those designers and developers who have employed * html related hacks in their designs.

Universal woe

Hacks for browsers typically do one of two things. They exploit a bug (a flawed implementation) or they exploit the complete lack of an implementation. In the case of * html the hack is based on a bug. Child selector hacks, on the other hand, are based on the fact that IE versions up to 6.0 do not include any implementation for child selectors whatsoever.

The popular Holly Hack and related IE workarounds exploit a browser bug in which the universal selector, *, in CSS is misinterpreted. The bug is present in multiple versions of Internet Explorer. The hack is used primarily to correct a number of layout issues related to IE’s proprietary layout model.

With the bug repaired, Wilson says universal selector-related hacks will fail in IE7’s strict mode (compliance mode). The bug remains present when IE7 is running in quirks mode, and in that mode, the hacks will understandably work. Wilson began advocating that the Web design and development community prepare for change back in October. Gallant wants to know how the changes will affect you via a poll at p.i.e..

Is the entire kafuffle a non-issue until we actually have IE7 and see what we really get? Or maybe we can learn from Tantek Çelik (Technorati, WaSP) who advocates that bugs including * html be repaired; and that implementations such as child selectors (which are often used in tandem with the Holly Hack), could be held off until a later date if necessary.

Exploiting a software bug to create a hack becomes dangerous as software is updated and bugs are repaired. While somewhat less danger exists when implementation issues are addressed, what happens when the implementation is introduced and it, too, is flawed? This is why hacks are so problematic, but just how these particular hacks in IE7 will affect the community is still vague.

Me, Me, Select Me!

The faulty interpretation of the universal selector is currently present in the following versions of Internet Explorer:

  • Macintosh: 5.0, 5.15, 5.21
  • Windows: 5.0, 5.5, 6.0

The bug is present in both quirks and standards mode in these versions. Here’s a look at what happens in these IE versions when the universal selector is involved:

Microsoft IE Browser Misnterpretations: Universal Selector
Selector IE Interpretation W3C Interpretation
* html html Matches no element (the html element is root and therefore never has an ancestor)
* * body * body Matches no element (body is the first child of html only)
* html body html body Matches no element

Have layout?

IE layout, which is IE’s determination of how elements are drawn, bound, and behave, has been a bit of a mystery for some time. This is largely due to lack of documentation and discussion about the issue. Dean Edwards (WaSP, WHATWG), Gallant and others went in search of better documentation for hasLayout. Markus Mielke, a Microsoft program manager working with Wilson, joined in the conversations which bore fruit.

Two good references that emerged regarding IE layout are On Having Layout and HasLayout Overview in which Mielke writes:

There are several bugs in Internet Explorer that can be worked around by forcing a layout (an IE internal data structure) on an element (like, dimensional bug fixes and Holly hack). Most users are not aware of the implications of having a layout applied to an element. – HasLayout Overview, Markus Mielke, Microsoft

Mielke’s article, which cites the input of Edwards, Gallant, Wilson and WaSP among others, goes directly to the heart of the * html concern.

Road to repair

Gallant says that the * html hack in CSS is “the only hack that is going to cause serious pain” and believes that the hack “could probably be retained without getting in the way of any actual support enhancements” that Microsoft has planned for IE7.

Wilson points out that the goal is to fix IE, and getting there is a process. “I want to remove the * html hack to make it useful . . . because it will then only apply to obsolete browsers.” He also shares a dislike for any hacks at all. “All CSS hacks are too risky in the long run, unless they only apply in orphaned or obsolete browsers, period. Tantek Çelik said this; I agree with it very strongly.”

Gallant states that the “time to kill the * html hack is when Vista arrives, presumably without the layout problem.” Wilson feels that fixing the browser is most important. “The Holly hack, and I say this with the greatest of respect, is an elephant gun solution. Sometimes it’s an elephant you’re trying to fix. Sometimes it’s a mouse. Some elephants are fixed in IE7, some mice are. We will not fix every possible layout issue in IE in IE7, however, and it’s unrealistic to expect we can do so.”

Filed under:   general
Posted by:   Molly | 10:30 | Comments (62)

Comments (62)

  1. There is a css hack that works for all versions of internet explorer, including ie7. You can read about it here:
    http://www.ibloomstudios.com/article7/

  2. Pingback: ninthspace » Conditional Comments

  3. So, nearly one year later, where is the new information? IE7B3 is out. How does it work? I don’t want to install it over IE6 just yet because I need to test for IE6 until IE7 is released and then I can allow it to overwrite IE6.

    Update this CSS compliance issue, please!

  4. Well – IE7B3 is a nightmare. It requires you turn off your spyware/adware tools and antivirus utility prior to install, which is just irresponsible, considering they have been coding Microsoft tools for decades. If you try to install even after that, you might fail because of certain protected registry keys. Oh, it will ask you to reboot anyway. Don’t bother.

    Once you get the message that IE7 has been foist upon your machine successfully, you can reboot. Prepare for a shock when you try to use it. It is likely you will receive either a “page cannot be displayed” error, a hung page, or a partially displayed page minus many features/components/text.

    Should you wish to restore normalcy by uninstalling IE7, you can do so, however, even after rolling back to IE6, your browsing experience with IE remains hosed. Reinstallation of XP SP2 did not help, nor did reinstalling IE6, so there is something wacky with the way the DLLs or even the registry settings are playing with it.

  5. All standards compliant browsers, and IE7, get the modern code and will just work. Bye.

  6. Interesting. I do find it interesting that we tend to hear less of this kind of thing with the other browsers like FireFox or Opera, but I suspect it’s only because they are used far less. Or, that they are not as complex as IE since they are standalone browsers. IE plugs into Windows itself, so that Windows works as a browser, and so it makes sense that they have a heck of a lot more issues than any of the other browsers. Perhaps this means that the standalone idea will, at the end of the day, still be the better idea even for Microsoft but I doubt they’ll ever consider that direction ever again.

  7. A lot of promises have been released about fixing some errors at IE. People have waited but only a minimum has been solved or almost solved. Hopefully, IE tech people would hear us out, IE users. We are getting impatient.

← Older Comments

Upcoming Travels