aboutsummaryrefslogtreecommitdiffstats
path: root/src/support.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-04-10 17:18:00 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-04-10 17:26:52 -0400
commitd7217cc29c24f582198ce2df7db54a55625e8259 (patch)
treec6208b2631c8c30a9f9489226faca7a4f389fe33 /src/support.js
parent5376a809c0d2bee4b7872847c2821e458dfdcc3b (diff)
downloadjquery-d7217cc29c24f582198ce2df7db54a55625e8259.tar.gz
jquery-d7217cc29c24f582198ce2df7db54a55625e8259.zip
Fix 11004. getWH() box-sizing:border-box includes padding and border.
Diffstat (limited to 'src/support.js')
-rw-r--r--src/support.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/support.js b/src/support.js
index ccf9d4315..8e50a15b7 100644
--- a/src/support.js
+++ b/src/support.js
@@ -91,7 +91,8 @@ jQuery.support = (function() {
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
- pixelMargin: true
+ pixelMargin: true,
+ boxSizingReliable: true
};
// jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
@@ -251,17 +252,17 @@ jQuery.support = (function() {
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
}
- div.style.cssText = boxSizingPrefixes.join("box-sizing:border-box;") + "width:4px;padding:1px;border:1px;display:block";
+ div.style.cssText = boxSizingPrefixes.join("box-sizing:border-box;") + "border:1px;width:4px;padding:1px;display:block;margin-top:1%;";
support.boxSizing = ( div.offsetWidth === 4 );
+ if ( window.getComputedStyle ) {
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+ support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
+ }
offsetSupport = {
doesNotIncludeMarginInBodyOffset: ( body.offsetTop !== conMarginTop )
};
- if ( window.getComputedStyle ) {
- div.style.marginTop = "1%";
- support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
- }
if ( typeof container.style.zoom !== "undefined" ) {
container.style.zoom = 1;