Doctype switching for IE 8

So. A few weeks have passed since the version targeting Microsoft will introduce in IE 8 was made official and I posted my initial thoughts in Standards mode is the new quirks mode. I’ve had time to read many articles and hundreds of comments that discuss version targeting, and have thought some more about what it means and what I think about it.

After that thinking, my initial reaction holds: I don’t buy it. It doesn’t matter how many arguments in favour of version targeting I read, it still seems so utterly and completely wrong that standards aware web developers will have to opt in to opt out.

I think version targeting as it has been presented is an incredibly bad idea to force upon the minority of people in the web industry who have a clue and work hard to stay updated. If the switch was reversed, i.e. you’d have to insert the meta element if you wanted IE 7 rendering, it would make a lot more sense to me. If your site breaks in IE 8 and you can’t or won’t fix it, just insert a meta element and the problem is gone.

The argument against reversing the switch is that the clueless are too clueless to ever find out that there is an easy way for them to force IE back to IE 7 rendering. That may be true, but why should we let people who refuse to keep their skills updated get away with it?

Make doctype switching stricter

An idea that makes much more sense than forcing standards aware developers to opt in to opt out was put forward in WaSP Round Table: IE8’s Default Version Targeting Behavior. The idea is to keep using the doctype to switch modes, but require a strict doctype with a full URL for standards mode. I like that.

I don’t have any statistics to back it up, but my gut feeling is that most of the sites that accidentally trigger standards mode today (and would be most likely to break in IE 8) have either a transitional doctype or an XHTML 1.1 doctype. So unless there are statistics that prove that theory wrong, why not simply let the absence of a strict doctype (HTML 4.01 or XHTML 1.0) be what makes IE 8 pretend it’s IE 7?

I believe that many of the people who argue against the version targeting switch would say “Yeah, that seems like a good idea, let’s do that.” I know I would.

Realistically though, I doubt it matters what you or I think or say. In the end we’ll all have to do whatever Microsoft tells us to do. Either that or keep pulling our hair out while dealing with CSS and DOM bugs in IE 7 forever.

Posted on February 25, 2008 in Browsers, Web Standards

