aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2015-02-05 01:41:10 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2015-02-05 01:41:10 +0100
commitcdfc2d092afad5a3e5b3978b04b402a1ee9dce79 (patch)
tree028e8849eeedc0c13aaed49075570b8f9eb2c345
parent3747cc642a48d2a5a8ac83069f66bddd33bea301 (diff)
downloadjquery-cdfc2d092afad5a3e5b3978b04b402a1ee9dce79.tar.gz
jquery-cdfc2d092afad5a3e5b3978b04b402a1ee9dce79.zip
CSS: Fix the pixelMarginRight support test in Android 2.3
-rw-r--r--src/css/curCSS.js6
-rw-r--r--src/css/support.js9
2 files changed, 8 insertions, 7 deletions
diff --git a/src/css/curCSS.js b/src/css/curCSS.js
index f5c85ecc0..aba57ad37 100644
--- a/src/css/curCSS.js
+++ b/src/css/curCSS.js
@@ -25,12 +25,6 @@ function curCSS( elem, name, computed ) {
ret = jQuery.style( elem, name );
}
- // Support: Android 4.0-4.3
- // A tribute to the "awesome hack by Dean Edwards"
- // Android Browser returns percentage for some values,
- // but width seems to be reliably pixels.
- // This is against the CSSOM draft spec:
- // http://dev.w3.org/csswg/cssom/#resolved-values
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
diff --git a/src/css/support.js b/src/css/support.js
index 3165af87d..b26cc568e 100644
--- a/src/css/support.js
+++ b/src/css/support.js
@@ -62,8 +62,15 @@ define([
return boxSizingReliableVal;
},
pixelMarginRight: function() {
+ // Support: Android 4.0-4.3
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Android Browser returns percentage for some values,
+ // but width seems to be reliably pixels.
+ // This is against the CSSOM draft spec:
+ // http://dev.w3.org/csswg/cssom/#resolved-values
if ( pixelMarginRightVal == null ) {
- div.style.cssText = "display:block;width:50%;margin-right:50%";
+ div.style.cssText = "display:block;width:50%;border:0;margin:0;padding:0;" +
+ "margin-right:50%";
documentElement.appendChild( container );
pixelMarginRightVal =
window.getComputedStyle( div, null ).marginRight === "4px";