This is a requirement in order to work with controls that have border and padding. For compatibility with other browsers, any engine-implemented controls have to treat width/height as though they are specified on the border-box. The best way to implement this is by adding support for box-sizing.
The KDE khtml tree has box-sizing support, FYI
I didn't know that. Thanks. Not sure if it will be easy to merge or not.
Forgive my spamming, but another use case of box-sizing is enabling script-free and mostly hassle- free scaling interfaces that extend to the full height (and width) of the browser window. For some web applications, this is essential. The W3C box model is nice in most cases, but box-sizing: border-box is required to enable stuff like: { height: 100%; padding: 20px; } on a div and having it fit inside its parent AND having the padding (and margin and border.) This is also a far simpler solution than to allow expressions in CSS values. Also, if you add support for this, please also support -moz-box-sizing as some sites (notably by Backbase http://www.backbase.com/) put the browser in quirks mode to force IE into the box-sizing model and then set -moz-box-sizing to get the same effect in Mozilla. Safari is not supported for this reason (and because of the missing XSLTProcessor object, but that's being worked on, I believe.)
KDE's support for box-sizing is partial and not enough to land. I'm working on a more complete implementation.
This is now required to get buttons to work right, so P1.
Created attachment 4471 [details] Patch that implements box-sizing This patch implements box-sizing. I have tested it pretty thoroughly for fixed min-max/width-height for both replaced and non-replaced elements. I am going to write more test cases to exercise the percentage cases to make sure they work. Tables are actually using border-box all over the place already, and it might be nice to eventually describe their quirky behavior using box-sizing, but for now I've left all that code alone (and in fact it could be adversely affected by the use of box-sizing, but I'm not terribly concerned about that at this point). I will file a follow-up bug after this lands to track testing of this property in conjunction with tables (mainly just making sure it gets ignored without incident).
Comment on attachment 4471 [details] Patch that implements box-sizing The actual code change looks fine, I read the whole thing carefully. But don't we need some layout tests for this?
Dave landed this change today.
Created attachment 4483 [details] box-sizing test with 100% height relatively positioned DIVs Works great. Tested using attached test case, with one problem: Percentage height of relatively-positioned elements inside absolutely-positioned elements doesn't quite work right. The attached test case works correctly in Firefox 1.0.x and IE6, with the two content columns stretching to fit the vertical space between the header and footer.
Opening a new bug to track this issue, since it's not a box-sizing bug.
5517 tracks the percentage height issue.
(In reply to comment #11) > 5517 tracks the percentage height issue. > Thanks!