Skip to content

Commit cdfc2d0

Browse files
committed
CSS: Fix the pixelMarginRight support test in Android 2.3
1 parent 3747cc6 commit cdfc2d0

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/css/curCSS.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ function curCSS( elem, name, computed ) {
2525
ret = jQuery.style( elem, name );
2626
}
2727

28-
// Support: Android 4.0-4.3
29-
// A tribute to the "awesome hack by Dean Edwards"
30-
// Android Browser returns percentage for some values,
31-
// but width seems to be reliably pixels.
32-
// This is against the CSSOM draft spec:
33-
// http://dev.w3.org/csswg/cssom/#resolved-values
3428
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
3529

3630
// Remember the original values

src/css/support.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,15 @@ define([
6262
return boxSizingReliableVal;
6363
},
6464
pixelMarginRight: function() {
65+
// Support: Android 4.0-4.3
66+
// A tribute to the "awesome hack by Dean Edwards"
67+
// Android Browser returns percentage for some values,
68+
// but width seems to be reliably pixels.
69+
// This is against the CSSOM draft spec:
70+
// http://dev.w3.org/csswg/cssom/#resolved-values
6571
if ( pixelMarginRightVal == null ) {
66-
div.style.cssText = "display:block;width:50%;margin-right:50%";
72+
div.style.cssText = "display:block;width:50%;border:0;margin:0;padding:0;" +
73+
"margin-right:50%";
6774
documentElement.appendChild( container );
6875
pixelMarginRightVal =
6976
window.getComputedStyle( div, null ).marginRight === "4px";

0 commit comments

Comments
 (0)