Behaviour of getComputedStyle with box-sizing: border-box

Hi list,

There's a bug against WebKit pointing to a discrepancy in behavior
between WebKit and Firefox when getComputedStyle is used on an element
with box-sizing:border-box. I'm trying to work out which behavior is
correct.

Here's the bug: https://bugs.webkit.org/show_bug.cgi?id=15880

In brief, here's the test:

div {
	box-sizing:  border-box;
	border: 3px solid blue;
	padding: 5px;
	width: 50px;
}

What should the value of
window.getComputedStyle(document.querySelector("div"), null).width be?
Should it be the specified width of the element (50px), or the width
of the content box (34px)?

Cheers,
    -Shane

Received on Thursday, 16 June 2011 03:43:24 UTC