Permalink
Browse files

Misc: Fix the tests, revert some unneeded/broken reverts

Refs 65d7184
  • Loading branch information...
mgol committed Nov 16, 2015
1 parent 65d7184 commit 1ad9915d11e27ebce8016ef81163206fb68b2335
Showing with 16 additions and 20 deletions.
  1. +5 −6 src/css/curCSS.js
  2. +4 −4 src/css/hiddenVisibleSelectors.js
  3. +4 −3 src/css/support.js
  4. +1 −5 src/offset.js
  5. +2 −2 test/unit/dimensions.js
View
@@ -5,7 +5,7 @@ define( [
"./var/getStyles",
"./support",
"../selector" // Get jQuery.contains
-], function( jQuery, rnumnonpx, rmargin, getStyles ) {
+], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
function curCSS( elem, name, computed ) {
var width, minWidth, maxWidth, ret,
@@ -22,13 +22,12 @@ function curCSS( elem, name, computed ) {
ret = jQuery.style( elem, name );
}
- // Support: iOS < 6, Android 4.0-4.3 only
// A tribute to the "awesome hack by Dean Edwards"
- // iOS < 6 (at least) returns percentage for a larger set of values,
- // but width seems to be reliably pixels
- // this is against the CSSOM draft spec:
+ // 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 ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+ if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
@@ -4,15 +4,15 @@ define( [
], function( jQuery ) {
jQuery.expr.filters.hidden = function( elem ) {
+ return !jQuery.expr.filters.visible( elem );
+};
+jQuery.expr.filters.visible = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
// Use OR instead of AND as the element is not visible if either is true
// See tickets #10406 and #13132
- return elem.offsetWidth <= 0 || elem.offsetHeight <= 0;
-};
-jQuery.expr.filters.visible = function( elem ) {
- return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
+ return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
};
} );
View
@@ -32,9 +32,10 @@ define( [
// Support: Firefox<29, Android 2.3
// Vendor-prefix box-sizing
- "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
- "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
- "border:1px;padding:1px;width:4px;position:absolute";
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
+ "position:relative;display:block;" +
+ "margin:auto;border:1px;padding:1px;" +
+ "top:1%;width:50%";
div.innerHTML = "";
documentElement.appendChild( container );
View
@@ -98,11 +98,7 @@ jQuery.fn.extend( {
return box;
}
- // Support: BlackBerry 5, iOS 3 (original iPhone)
- // If we don't have gBCR, just use 0,0 rather than error
- if ( elem.getBoundingClientRect ) {
- box = elem.getBoundingClientRect();
- }
+ box = elem.getBoundingClientRect();
win = getWindow( doc );
return {
top: box.top + win.pageYOffset - docElem.clientTop,
View
@@ -411,8 +411,8 @@ QUnit.test( "setters with and without box-sizing:border-box", function( assert )
// Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
var parent = jQuery( "#foo" ).css( { width: "200px", height: "200px", "font-size": "16px" } ),
- 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 ),
- el = jQuery( "<div style='width:100px;height:100px;margin:5px;padding:3px;border:4px solid white;'>test</div>" ).appendTo( parent );
+ 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 ),
+ el = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;'></div>" ).appendTo( parent );
jQuery.each( {
"number": { set: 100, expected: 100 },

0 comments on commit 1ad9915

Please sign in to comment.