andrew ingram's homepage

  1. Home
  2. Archives
  3. Portfolio
  4. About

Abstract

A brief summary of the article

With all the noise over the revelations from Microsoft this week concerning standards rendering in IE8 I’ve found it hard to collect my thoughts on the subject, but I’ll give it a try anyway.

Content

Main article body

This week Microsoft revealed that to trigger standards rendering in IE8, web authors will need to use a new meta tag to specify which version of the IE rendering engine to use. Alternatively (and this wasn’t immediately apparant) authors can just use an unknown doctype such as the HTML5 one which would automatically trigger standards mode. I’ll say it outright that I’m not a fan of the idea but I can see why it’s been done, I find it arrogant of Microsoft to demand special treatment when we’ve already had to put up with quite a lot of IE’s rubbish over the years. This is coming from someone who is normally an apologist for Microsoft, normally I take the viewpoint that whilst making things work in IE is a pain it’s usually relatively straightforward once you reach a certain level of experience and become aware of the problem areas.

But there is something that is bothering me alongside this, why the hell do we keep making changes to our structural/context layer (HTML) in order to control how the presentation layer (CSS) behaves? Why should my use of a valid doctype mean that my CSS magically works properly? A doctype is used to validate the structure of an xml document, it has nothing to do with how it’s displayed, and why are we still using doctypes anyway? XML Schema Definitions are much easier to develop, from what I gather they give you a lot more flexibility and they’re really easy to understand. This isn’t a rant about doctypes though, this is a rant about me having to change one area of my code to affect how a completely different part of my code performs.

So we have to use proper doctypes to get IE6 and IE7 to use CSS more correctly than IE5, but that’s not enough – we also have to add conditional comments into our HTML so that we can deliver special CSS to them to clean up the things that IE still can’t do right. Now we have IE8 to look forward to, but now we have to add even more to the head of our documents to trigger the probably-still-not-right-but-getting-closer rendering mode in this new version.

Why the hell aren’t we shoving all this information in our CSS instead? If this information is controlling how the CSS works surely it would make sense to configure it there? In a proper deployment environment it’s a piece of cake to update CSS because it’s generally served from a different web server to the web application, we can easily tweak the CSS for new browsers without so much as having to reload/redeploy anything. Quite frankly, whilst I prefer clean CSS due to being a bit of a perfectionist, if I have to stick all this nonsense somewhere it’d rather it be in the CSS than the HTML. I consider it much more important to have valid and streamlined HTML than CSS.

Just a thought.

Comments

What people have had to say about this article

  1. Pilaf #
    02:04pm, 26th January 2008

    As far as I know JavaScript and the DOM are also affected by this, so it’s not just CSS that IE needs to be notified about.

  2. Andy #
    02:49pm, 26th January 2008

    I hadn’t realised that JavaScript and DOM would be affected too, is this confirmed?

    Well, if everything is affected I’d say the only real option to choose is the server header one.

  3. Dick C. Flatline #
    05:27pm, 26th January 2008

    M$ will has-never/doesn’t/will-never have/get a clue.
    They are the Sultans, the Sultans of Bloatware…...

  4. Matt Wilcox #
    07:50pm, 26th January 2008

    The entire page will be effected by the new tag, because the meta tag invokes not just the trident render engine, but also the trident document parser. It treates the entire page as IE7 would – not just the CSS, but the HTML and JS too.

    CSS is the most obvious problem because it’s the one that we see. But the same problems could happen to the HTML and the JS, it’s just that the effects are less visible by nature of what they are.

  5. Andy #
    08:08pm, 26th January 2008

    Thanks for clarifying that Matt.

    We all want to fix what should really only be a temporary problem, but I’m concerned that this meta tag will end up being a permanent fixture rather than a temporary measure. Is there a second stage to the plan where the meta tag gets phased out as old versions become less common?

    At the moment web developers target IE6, IE7 and everyone else, when IE8 is released I imagine that IE6 will soon become obsolete and instead we’ll be targeting IE7, IE8 and everyone else. Are we always going to be developing our sites to work on 3 completely different sets of rules, or is there a long term plan to get this down to just 1?

    What if we finally get to that ideal situation of just developing the site without version targeting and then we realise that everyone is scared to experiment with new browser features for fear of ruining the apparent web browser utopia.

  6. h3 #
    08:36pm, 26th January 2008

    Nice post, I 100% agree with you.

    Remember when some people wanted Google to use black a background as it would supposedly save the world billions in electricity bills. Well I’d rather just make IE disappear from the web, we could spare the world billions of hours of futile monkey patching.

    Your proposition to use CSS to target browser sounds good and very logical, but I’m not sure it would work. Plus, I can’t see a clean way to achieve it.

    • First for obvious you would have to use something that overload the CSS selectors with something like this: h1[browser=IE] {}. I already see my style sheets bloated with redundant code.
    • You can’t change the code of old browser, so you can’t make them accept new standards. That’s why people started using hacks.
    • I don’t think that the CSS working group would accept to introduce this solution. They will simply reply: “this is not a CSS problem, it’s a browser problem”. And .. they will be right.

      Sometimes I wish we could just leave broken features of our websites broken and show a message “sorry your browser sucks” or something :D

      But of course in the real world, we are the ones who ends up looking bad when we fail to comply to every existent browsers caprices. So we monkey patch and pretend that there’s nothing wrong with a user’s browser that was created nearly a decade ago.

      I’m still not sure if it’s a running gag or a tragedy.

      Cheers

  7. dlexc #
    09:34pm, 26th January 2008

    @Andy I’m kind of hoping that we can treat ie8 as “everyone else”. They’ve past the Acid2 test which means they are way ahead of even firefox in CSS 2.1 support, and I’m just hoping they’re also gonna give us proper dom levels 1 and 2 support.

  8. Anon #
    08:01am, 04th March 2008

    h3:
    Sounds like you’ve not used a non-MS browser enough. You will often find Intranet sites that turn away non-IE browsers and there is the odd regular internet site that will do it too…

  9. Mark S. #
    07:07pm, 08th April 2008

    I believe that they changed it so then instead of having IE7 standards as default, IE8 standards are, and if you want IE8 to use the IE7 renderer then you would have to use a metatag to make the browser use IE7 compatibility.

Add Comment

Use this form to add your own comments

Colophon

Andrew Ingram is a 24 year old British Web Developer. He hopes to one day be able to legitimately call himself talented. He currently resides in Clapham, London, which is more expensive than it deserves to be.

Twitter Status

can anyone confirm this ecommerce pattern? sun/mon good for visits, mon/tues good for sales? - Link

Qualifications

Feeds

Subscribe to the RSS feed to read new content at your leisure (requires compatible software).
Full-Entry Feed