diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2014-03-04 23:49:09 +0100 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2014-03-10 19:25:25 +0100 |
commit | b5050dc4895c0c5e132f1192cd9f8617267347cb (patch) | |
tree | d10251031144689b23146d63e386e25535547723 /src/css | |
parent | 4a6d1631eaae2c5b89dfe58728b46a8997daba48 (diff) | |
download | jquery-b5050dc4895c0c5e132f1192cd9f8617267347cb.tar.gz jquery-b5050dc4895c0c5e132f1192cd9f8617267347cb.zip |
Support: Simplify the box-sizing test
Don't require body in the support.boxSizing test.
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/support.js | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/css/support.js b/src/css/support.js index 07a2a7f48..1078c0905 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -5,7 +5,7 @@ define([ (function() { // Minified: var b,c,d,e,f,g, h,i - var div, style, a, pixelPositionVal, boxSizingVal, boxSizingReliableVal, + var div, style, a, pixelPositionVal, boxSizingReliableVal, reliableHiddenOffsetsVal, reliableMarginRightVal; // Setup @@ -33,6 +33,11 @@ define([ div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || + style.WebkitBoxSizing === ""; + jQuery.extend(support, { reliableHiddenOffsets: function() { if ( reliableHiddenOffsetsVal == null ) { @@ -41,13 +46,6 @@ define([ return reliableHiddenOffsetsVal; }, - boxSizing: function() { - if ( boxSizingVal == null ) { - computeStyleTests(); - } - return boxSizingVal; - }, - boxSizingReliable: function() { if ( boxSizingReliableVal == null ) { computeStyleTests(); @@ -94,12 +92,6 @@ define([ "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + "border:1px;padding:1px;width:4px;position:absolute"; - // Workaround failing boxSizing test due to offsetWidth returning wrong value - // with some non-1 values of body zoom, ticket #13543 - jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { - boxSizingVal = div.offsetWidth === 4; - }); - // Support: IE<9 // Assume reasonable values in the absence of getComputedStyle pixelPositionVal = false; |