Skip to content

Commit 1ad9915

Browse files
committed
Misc: Fix the tests, revert some unneeded/broken reverts
Refs 65d7184
1 parent 65d7184 commit 1ad9915

File tree

5 files changed

+16
-20
lines changed

5 files changed

+16
-20
lines changed

src/css/curCSS.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ define( [
55
"./var/getStyles",
66
"./support",
77
"../selector" // Get jQuery.contains
8-
], function( jQuery, rnumnonpx, rmargin, getStyles ) {
8+
], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
99

1010
function curCSS( elem, name, computed ) {
1111
var width, minWidth, maxWidth, ret,
@@ -22,13 +22,12 @@ function curCSS( elem, name, computed ) {
2222
ret = jQuery.style( elem, name );
2323
}
2424

25-
// Support: iOS < 6, Android 4.0-4.3 only
2625
// A tribute to the "awesome hack by Dean Edwards"
27-
// iOS < 6 (at least) returns percentage for a larger set of values,
28-
// but width seems to be reliably pixels
29-
// this is against the CSSOM draft spec:
26+
// Android Browser returns percentage for some values,
27+
// but width seems to be reliably pixels.
28+
// This is against the CSSOM draft spec:
3029
// http://dev.w3.org/csswg/cssom/#resolved-values
31-
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
30+
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
3231

3332
// Remember the original values
3433
width = style.width;

src/css/hiddenVisibleSelectors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ define( [
44
], function( jQuery ) {
55

66
jQuery.expr.filters.hidden = function( elem ) {
7+
return !jQuery.expr.filters.visible( elem );
8+
};
9+
jQuery.expr.filters.visible = function( elem ) {
710

811
// Support: Opera <= 12.12
912
// Opera reports offsetWidths and offsetHeights less than zero on some elements
1013
// Use OR instead of AND as the element is not visible if either is true
1114
// See tickets #10406 and #13132
12-
return elem.offsetWidth <= 0 || elem.offsetHeight <= 0;
13-
};
14-
jQuery.expr.filters.visible = function( elem ) {
15-
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
15+
return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
1616
};
1717

1818
} );

src/css/support.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ define( [
3232

3333
// Support: Firefox<29, Android 2.3
3434
// Vendor-prefix box-sizing
35-
"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
36-
"box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
37-
"border:1px;padding:1px;width:4px;position:absolute";
35+
"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
36+
"position:relative;display:block;" +
37+
"margin:auto;border:1px;padding:1px;" +
38+
"top:1%;width:50%";
3839
div.innerHTML = "";
3940
documentElement.appendChild( container );
4041

src/offset.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ jQuery.fn.extend( {
9898
return box;
9999
}
100100

101-
// Support: BlackBerry 5, iOS 3 (original iPhone)
102-
// If we don't have gBCR, just use 0,0 rather than error
103-
if ( elem.getBoundingClientRect ) {
104-
box = elem.getBoundingClientRect();
105-
}
101+
box = elem.getBoundingClientRect();
106102
win = getWindow( doc );
107103
return {
108104
top: box.top + win.pageYOffset - docElem.clientTop,

test/unit/dimensions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ QUnit.test( "setters with and without box-sizing:border-box", function( assert )
411411

412412
// Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
413413
var parent = jQuery( "#foo" ).css( { width: "200px", height: "200px", "font-size": "16px" } ),
414-
el_bb = jQuery( "<div style='width:114px;height:114px;margin:5px;padding:3px;border:4px solid white;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;'>test</div>" ).appendTo( parent ),
415-
el = jQuery( "<div style='width:100px;height:100px;margin:5px;padding:3px;border:4px solid white;'>test</div>" ).appendTo( parent );
414+
el_bb = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;'></div>" ).appendTo( parent ),
415+
el = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;'></div>" ).appendTo( parent );
416416

417417
jQuery.each( {
418418
"number": { set: 100, expected: 100 },

0 commit comments

Comments
 (0)