Advanced box model test
Filed under: Firefox, Internet Explorer, Konqueror, Opera, Safari, Testing
By Sebastian Werner @ July 13, 2006 15:06
In preparation of our new layout engine we did a roundup of all modern browsers' abilities to render under the two different box models. It definitely is one of the most compelling questions in advanced web development: "Which browser supports what layout features and how well?". Like most other javascript toolkits qooxdoo currently depends on a box-sizing of "border-box". While not being the default box model in current browsers, many people think that it is the most natural way to define web layouts, if not layouts in general. The W3C-favored "content-box" model on the other hand is often seen as a rather counter-intuitive solution. Our tests particularly reveal how well the common use cases work in "border-box" regime.
Tested browsers and Screenshots
- Firefox 1.5 (Standard, Quirks)
- Internet Explorer 6.0 (Standard, Quirks)
- Internet Explorer 7.0 Beta 3 (Standard, Quirks)
- Opera 9.0 (Standard, Quirks)
- Konqueror 3.5 (Standard, Quirks)
- Safari 2.0 (Standard, Quirks)
Firefox 1.0 and Firefox 2.0 beta 1 behave identically to Firefox 1.5. Browsers based on Gecko 1.6 behave differently (screenshots may be provided soon).
Results
Konqueror is the only current browser which renders all test examples flawlessly. There seems to be no box model layout bug. Just perfect. Kudos to the developers! Internet Explorer 7.0 (only in Standards Mode), Firefox 1.5 and Opera 9.0 show perfect results as well, but only in the "content-box" tests. Unfortunately, each of these browsers exhibits individual problems in the "border-box" model.
Internet Explorer 6.0 and Internet Explorer 7.0 render equally (wrong) in Quirks Mode. Internet Explorer 7.0 comes with support for stretching (i.e. define left and right or top and bottom together) and min- and max-dimensions, but only in Standards Mode. At least one of the very few improvements due to the IE7 revamp. Both Internet Explorer versions do not support the handy "box-sizing" property at all. Choosing either standard compliant or quirks mode is achieved by an appropriate doctype declaration as usual. Keeping in mind IE's inability to work in a "border-box" regime, it is obvious that the second part of each test document (the two columns to the right) are always wrong. While Internet Explorer 7.0 renders flawlessly in Standards Mode, Internet Explorer 6.0, lacking many CSS features, only renders exactly one of all the squares correctly. Which one depends on the current render mode, of course. Quite dissappointing, but not unexpected results.
Mozilla Firefox as of version 1.5 shows an almost perfect rendering behavior. Surprisingly, it doesn't follow the "box-sizing" rule, if no width or height is explicitly defined. This means for example that it isn't possible to only define a min-width without setting a (bogus) width as well. Long distance calling cards. A work-around for such a bug in "border-box" mode could be to add an appropriate width or height to each min-width, min-height, max-width or max-height statement. As already mentioned the W3C default value "content-box" yields absolutely perfect results.
Opera 9.0 has many strange problems. Sometimes the box is too large, sometimes too small. It appears to be somewhat inconsistent as well: while the box widths are often ok, the box heights are plain wrong. Hard to make sense of such an asymmetric behavior. Opera 9.0 in the "content-box" model is perfectly well-behaved, though.
Please have a look at our tests documents online, either our standard compliant test or quirks mode test.
Any ideas or comments welcome!

Comment by chemix
Screenshots from Version Safari 2.0.3 (417.8)
July 14, 2006 20:46
Comment by Sebastian
Thank you chemix. I have optimized them using Photoshop and linked them above.
July 17, 2006 12:36
Pingback by qooxdoo » Blog » Advanced box model test - part 2
[...] Advanced box model test – part 2 [...]
July 17, 2006 14:19
Pingback by Ajaxian » Advanced Box Model Testing
[...] In part one, they focus on the differences in the “border-box” model in Firefox, IE, Opera, Konqueror, and Safari. A sample page was created and screenshots were taken (both in standard and quirks mode). Their findings show that there was only one, in this test case, that rendered the example correctly in both modes – Konqueror. Others came close, but had to switch to a “context-box” model to render correctly both ways. [...]
July 24, 2006 16:49
Pingback by Advanced Box Model Testing > Archives > Web 2.0 Stores
< ?xml version=\"1.0\" encoding=\"utf-8\"?> < !DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
[...] From Qooxdoo.org, there are two new posts spotlighting [...]July 24, 2006 18:33
Comment by Kenny
Using Safari/WebKit Build 419.3 I’m getting the same results in Standards and Quirks mode.
July 25, 2006 15:30
Comment by Sebastiaan van Stijn
Same here. Safari 419.3 produces the same results as Konqueror, spot-on!
July 25, 2006 23:46
Pingback by The WP Themes » Advanced box model test
[...] Very useful for understanding how different browsers render code and coding accordingly. Click here! [...]
July 27, 2006 22:04
Pingback by Pig Pen - Web Standards Compliant Web Design Blog » Blog Archive » Advanced Box Model Test
[...] Advanced Box Model Test (via Russ) [...]
July 29, 2006 07:48
Pingback by Max Design » Some links for light reading (19/7/06)
[...] Advanced box model test [...]
July 29, 2006 08:39
Pingback by a.css, esbudellant estàndards » Model de caixa i box-sizing
[...] A Qooxdoo presenten un test exhaustiu del comportament d’aquesta propietat; Un amb compatibilitat directa amb els estàndards i un altre amb compatibilitat inversa amb els estàndards. [...]
July 29, 2006 14:24
Pingback by Max Design » Some links for light reading (28/7/06)
[...] Advanced box model test [...]
August 7, 2006 23:01
Comment by JoeyBurns
Wow, there is some really nice info here.
I’ll definitely come back soon to see everything.
Way to go!
Joey
September 1, 2007 01:27