unfiled → manipulation
undecided → low
pending → closed
Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a testcase!
I don't think there is any bug here. The documentation on
width(value) seems sufficiently clearly:
.width() will always return the content width, regardless of the value of the CSS box-sizing property.
>Note that .width('value') sets the width of the box in accordance with the CSS box-sizing property.
So the behavior of
width(value) depends on the default for
box-sizing in the browser. Many browsers (as stated in the CSS3 box-sizing docs) have
border-box as default for ''replaced elements and input elements'' while using
content-box for the other elements. Maybe you just didn't know this specific information.
Check also this test case where you can see that it works like expected. And where you can see that the
border-box as default and the
content-box as default. After the "switch" of the
box-sizing property you can see how the behavior changes.