]> source.dussan.org Git - jquery.git/commitdiff
Misc: Fix the tests, revert some unneeded/broken reverts
authorMichał Gołębiowski <m.goleb@gmail.com>
Mon, 16 Nov 2015 20:55:08 +0000 (21:55 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Mon, 16 Nov 2015 20:55:08 +0000 (21:55 +0100)
Refs 65d71843b7c37dbdba2cfcb1bc7055cb522c5af6

src/css/curCSS.js
src/css/hiddenVisibleSelectors.js
src/css/support.js
src/offset.js
test/unit/dimensions.js

index d95e287cfa2e37bba259ab2bd19551673d909f85..be643ab547c49a286c422b2b18bdf0455249e0c9 100644 (file)
@@ -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;
index 0d05be97e7c66fadb69e4a90c04d0914473da057..cf0955d3ebcab3a3fdca8803f9e3919775fadf7f 100644 (file)
@@ -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;
 };
 
 } );
index 54d0d9c701771571d90b5ed7211b01f7553a530a..6070eb449268f396f54f57a6a497ff5bde499e8e 100644 (file)
@@ -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 );
 
index ae9ccc119f0e45fd667833f84e89b49688f2eabd..4352a9995460a1ff4eb5347aa44680fe6f838b0b 100644 (file)
@@ -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,
index 9ffc6083cf38587217451a1e3194d4759dd8a099..44a7291130460ad71041f6f721c5ec360c4e22b6 100644 (file)
@@ -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 },