Jaa


The Default Layout Mode

During my talk at MIX 08, I covered more background and detail behind the new IE8 layout mode that provides greater standards support, particularly with regards to CSS 2.1, and version targeting. I’d like to follow-up that talk with a brief post on both points for those that were unable to attend in person.

Clearly there is a lot of momentum behind pushing the web forward (as evidenced, in part, by the lively dialog on this and other blog sites around the web). To this end, we’ve invested in the functionality demanded most by developers and designers – better standards support and cross-browser compatibility. You saw a peak into our progress with the Acid2 announcement a few weeks back. You can see more in the released developer build, which includes support for several CSS 2.1 features not found in previous Internet Explorer releases including the 'inline-table' value for the 'display' property and basic  generated content support (more to follow).

As you may have heard by now, Internet Explorer 8 will ship with three layout modes – Quirks, IE7 Standards, and IE8 Standards. The saying goes: “put your best face forward” and, true to this, Internet Explorer 8 will use its most standards compliant mode, IE8 Standards, as the default when encountering standards content. The behavior looks as follows:

Page Content Declaration

Layout Mode

Known standards DOCTYPEs and unknown DOCTYPEs IE8 Standards
Quirks mode DOCTYPEs (includes the absence of a DOCTYPE) Quirks

Note: A brief discussion on DOCTYPEs can be found on MSDN.

By displaying standards mode pages with our most rigid interpretation, we get closer to that utopia where content may be written once and expected to work in a similar manner across browser types. Keep in mind, however, that progress is often the result of trade-offs. On the one hand, we certainly want to invest in new features, those innovations that entice our existing customers to move to the newest release (and hopefully win us new customers as well). This force is a “push” – we want to move our product, and the community that uses it, forward. On the other hand, we want to ensure that we don’t senselessly break an ecosystem that has come to rely on the behaviors included in our previous releases. This force is a “pull” – causing us to do constrained innovation that specifically takes into account  backwards compatibility. 

The <META> tag attempts to solve this latter point by providing content developers a way in which to signal the desired layout mode regardless of DOCTYPE. This can be particularly useful as a “stop-gap” measure to provide the time required to build and test the latest standards compliant content.

Example:

Scenario: A website contains a standards mode DOCTYPE declaration but is actually giving versions of Internet Explorer, including Internet Explorer 8, non-standard content according to the “current” form of the standard.

Result: Internet Explorer 8 attempts to display the content using IE8 mode, the most standards compliant layout mode, because of the DOCTYPE declaration. The site fails to display correctly and updates to the site are needed.

Actions:

  1. Immediately update site content to ensure that Internet Explorer 8 is provided with standards content fitting the DOCTYPE (preferred).
  2. Defer the site update until the next scheduled maintenance window / period
      • Use the <META> opt-out to signal that Internet Explorer 8 should continue to display the document in a manner similar to Internet Explorer 7, e.g. ‘<META http-equiv="X-UA-Compatible" content="IE=7">. This can be done globally via a host-header or as a per-document edit. This action allows the site to still be usable by Internet Explorer 8 clients.
      • Create site content ensuring that Internet Explorer 8 is provided with standards content fitting the DOCTYPE.
      • Publish the new, standards-compliant content and remove the <META> opt-out.

Note: The <META> tag declaration always overrides DOCTYPE. A deeper discussion can be found in the developer whitepaper.

Another interesting point about the <META> tag is that it more precisely marks the content of a page than the larger bucket labels: “Standards” and “Quirks”. Regardless of whether a browser chooses to use that information today, it does seem like an interesting data point to have in the future...

Scott Dickens
Lead Program Manager

Edit: replaced "pretty print" quotes with regular quotes in META tag info

