Improving the CSS 2.1 strict parser for IE 7

Great news from the IE Blog: Improving the CSS 2.1 strict parser for IE 7. Some highlights:

  • The root node selector has been removed, so no more * html CSS hacks. Don’t worry too much about all your CSS going nuts because of this - IE7 will have support for the child selector (>), meaning it will apply the rules meant for modern browsers (which IE7 will be by the looks of it). If you really need to single out IE7 you can use conditional comments (which in my opinion is what you should use instead of CSS hacks anyway).
  • Proper support for multi-class selectors. Goodie, because I’ve started using these more.
  • Improved parsing of pseudo-element selectors. Also a welcome fix.

It really looks like the people on the IE team are serious about making IE 7 a top notch browser.

Now where’s the Mac version?

Posted on September 3, 2005 in Browsers, Quicklinks

Comments

  1. September 3, 2005 by Philipe

    I don’t think there will be a Mac version. Why would someone use IE on a OS with a much better browser preinstalled?

  2. I don’t think there will be a Mac version. Why would someone use IE on a OS with a much better browser preinstalled?

    Because they are stupid! Why don’t people install Firefox on there PC instead of IE? Because they are stupid and ignorant.

    Apple should make sure that you can not use IE in Tiger! Then we can at least drop support for IE/Mac a bit more.

  3. Because they are stupid! Why don’t people install Firefox on there PC instead of IE? Because they are stupid and ignorant.

    By that logic they wouldn’t install IE for Mac. I somehow have my doubts that IE7 will be better than Safari though.

  4. This is certainly great news that they’re fixing their selector support, but I really wish they wouldn’t introduce more bugs. They said they have fixed this selector:

    p:first-letter:hover {}

    However, that is invalid since a pseudo-element can only be appended to the end of the last simple selector in the chain, not appear anywhere inside it.

    I’m not completely happy about some of these fixes only being for standards mode; however, since quirks mode is intentionally broken anyway, and should never be triggered under any circumstances by a competent author, I can live with the decision.

  5. I’d protest anyone still using IE for Mac! They have so many better choices over the abandoned IE. I have no Mac to test my things but the more standards compliant all browsers are, the more everybody will be happy, and IE7 is good news.

    Their decision in dropping * html is spot-on, if they can really adhere to standards. We won’t have to redo our CSS with hacks for IE7 to benefit.

    It is also a good idea to use, for the alphaImageLoader styles, to target IE6 only using conditional comments, and serve IE5.x the same pngs (let them notice something is wrong, so they can upgrade to next-gen browsers), or if you have the time, gif versions for all

  6. September 4, 2005 by Roger Johansson (Author comment)

    Lachlan: I don’t know… I’ve been reading and re-reading the Selectors chapter of the CSS 2.1 spec for a while now, and I think that selector actually is valid.

    Let’s take a closer look. Here’s the selector:

    p:first-letter:hover {}

    From the spec:

    One pseudo-element may be appended to the last simple selector in a chain, in which case the style information applies to a subpart of each subject.

    This chain of selectors contains only one simple selector, so using a first-letter pseudo-element is valid. Nothing is said about it having to be the very last thing in the selector. I interpret it this way: “Only one pseudo-element is allowed in a selector. If a selector consists of a chain of simple selectors, only the last simple selector may have a pseudo-element.”

    Pseudo-classes are allowed anywhere in selectors while pseudo-elements may only appear after the subject of the selector.

    In this case, p is the subject, and the pseudo-element appears after it. The :hover pseudo-class is allowed anywhere in the selector, including after the pseudo-element.

    Which makes the selector valid.

    I’m all cross-eyed after reading the spec, so I could be wrong.

  7. Ah, people = stupid. And they say us geeks are arrogant? :)

    I was quite surprised that the first three comments over on the IE Blog said “Hey, give us back our * html hack!” Given the fact that IE7 seems intended to get as close to standards support as possible, it’s vastly preferable that stuff like this is fixed.

    If they kept on interpreting * html, and fixed the bugs that we’ve (in the past) tried to squash via * html, then we’d have more work to do on old sites. They’re being very, very nice by looking into this stuff, actually checking what us client-side developers have been doing and figuring out the best way forward. Kudos, kudos, kudos.

    As for only fixing this stuff in strict mode: quite right. Quirks mode is there for people with investment in and reliance on the old IE way who can’t easily move away from it. The whole idea is that stuff stays the same in it.

  8. I’d like to see a Mac (and *nix) version for developers, at a minimum. Getting IE running in wine can be a real pain in the butt. Besides, if they’re serious about making a good browser (and they actually pull it off), then who cares who uses it instead of an equal browser?

  9. September 23, 2005 by zcorpan

    See Hixies comment on IEBlog about pseudo-elements.

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.