Comments

  1. I think Microsoft are digging IE into a shallow grave, if they continue with alienating developers. IE might not die overnight, but considering that we’re still putting up with IE6, waiting a few years to see IE die completely, doesn’t seem that long.

    On the other hand … if MS decide to go with a foward-thinking approach, they might actually surprise a lot of developers, and receive much praise.

    So, it’s certainly interesting to see what happens with IE.

  2. I empathize with your sentiments sir, but Zeldman’s recent article in ALA has changed my mind.

    From that WaSP discussion it’s obvious that IE are not alienating developers—in fact, it’s at the forefront of their minds. Remember that they still are a business and have business requirements making decisions for them (don’t we all). I would bet that the IE team isn’t crazy about the idea, but they feel it the best solution. Remember also that they are moving forward from the IE 5.5/6 days with true standards support.

    Even though it kind of irritates me that good developers are being punished for the bad ones, at least MS is making a concerted effort to reach out to both sides.

  3. I agree with your sentiment completely, though I think that the doctype idea probably won’t work; Dreamweaver for example spits out a correct doctype above pages and we all know what those pages look like.

    I think I’ve come to terms with the meta (using http headers it’s practically painless) but it indeed still feels wrong.

    Regardless of that I still can’t wrap my head around the fact that I practically never see a site that doesn’t work in firefox like it works in IE, so why does ie8 need this switch for ‘backward compatibility’?

    However it’s 99,9% likely to stay exactly the same, so we’d better just shut up and work with it.

  4. February 25, 2008 by Roger Johansson (Author comment)

    Kilian:

    Dreamweaver for example spits out a correct doctype above pages and we all know what those pages look like.

    Yes, but does it spit out a correct strict doctype?

  5. That sounds really great. I would agree with the “strict type” switching. I wish Microsoft would listen to this.

  6. February 25, 2008 by Matthew Pettitt

    I suspect there would have been a lot fewer objections if the default was latest version, with the switch to preserve old IE7 behaviour. Given the meta-equiv switch, administrators of intranet systems relying on old IE7 behaviour could make a single change to their server behaviours, and preserve the current code, whilst not forcing the web to default to a broken model for ever more.

  7. I suppose it depends on just what your objection to the Microsoft approach is, but given the choice between adding one silly meta element and re-coding my whole site to strict (I have some which are still transitional) - I’ll take the meta element.

    I must get round to posting about this on MY blog…

  8. Roger, I’m more concerned about your idea. Are you saying that you think anyone using a transitional DOCTYPE, under any circumstances, should be banned from having their site rendered accurately according to spec?

    Don’t get me wrong, I’m not in favour of deprecated elements or attributes being used particularly, but your pages don’t meet the W3C specs either:

    “HTML documents are constrained to conform to the HTML DTD both before and after processing any SCRIPT elements.”

    …and your GENERATED code contains an IFRAME, which certainly isn’t allowed in STRICT.

    Are you arguing that your site shouldn’t be rendered according to standards, or that it doesn’t apply to you? Whereas if you were using a Transitional DOCTYPE, you’d be adhering to standards … but according to your own argument you shouldn’t be able to see your site rendered correctly.

    (sorry to be such a pedant!)

    And while I’m broadly in favour of the IE8 switch, that’s despite the fact it’s an opt-in, as like yourself I would have much preferred it to be an opt-out…

  9. Surely, all the arguments about ‘legacy’ content and uneducated developers fall down because the rendering goes back to IE7, not to IE6 or even earlier.

    This seems to be the worst of both — no tight standards support for current developers, but enough standards support to ‘break’ content developed for IE5’s rendering engine.

  10. When it first broke about version targeting I thought along the same lines, what’s the point of having to add a meta tag when the doc type switch already has this functionality.

    I have read a few different views on this, but Mr Zeldman has also managed to swing my opinion and I don’t feel that it is such a big ask for developers to add one line to their sites. Gone are the bad old days of browser specific code and Microsoft is getting on the standards road, albeit slowly.

    This is not a perfect solution but it is the best Microsoft have given and a long road from what we have had to put up with.

  11. February 25, 2008 by Roger Johansson (Author comment)

    JackP:

    Are you saying that you think anyone using a transitional DOCTYPE, under any circumstances, should be banned from having their site rendered accurately according to spec?

    No, only from using the latest standards mode in IE 8.

    Are you arguing that your site shouldn’t be rendered according to standards, or that it doesn’t apply to you? Whereas if you were using a Transitional DOCTYPE, you’d be adhering to standards

    It’s unfortunate that many advertising scripts use iframes, so yeah I guess that would mean anyone wanting to use Google AdSense or the like on a site would have to accept that the generated code is invalid in order to get IE 8’s really really standards mode. By the way, not even switching to a transitional doctype here would make the mess Google inserts validate.

  12. Chris (#2): The argument about MS still has to run a business, is a double edged sword. I also have a business to run … and foolish decisions made by the most prolific browser vendor directly affects my ability to do business.

    By making poor decisions with regards to standards support in the browser, they ARE alienating developers, who in turn, will be so frustrated with MS tools, that they will be basing their businesses on non-Microsoft technologies. Thus, poor decisions for IE affects Microsofts business in more ways than one.

    Well, at least I am making that move, and by april 1st it’ll be offical.

  13. I’m realistic too, and I don’t think it matters either way what we think or say. IE/win is too broken to make any real progress without breaking something, and I’m not convinced the continued misuse of existing doctypes for more switching is all that much better than the presented version targeting. The only argument for doctype as mode-switch is that it is already there and done, so maybe less harmful to stretch it a bit further than to introduce a new one.

    The basic problem is that switching is needed for CSS and script support to be improved in IE8 - not for HTML. Thus, both the old and new switches are introduced at the wrong end and will probably clash with a huge number of “smart” solutions used on numerous sites and intranets and anywhere in between. They/we can only start counting what gets broken when IE8 is out and spreading, and by then it won’t matter all that much and we’ll have to live with whatever they’ve delivered.

    I’m not optimistic about the issue at hand, but I’ll make up my mind what to do about it when I see what we get.

  14. Its not just google adsense that needs transitional, advertising networks such as tradedoubler, cj and affiliate window all need doctype of transitional - thats unless you want to edit their code and remove any offending code.

  15. If the default behaviour was anything other than what it is, then the entire point of the exercise would be redundant.

    It’s a pain that we have to pander to the ignorant, but as has been proven time and again, you can’t force these people to educate themselves so they do things right. It simply doesn’t work. Never has, never will. Your proposed behaviour, although desirable, simply won’t work to solve the problem. It’s a bugger, but that’s the way it is.

    I can’t say I’m too bothered about having to add a meta tag if I want IE7+ behaviour. It’s one meta tag, and that’s as far as I have to think about it. My only debate is whether to include it or not. By letting all my sites look and function like IE7 that provides powerful motivation for people to move to a different browser. My decision will depend on what everyone else does. If most people omit it then competing companies won’t be offering advanced behaviour on IE7+ either, and I’ll have no need to ‘keep up’ in IE7+. I’m very tempted to not use it and hope that the resulting crippling of IE will erode market share further.

    So much ruckus, so little reason.

  16. February 25, 2008 by David ONE

    my initial reaction holds: I don’t buy it.

    It’s good to see so many industry ‘heavyweights’, like yourself Roger, seeing through the Microsoft / Zeldman FUD. There’s no justification for making standards-aware developers jump through extra hoops to make a browser work as it should, while rewarding the ignorance of other developers … and rewarding Microsoft with a de facto standard that protects their market share.

    I believe that many of the people who argue against the version targeting switch would say “Yeah, that seems like a good idea, let’s do that.”

    I certainly fit in to the category of those who have argued against the proposed switch and I’d be happy with a strict doctype triggering ‘real’ IE8, IE9, IEnn.

    After the way this whole thing was announced, it seemed like a fait accompli - it wasn’t an issue for debate, just a declaration from on high. It’s encouraging that the industry uproar seems to have made MS stop to reconsider.

  17. I agree with you 100%. We modern web developers work day and night to follow standards and keep up with specs.

    Maybe it’s time we got cut some slack, and we send a clear message to un-savvy developers that it might be time to pick up a book and start acting like professionals.

    If you can’t keep yourself updated when working with the Web - which obviously is the fastest moving industry of all - maybe it’s time to find a profession which pace you can keep up with.

  18. February 25, 2008 by James Norton

    I dont agree with this at all. Transitional doctypes are a standard and now I am going to be punished for using them?

    Surely this will mean more pages using a strict doctype but with invalid markup.

    I see the only answer being to use the switch that Microsoft has suggested but changing the default. An IIS patch sounds like a good idea as well.

    Of course, a standalone version would be ideal…

  19. Offcourse it’s quite normal from MS’s standpoint that they don’t what the same kind of breakups IE7 caused. Allthough caused by bad coded sites: it made IE7, and therefore MS, look bad in the eyes of the unaware. So I have little hope for our alternatives.

    Dispite all arguments in favor I still believe this to be a big blow against promoting standards. One big advangtage of the sites breaking in IE7 was much more webowners & companies previously unaware of webstandards, where at least listening to why standards should be the preferred way. With IE8 they can comfortably go back to ingorance…

  20. I’m with you on this, Roger.

    Years of dealing with Microsoft have proven to me that they are too stubborn to change their (collective) opinion. I’ve seen this with ASP.NET, Visual Studio, AJAX, etc. When you hear them say, “Customers asked for this”, it’s always corporate customers which is where their loyalty lies in the first place.

    I don’t expect them to back out of this idea no matter how bad it may be. I’m not being pessimistic here—-simply pragmatic.

  21. All the evidence suggests to me that version targeting really is fait accompli.

    We keep hearing about the “top 200 websites” which were tested for IE 6 and 7’s introductions, but MS won’t, or can’t even say how the 200 will fare in IE 8. Regarding switching on strict doctypes specifically, Chris Wilson said “I don’t recall having looked at those numbers explicitly.” MS considers themselves as having defeated the doctype switch through the “moribund IE 6” tactic, and they won’t fraternize with the enemy any longer.

    It’s easy to imagine that some vee pee issued an edict that upgrading to IE 8 will not affect a single website – other options are anathema and, incidentally, there is no budget to examine them.

    Perhaps the business question was “how do we adopt web standards, but still retain ownership of Our Web for another four years?” With all respect for Mr Wilson and the hard-working IE developers, the answer was probably decreed by whoever pays their salaries: make the Web default to IE 7, forever.

  22. We code for IE at all? Test in standards-compliant browsers and be done with it. If many sites look bad in IE, then people will start blaming IE for being non-compliant, much how they perceived Mozilla and Opera a few years ago. Then, they will start switching to standards-compliant browsers and MS will be forced to make IE standards compliant. So long as people insist upon using a broken web browser, let them see broken webpages.

  23. I will do whatever it takes to build standard aware websites to the lowest cost, both for my users (which really matters, right?) and my employer. If it forces me to write meta elements, or adjust my CMS:es HTTP headers, I will buy it. Period.

    Besides, what’s more important is the fact that Microsoft must find a way to get as many computers as possible to upgrade from IE5-IE7 to IE8. I’m really curious about how that chapter will be told. It is much better to have only IE8:s which is degraded than keep debugging IE5, IE6, IE7 and IE8 separately.

    And Really, Really standardsmode could be trigged by strict doctypes. I like that thought too.

  24. Dotan - you need to remember that a significant proportion of people using IE (of whatever version) are doing so not by and active choice but simply because it’s “the Internet button”. Many have probably never even heard of Firefox, never mind Opera etc.

    As far as they are concerned, it is your standards compliant website that’s rubbish, how on earth are they to know it’s really the browser?

  25. I’ve read so much on this and my gut instinct is the same now, the whole thing is a crock.

    We design sites to work in most browsers, including IE6 and then IE7. Why do we have to jump through more hoops for damn IE8? Browser sniffing, IE/MS is taking a backward step.

  26. February 26, 2008 by Stevie D

    The idea is to keep using the doctype to switch modes, but require a strict doctype with a full URL for standards mode. I like that.

    If you change that to HTML 4.01 Strict with URL, XHTML 1.0 Strict with URL, XHTML 1.1 with URL or HTML5, I’d be happy with it.

    It’s unfortunate that many advertising scripts use iframes, so yeah I guess that would mean anyone wanting to use Google AdSense or the like on a site would have to accept that the generated code is invalid in order to get IE 8’s really really standards mode.

    I’m happy to use HTML 4.01 Strict, which validates on the W3C validator, even though I’ve got GoogleAds on my site. As long as the browser isn’t going to validate the full generated code and reject anything that fails (which it shouldn’t do for HTML), IE8 should still use full standards mode.

    I dont agree with this at all. Transitional doctypes are a standard and now I am going to be punished for using them? Surely this will mean more pages using a strict doctype but with invalid markup.

    Not exactly. I’d be surprised if more than a handful of people who use (and need) a Transitional doctype will be using code that requires full standards support in IE8 and will fail in IE7 rendering.

    If many sites look bad in IE, then people will start blaming IE for being non-compliant

    No, they’ll just think you’ve written a cr@p website. Most internet users don’t know anything about web pages, they don’t know that the icon they click on to launch the internet gives them just one version of the many versions of IE, which is just one browser of the many browsers available. It won’t occur to them that the software pre-installed on their PCs could be defective, they will just assume that the website is badly written.

  27. The argument against reversing the switch is that the clueless are too clueless to ever find out that there is an easy way for them to force IE back to IE 7 rendering. That may be true, but why should we let people who refuse to keep their skills updated get away with it?

    Spot on. Why is Microsoft so utterly anti-progress? Idiots.

    We spend years dealing with IE’s CSS crappiness, and now that it’s finally improving they still want us to change our documents. Unbelievable.

  28. February 26, 2008 by Robert

    As far as they are concerned, it is your standards compliant website that’s rubbish, how on earth are they to know it’s really the browser?

    Why not use IE’s conditional comment? We just need some global initiative - create site which will explain that IE isn’t the only and one browser, that there are better alternatives, what are (dis)advantages etc. And add some #ienotice on every page with this URL and short explanation. Education could be a future not extra tags. Just compare MS dead ideas like activex - great, fantastic, few years later - abandoned. Whats next? IE9 with doctype switching + antoher meta, IE10 with doctype only because meta wasn’t so brillant idea? Only corporate clients could have problems with this.

  29. I think that strict doctypes are what we should be aiming for as developers. After all, the word transitional implies that it is only a stepping stone. On the other hand though HTML4.01 Transitional is still a valid standard after how many years?

  30. Sad to say but I think that the IE team will be very set on version targeting so as to “not break the web” (which in reality, imho, is what they’re already doing for the past x years)

    They’re already been giving us a hard time having to keep separate stylesheets for their browsers, I won’t mind making my site to fit IE8.. But if on;y they’d follow suit with FF and Opera and other standards-aware browsers, then we won’t have to do that anymore, right?

  31. At the risk of stepping in a rather big pond of web folk more conversant than I, might I ask this simple question? Microsoft lost a court case {convicted?} in re: Netscape et al. Why on earth are we answering to them? Why work around MSIE? If I had my druthers, they should just get out of the business until they play by the rules, not make the rules.

  32. February 27, 2008 by Roger Johansson (Author comment)

    JJohn:

    Why on earth are we answering to them? Why work around MSIE? If I had my druthers, they should just get out of the business until they play by the rules, not make the rules.

    We work around IE and Microsoft’s other sub-standard products simply because the market forces us to. I personally would love to treat Internet Explorer as I do Netscape 2, but that would not be wise from a business point of view. Unfortunately.

  33. I give your idea to make doctype switching stricter two-thumbs up :)

    All my sites are strict, I went through the trouble to make them like that and now I would just like to just continue following standards as I have been.

    There’s one important concern, though: IE 8 needs to get standards 100% right so we can finally end this BS. While pleased that IE 7 made a good inroads into standards, I was extremely disappointed it was an incomplete effort, thus creating the need for yet another bump in the road, namely IE 8, before it can finally smooth out. Once IE is fully standards-supporting, then most of our headaches will just go away.

    Then we can move forward.

    As long as there are makers of user agents, or web developers for that matter (the Transition is over), who are not conforming to a common set of standards, things won’t be quite right.

    The holdouts need to bite the bullet.

  34. I think the comments on IE being the Internet button on peoples PC’s is interesting, and nearly convinced me. While I still agree with it after a little thought, I don’t 100% agree with it.

    If that was the case then how would MS sell Office, Windows already comes with software for writing stuff (my favourite piece of MS software, Notepad). I know it’s not the same really, but it did make me stop and think.

    Many people I know are moving from Windows to Mac, which means they are not using IE any more. It will be interesting to see if Apple manage to erode the IE market with the Windows version of Safari.

  35. I agree 100%!

    And at what point is enough going to be enough? It’s bad enough that we are still stuck star hacking IE6 and this is just going to make the possibility of IE7 hanging around for too long just as great. IE is basically saying “Hey you like IE7? Well now you NEVER have to upgrade”. Gee thanks Microsoft!

    They should just stop supporting their past mistakes and move forward. Yes IE8 is standards mode may be a fantastic browser but what good does it do any developer wanting to use advanced practices if it works just like version 7?

  36. March 4, 2008 by Tate Johnson

    It looks like Microsoft is reversing their stance on the default behaviour of IE8.

    In light of the Interoperability Principles, as well as feedback from the community, we’re choosing differently. Now, IE8 will show pages requesting “Standards” mode in IE8’s Standards mode. Developers who want their pages shown using IE8’s “IE7 Standards mode” will need to request that explicitly

    Wow. It appears that Microsoft is actually listening to their customers (and the community).

  37. March 6, 2008 by doug twyman

    Even if IE8 is the greatest thing since sliced bread we still all have to deal with the reality of supporting the 32% of users still using Ie6 that they forced upon the world.

Comments are disabled for this post (read why), but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.