Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Defeating browser incompatibilities

Peter-Paul Koch has unveiled his new site, QuirksMode.org, which features over 150 pages of cross browser CSS and javascript tips and tricks. Five months in the making, there’s just too much good stuff to link to individual pieces here so my best recommendation is to head on over there and spend some time browsing around. I’ll make an exception though in linking to the Table of Contents script, which uses the DOM to create an additional navigation bar linking to each of the level 2 and 3 headers on a page. Another great example of the power of structural markup.

This is Defeating browser incompatibilities by Simon Willison, posted on 29th October 2003.

View blog reactions

Next: Nvu

Previous: Getting my stripes

12 comments

  1. It looks like a useful resource, but I have to take issue with a few things.

    He criticises the W3C for not including the <wbr> "tag" (it's an element type), yet doesn't mention the fact that Unicode, used by both HTML and XHTML, already provides that functionality, so adding a presentational element type would have been completely superfluous.

    He claims that XHTML doesn't provide the ability to use custom attributes - what about namespaces? Okay, so they aren't well-supported yet, so I was going to give him that one - except I found he wanted to use them for a job that other attributes are designed for! Instead of <a href="..." type="popup">, what's wrong with class="popup"? Or, if you are using popups for a particular reason, what about rel="online-help"? It seems he's ignoring the capabilities of existing document types, inventing his own non-standard way of doing things, and then complaining about it!

    He states, in essence, that he chooses "quirks mode" to avoid doctype switching. That doesn't make sense. The switching is still taking place, he just chooses the traditional mode over the mode that is closer to the specifications. Needless to say, I think that's an extremely poor decision.

    I think I'm going to use the website for information on browser bugs, but take any advice I find in there with a pinch of salt, I'm afraid.

    Jim Dabell - 29th October 2003 20:48 - #

  2. In Soviet Russia, browser incompatibilities defeat you!

    Randy Towers - 29th October 2003 20:55 - #

  3. I guess IBT ;)

    Simon Willison - 29th October 2003 21:02 - #

  4. Oh God, is PPK back again? Take everything he says with a grain of salt. At most.

    Mark - 29th October 2003 22:28 - #

  5. I read PPK's anti-standards pages just after I posted this entry, but I still think his site is a truly excellent resource. He's been preaching object detection over browser detection for as long as I can remember, and his browser compatibility charts (in particular the DOM ones) have saved me a great deal of time and effort in the past. I disagree with his stance on standards and filter out some of his advice (like custom attributes for controlling scripts) but the majority of his content is still better than most of the other Javascript related material on the web.

    Simon Willison - 29th October 2003 22:38 - #

  6. Hmm, from the personal perspective, I disagree with PPK on quite a few points, but he does have excellent resource pages. His DOM support tables are especially good as they are the only ones that I've found that are even near that complete.

    liorean - 29th October 2003 22:48 - #

  7. I would like to know how he came to this conclusion: "Well-formed HTML documents are XML documents..." Furthermore I totally agree with Jim's leading paragraphs.

    Robert Wellock - 30th October 2003 11:34 - #

  8. I see PPK as a good self-taught coder. Though is not kind with the W3C standards and have some times some non academic methods, his work is above the average and a great ressource for the web-dev community. I've used his DOM compatibility tables as a reminder for a while.

    Robert Wellock: Actually, well-formed HTML is almost XHTML, and XHTML is the XML formulation of HTML. He took a shortcut but many XML process can be use with HTML.

    P01 - 30th October 2003 14:16 - #

  9. He criticises the W3C for not including the <wbr> "tag" (it's an element type), yet doesn't mention the fact that Unicode, used by both HTML and XHTML, already provides that functionality

    Can someone explain this in more detail? In CSS-based designs a fixed-width box with normal (visible) overflow normally results in a long word/URL 'breaking out' of the containing box and obscuring other content to the right. I'd love to know how to insert a line-break that's more practical than the &shy; soft hyphen ;-)

    oli - 31st October 2003 05:30 - #

  10. oli, this works:

    <style="font-size: 0; width: 0"> </span>

    I simply styled a span element to have zero width and font-size. However, text still breaks around the space inside the element. Thus a "zero-width space." Here's an example:

    hello<style="font-size: 0; width: 0"> </span>mom<style="font-size: 0; width: 0"> </span>hello<style="font-size: 0; width: 0"> </span>mom<style="font-size: 0; width: 0"> </span>hello<style="font-size: 0; width: 0"> </span>mom<style="font-size: 0; width: 0"> </span>hello<style="font-size: 0; width: 0"> </span>mom

    Of course, you could set up an entity to hold that code, or make the rule the default style for span elements. Here is a way to declare an entity (note: you can add the PUBLIC Identifier after the html and before the [.

    <!DOCTYPE html [
      <!ENTITY ybsp '<style="font-size: 0; width: 0"> </span>'>
    ]>

    I called the entity ybsp for "yes break space." :-) Here's an example:

    Hello&ybsp;mom!&ybsp;Hello&ybsp;mom!&ybsp;Hello&yb sp;mom! ...

    Then you can type the entity (&ybsp;) to save your fingers (and bandwidth)! Hope that helps.

    Jimmy Cerra - 31st October 2003 06:31 - #

  11. I assume the peculiar "shortcut" he was considering involved looking at XML documents as conforming SGML documents. It was only because he said they "are" which was of interest not that they were relatives or could be accessed via the DOM, but at least his statement has been cleared up.

    Robert Wellock - 31st October 2003 09:57 - #

  12. Does anyone know why QuirksMode.org is not available? michael

    michael - 15th August 2005 03:32 - #

Comments are closed.

Previously hosted at http://simon.incutio.com/archive/2003/10/29/quirksMode

A django site