Anne van Kesteren

CSSOM: clientHeight, offsetHeight and scrollHeight

I made a small table demonstrating how browsers implement clientHeight, offsetHeight and scrollHeight on body and html elements in quirks and standards mode. Interoperability is a joke, of course. Standard or no standard, browsers will always find ways to disagree. For the CSSOM it is important that one of the behaviors above, or a mix, ends up being defined. However, deciding what should end up in the specification is complicated as changes to any browser is likely to break something and maybe fix something else. Aligning mostly with Internet Explorer probably makes sense although we have to be careful not to break sites that use an alternate code path for non-Internet Explorer browsers (which also do not really agree with each other…).


  1. I am shocked that, in this day and age, someone would advocate "aligning with Internet Explorer" and even bother with "quirks mode". Or am I missing something in the context of this post?

    Posted by Doc at

  2. Microsoft invented these attributes and about 50% of the sites (if not way more) are in quirks mode. For other user agents it is very important to consider what Internet Explorer does as many pages are authored against Internet Explorer. I’m trying to deal with reality, not with theoretical purity.

    Posted by Anne van Kesteren at

  3. Anyone who uses quirks mode is authoring with a broken model. The fact that someone makes that error is no reason to cater to it. Learn how to markup pages.

    Posted by Doc at

  4. Maybe this isn't really on topic but it might useful or interesting for you. A while ago I made a viewport testcase to see where scrollbars are placed in different browsers. Of course every browser vendor went his way but it's also stunning to see how many differences there are between the modes (application/xhtml+xml and text/html).

    Posted by Koen De Vreeze at