Comments

  • Anonymous
    March 06, 2008
    I don't think introducing measures to make broken and non-standards compliant websites is the right direction. IE8 should be standards compliant and force developers that aren't developing standards compliant websites to fix their own messes. We have all waited 7 years for Microsoft to develop a standards compliant browser to ease up the stress on developers everywhere. I think it is about time (also, discontinue support of IE6 so I can tell my clients that MS doesn't support it, thanks!).

  • Anonymous
    March 06, 2008
    Is there a way to see what mode IE8 is currently rendering with? If, I understand your post, if a doctype is not declared IE8 will use IE7 rendering? What if the page is declared as "Almost Standards" with a doctype of: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  • Anonymous
    March 06, 2008
    @RD: Check out the "ShowDocMode" Bookmarklet here: http://www.enhanceie.com/ie/ie8.asp

  • Anonymous
    March 06, 2008
    RD: Transitional doc types will render in the IE8 stds engine. A super easy way to see what mode IE is rendering at is to set up a favelet with javascript:alert(document.documentMode). When you click it, you'll get a 5, 7, or 8 back. 5==quirks, 7==IE7 stds mode, and 8==IE8 stds mode. I use it all the time!

  • Anonymous
    March 06, 2008
    "closer to that utopia". . . You know it bro! Ooh Rah!

  • Anonymous
    March 06, 2008
    You've been kicked (a good thing) - Trackback from DotNetKicks.com

  • Anonymous
    March 06, 2008
    @Eric: what's with the HTML tag coming before the Doctype on enhanceie.com? Thanks for the favouritelet.

  • Anonymous
    March 06, 2008
    @Ron: Just checking to see who's paying attention.

  • Anonymous
    March 06, 2008
    about the IE VPC Images it says theres a: IE6 XP IE7 XP IE8 ? IE7 vis1.exe IE7 vis2.rar IE7 vis3.rar whats the ie8 one on & what are the vis 1-3 images & why are 2 of them in rar compressed?

  • Anonymous
    March 06, 2008
    Thanks for the answers! I'll give that a try.

  • Anonymous
    March 06, 2008
    I don't know exactly where to direct my complaints, as this blog has been mysteriously inundated by posts, so I'll just say it: I have a problem with the way IE8 handles data URIs. The fact that you cannot use data URIs to create Javascript-laden web pages on the fly limits their usefulness, and the 32 kilobyte limit is completely arbitrary. No other browser vendor has data URIs implemented this way. Could someone explain to me how the 32 kilobyte limit was decided upon, and why data URIs couldn't be run in the same zone as Javascript URIs?

  • Anonymous
    March 06, 2008
    When opening a new Window in IE8 from an existing Window, the session is lost!  Which makes it unusable for any web application.  I can not find anywhere to configure this.  Help!

  • Anonymous
    March 06, 2008
    Scott, I think this is exactly the right approach to support the arguments of developers fighting for standards compliance in legacy applications. <a href="http://blogs.msdn.com/ie/archive/2008/03/06/the-default-layout-mode.aspx#8082825">Dustin</a>, when you have a commitment, like the IE team does, to ten years of backwards compatibility your answers have to be more erudite than "force developers that aren't developing standards compliant websites to fix their own messes". Replace "force" with "encourage" and it seems to me that's exactly what the IE team are doing, without being so aggressive. Everyone wants a standards compliant world and I've seen more progress towards that in the last 18 months than in the previous 7 years. A radical idea might be to offer positive alternative solutions rather than ranting, if you have any.

  • Anonymous
    March 06, 2008
    Le blog de MSDN, dans un billet intitul� "The Default Layout Mode", r�sume les diff�rents modes d'affichage disponibles sous la version 8 d'Internet Explorer.

  • Anonymous
    March 06, 2008
    EditPlus is a Windows text editor that I use for web development, it has a simple preview mode that uses IE to render a web page within the EditPlus window. However even with IE8 installed EditPlus seems to use IE7's rendering engine, is this a bug with IE or EditPlus? Do other programs, such as Firefox's "IE Tab" behave the same way? Imagine the confusion this could cause some people!

  • Anonymous
    March 07, 2008
    The comment has been removed

  • Anonymous
    March 07, 2008
    Hey Now Scott, Long live the <META> tag! Everyone should be experiencing web slices in IE8 Thx 4 the info, Catto

  • Anonymous
    March 07, 2008
    How do the differing rendering modes affect conditional comments? Does a page set to use the IE7 standards mode evaluate comments marked for IE7, or do they get rules for IE8? I know it'd be asking for a lot, but if you could modify the rendering mode without a restart and add in the IE6 standards mode it'd be great. I'd love to be able to test IE6 without a VM.

  • Anonymous
    March 07, 2008
    Just want to say thanks to the IE team again. I'm quite excited about the progress made. Now if we can just get the event model updated...

  • Anonymous
    March 07, 2008
    Hi, Scott Dickens, re: IE8 - Beta1 I'm an IT Pro - not a Developer.

  1. It's hard to report bugs. No Link on the IE8 - Beta1 Welcome page.
  2. Installing over Vista Business Desktop, distorted all the widgets on the right panel, : Clock, Stocks, Currency ..
  3. www.JetBlue.com - lower left, bottom of a table got scrunched together. IE7 Revert Button, fixed this. Thanks, Ashley@InforSystems.com  
  • Anonymous
    March 07, 2008
    Dustin, you're missing the problem with HTML pages being written to read-only media such as CD-ROMs, as release notes or as static help pages, including HTML Help. Even writeable help pages as part of a larger installation of software are affected until the supplier can issue a patch. This is the web-without-the-web, and the deployment story is not as simple as 'fix your broken pages one time on your web server'. IE, and IE's rendering engine in the form of the Web Browser control, have to cope with these pages as well as the classic HTML-over-HTTP(S) scenario. That's why I preferred the original solution, of stating which version you had actually tested with. Given the new, IE8-default mode, it might make more sense to deploy quirks-mode pages in these scenarios, if that will be more stable. I'm not sure I agree with HTML documentation for software, but that's the route we've gone down and we have to make it work.

  • Anonymous
    March 07, 2008
    What HTML5 tags and attributes do you support? I'd like to use them on my website ^_^

  • Anonymous
    March 07, 2008
    The comment has been removed

  • Anonymous
    March 07, 2008
    The comment has been removed

  • Anonymous
    March 07, 2008
    @Mike Dimmick, The good news is that if you put web content on a CD (readonly material), chances are that the end user if they look at it years from now, will be using Firefox, Opera or another advanced browser that will render the content fine. If you coded it against standards, or in an IE-only proprietary HTML format, then you messed up, and now your end users suffer.  The only way to code, is for standards, if you don't, you are asking for serious trouble.

  • Anonymous
    March 07, 2008
    The comment has been removed

  • Anonymous
    March 07, 2008
    about the IE VPC Images it says theres a: IE6 XP IE7 XP IE8 ? IE7 vis1.exe IE7 vis2.rar IE7 vis3.rar whats the ie8 one on & what are the vis 1-3 images & why are 2 of them in rar compressed?

  • Anonymous
    March 07, 2008
    Puh-leeeze.  Why do you make comments like this?  We are the ones who have been writing those blogs for years  Just say what you have to say without the holy preamble that might have been interesting five years ago. "Clearly there is a lot of momentum behind pushing the web forward (as evidenced, in part, by the lively dialog on this and other blog sites around the web)."

  • Anonymous
    March 07, 2008
    So basically a page without doctype but with some meta-tag can still trigger standards-mode in IE? Thats... odd

  • Anonymous
    March 07, 2008
    The comment has been removed

  • Anonymous
    March 07, 2008
    The comment has been removed

  • Anonymous
    March 08, 2008
    @PatriotB: I can think of situations where that is not completely in your own control (e.g. a server that emits X-UA-Compatible as an HTTP header by configuration). In such cases there is no way for an author to force quirksmode (or is that why MS decided to break normal header vs meta behaviour and let any meta X-UA-Compatible tag take precedence?). Anyhow it is inconsistent behaviour compared to other browsers. Imo X-UA-Compatible should complement DTD based switching, not overrule it.

  • Anonymous
    March 08, 2008
    The comment has been removed

  • Anonymous
    March 08, 2008
    So, you're telling the rest of the standard compliant browsers, and the rest of the standards world that the document complies with the standard (by declaring a DOCTYPE), but ONLY your browser will know that the truth is the document doesn't really comply with the DOCTYPE it just declared, so ONLY your browser will render it correctly and the other browsers don't... Brillant. That's playing fair with the community. :-P

  • Anonymous
    March 09, 2008
    Demian: We believe that most people who use the x-ua-compatible flag to override the doctype have IE-specific coding that other browsers wouldn't need. Also, there's certainly nothing stopping other browser vendors from respecting x-ua-compatible if they want. We're just tryng to provide web developers and designers with a little more control over how IE renders pages. Rowan: When IE is hosted by an application, we default the mode to IE7; we'd break many applications like Help in Windows XP otherwise. Like the CDROM case discussed in the comments, it would be difficult for application developers with deployed products to update their code.

  • Anonymous
    March 09, 2008
    I onsdags under MIX08-keynoten presenterades den första beta-versionen av Internet Explorer 8. Den innehåller

  • Anonymous
    March 09, 2008
    I onsdags under MIX08-keynoten presenterades den första beta-versionen av Internet Explorer 8. Den innehåller

  • Anonymous
    March 09, 2008
    One more time to demonstrate why x-ua-compatible should be complimentary to a standards triggering doctype and should not be leading: Imagine a uneducated webdeveloper (shouldn't be hard) who is testing some pages in IE8. He sees several pages break down and decides to add x-ua-compatible=IE7 to all pages (or asks his serveradmin to emit such header). Lo and Behold! The pages that were broken suddenly work correctly in IE8, but other pages are now suddenly broken - the ones that were depending on quirksmode! Being uneducated this poor webdeveloper is now very confused and blames IE...

  • Anonymous
    March 10, 2008
    Mix08 3日目 (最終日) Developing Cutting Edge Web Applications with IE8

  • Anonymous
    March 10, 2008
    For the Internet Explorer 8 Beta, we’ve added an Emulate IE7 button to the command bar. It will help

  • Anonymous
    March 10, 2008
    Mix08 3日目 (最終日) Developing Cutting Edge Web Applications with IE8

  • Anonymous
    March 13, 2008
    @Tony Chor: Thanks for your reply. Funny, you always expect other to join you, while most of us are expecting you to join the rest of the community. What can I say...

  • Anonymous
    March 18, 2008
    The comment has been removed

  • Anonymous
    April 10, 2008
    With the release of IE8 Beta 1, I'm pleased to be able to talk about the first round of improved standards

  • Anonymous
    July 28, 2008
    If you did not know Microsoft is currently working on Internet Explorer 8 (IE8), you may ask why a new

  • Anonymous
    August 31, 2008
    Microsoft said the right things, then blew it. In March, Microsoft announced that their upcoming Internet

  • Anonymous
    January 16, 2009
    Hier après-midi, entre deux tâches de ma Todo List je vais rapidement checker les flux RSS de certains