Skip to content
Browse files

Adds box-sizing check for IE9 inputs and buttons

  • Loading branch information...
1 parent 1dda994 commit d4b31a15ff7bd0ffb6576229d34a98ce1c9c4085 timmywil committed Apr 14, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/css.js
3 src/css.js
@@ -344,7 +344,8 @@ function getWH( elem, name, extra ) {
// We're addressing the way Firefox handles certain inputs and buttons,
// offsetWidth/height actually returns a normal width/height
boxSizing = rinputbutton.test( elem.nodeName ) &&
- curCSS( elem, "-moz-box-sizing" ) === "border-box";
+ ( curCSS( elem, "-moz-box-sizing" ) === "border-box" ||
+ curCSS( elem, "box-sizing" ) === "border-box" );
jQuery Foundation member
jdalton added a note Apr 16, 2011

Curious about the bug here. Would you explain the issue?

jQuery Foundation member
timmywil added a note Apr 16, 2011

This code is no longer present, but jboesch had a fix for inconsistent width on inputs and buttons due to the different default behavior of box-sizing in different browsers. Different widths were being returned for different browsers, but due to the aforementioned box-sizing style being different, we were actually returning correct values. However, there is still a problem in IE8 even when box-sizing: content-box is set.

jQuery Foundation member
jdalton added a note Apr 16, 2011

Thanks for explaining it :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
// IE will return auto if we try to grab a width/height that is not set
if ( boxSizing || cur === "auto" ) {

0 comments on commit d4b31a1

Please sign in to comment.
Something went wrong with that request. Please try again.