]> source.dussan.org Git - jquery.git/commitdiff
Revert "Misc: Drop support for older browsers; update support comments"
authorMichał Gołębiowski <m.goleb@gmail.com>
Mon, 16 Nov 2015 20:25:05 +0000 (21:25 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Mon, 16 Nov 2015 20:25:05 +0000 (21:25 +0100)
This reverts commit 740e190223d19a114d5373758127285d14d6b71e.

15 files changed:
src/attributes/support.js
src/core.js
src/core/init.js
src/css.js
src/css/curCSS.js
src/css/hiddenVisibleSelectors.js
src/css/support.js
src/event.js
src/manipulation.js
src/manipulation/support.js
src/offset.js
test/unit/css.js
test/unit/dimensions.js
test/unit/event.js
test/unit/support.js

index f93ba0181612d419c3a358c6ec18293ebe6be5f5..5b8118bb5164bb0eb85bb420fbe3f2a157e10567 100644 (file)
@@ -10,7 +10,7 @@ define( [
 
        input.type = "checkbox";
 
-       // Support: Android<4.4
+       // Support: iOS<=5.1, Android<=4.2+
        // Default value for a checkbox should be "on"
        support.checkOn = input.value !== "";
 
index ab172bb4fc93ac2bd0d7d0a746a81c379cdb8fea..e8f0d9d379e0cf90afa60bdad729dc3ec452032c 100644 (file)
@@ -255,7 +255,7 @@ jQuery.extend( {
                        return obj + "";
                }
 
-               // Support: Android<4.0 (functionish RegExp)
+               // Support: Android<4.0, iOS<6 (functionish RegExp)
                return typeof obj === "object" || typeof obj === "function" ?
                        class2type[ toString.call( obj ) ] || "object" :
                        typeof obj;
@@ -348,8 +348,6 @@ jQuery.extend( {
                return arr == null ? -1 : indexOf.call( arr, elem, i );
        },
 
-       // Support: Android<4.1, PhantomJS<2
-       // push.apply(_, arraylike) throws on ancient WebKit
        merge: function( first, second ) {
                var len = +second.length,
                        j = 0,
index 7748c38fb47f145b1c6c3ef777d989520eeb07e5..c2b6c94d78bb62e69470d4db56b245d5f354523c 100644 (file)
@@ -75,7 +75,9 @@ var rootjQuery,
                                } else {
                                        elem = document.getElementById( match[ 2 ] );
 
-                                       if ( elem ) {
+                                       // Support: Blackberry 4.6
+                                       // gEBID returns nodes no longer in the document (#6963)
+                                       if ( elem && elem.parentNode ) {
 
                                                // Inject the element directly into the jQuery object
                                                this.length = 1;
index 7bff81440a41ea53df57a851c8f34c50c976ff99..0aa9d0e9c086d2cdcc05496513d4369e65eada63 100644 (file)
@@ -36,7 +36,7 @@ var
                fontWeight: "400"
        },
 
-       cssPrefixes = [ "Webkit", "Moz", "ms" ],
+       cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
        emptyStyle = document.createElement( "div" ).style;
 
 // Return a css property mapped to a potentially vendor prefixed property
index be643ab547c49a286c422b2b18bdf0455249e0c9..d95e287cfa2e37bba259ab2bd19551673d909f85 100644 (file)
@@ -5,7 +5,7 @@ define( [
        "./var/getStyles",
        "./support",
        "../selector" // Get jQuery.contains
-], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
+], function( jQuery, rnumnonpx, rmargin, getStyles ) {
 
 function curCSS( elem, name, computed ) {
        var width, minWidth, maxWidth, ret,
@@ -22,12 +22,13 @@ 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"
-               // Android Browser returns percentage for some values,
-               // but width seems to be reliably pixels.
-               // This is against the CSSOM draft spec:
+               // 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:
                // http://dev.w3.org/csswg/cssom/#resolved-values
-               if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+               if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
 
                        // Remember the original values
                        width = style.width;
index 9a8a28cf8d35f8748e52eb19f6232a233ccc5263..0d05be97e7c66fadb69e4a90c04d0914473da057 100644 (file)
@@ -4,7 +4,12 @@ define( [
 ], function( jQuery ) {
 
 jQuery.expr.filters.hidden = function( elem ) {
-       return !jQuery.expr.filters.visible( 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 );
index f8e02d04881341d1028d5d117784b97e6b49b81c..54d0d9c701771571d90b5ed7211b01f7553a530a 100644 (file)
@@ -29,10 +29,12 @@ define( [
        // so they're executed at the same time to save the second computation.
        function computeStyleTests() {
                div.style.cssText =
-                       "box-sizing:border-box;" +
-                       "position:relative;display:block;" +
-                       "margin:auto;border:1px;padding:1px;" +
-                       "top:1%;width:50%";
+
+                       // 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";
                div.innerHTML = "";
                documentElement.appendChild( container );
 
index 28058124954d1dbfe4dad512110a65b1b6ff409e..e9d1053dc8658dd6e3e0fb6f9a8f087242160b7b 100644 (file)
@@ -469,7 +469,13 @@ jQuery.event = {
                        event[ prop ] = originalEvent[ prop ];
                }
 
-               // Support: Safari 6-8+
+               // Support: Cordova 2.5 (WebKit) (#13255)
+               // All events should have a target; Cordova deviceready doesn't
+               if ( !event.target ) {
+                       event.target = document;
+               }
+
+               // Support: Safari 6.0+, Chrome<28
                // Target should not be a text node (#504, #13143)
                if ( event.target.nodeType === 3 ) {
                        event.target = event.target.parentNode;
index ceb970cbd5957d38053f9c1b16d4935a000354d9..046424a78f0b541c267c621d8d67e1cb40a1e3df 100644 (file)
@@ -464,8 +464,8 @@ jQuery.each( {
                        elems = i === last ? this : this.clone( true );
                        jQuery( insert[ i ] )[ original ]( elems );
 
-                       // Support: Android<4.1, PhantomJS<2
-                       // .get() because push.apply(_, arraylike) throws on ancient WebKit
+                       // Support: QtWebKit
+                       // .get() because push.apply(_, arraylike) throws
                        push.apply( ret, elems.get() );
                }
 
index 4f6b9de87fa8f07a9d66abcfbb0dcf39d93d5574..cd4081ebb21d3f8d9f8312fea319b8cf387609ee 100644 (file)
@@ -8,7 +8,7 @@ define( [
                div = fragment.appendChild( document.createElement( "div" ) ),
                input = document.createElement( "input" );
 
-       // Support: Android 4.0-4.3
+       // Support: Android 4.0-4.3, Safari<=5.1
        // Check state lost if the name is set (#11217)
        // Support: Windows Web Apps (WWA)
        // `name` and `type` must use .setAttribute for WWA (#14901)
@@ -18,7 +18,7 @@ define( [
 
        div.appendChild( input );
 
-       // Support: Android<4.2
+       // Support: Safari<=5.1, Android<4.2
        // Older WebKit doesn't clone checked state correctly in fragments
        support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
 
index 4352a9995460a1ff4eb5347aa44680fe6f838b0b..ae9ccc119f0e45fd667833f84e89b49688f2eabd 100644 (file)
@@ -98,7 +98,11 @@ jQuery.fn.extend( {
                        return box;
                }
 
-               box = elem.getBoundingClientRect();
+               // 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();
+               }
                win = getWindow( doc );
                return {
                        top: box.top + win.pageYOffset - docElem.clientTop,
index 7aa87d85fc1227c516c7fd5462921dcee1e4cc06..09db057299d4734a4352a3fbc528a4ca0f0bf182 100644 (file)
@@ -293,6 +293,9 @@ QUnit.test( "css(String, Object)", function( assert ) {
        j = jQuery( "#nonnodes" ).contents();
        j.css( "overflow", "visible" );
        assert.equal( j.css( "overflow" ), "visible", "Check node,textnode,comment css works" );
+
+       // Opera sometimes doesn't update 'display' correctly, see #2037
+       jQuery( "#t2037" )[ 0 ].innerHTML = jQuery( "#t2037" )[ 0 ].innerHTML;
        assert.equal( jQuery( "#t2037 .hidden" ).css( "display" ), "none", "Make sure browser thinks it is hidden" );
 
        div = jQuery( "#nothiddendiv" );
@@ -867,9 +870,9 @@ QUnit.test( "Do not append px (#9548, #12990)", function( assert ) {
 QUnit.test( "css('width') and css('height') should respect box-sizing, see #11004", function( assert ) {
        assert.expect( 4 );
 
-       // Support: Android 2.3 (-webkit-box-sizing).
-       var el_dis = jQuery( "<div style='width:300px;height:300px;margin:2px;padding:2px;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>" ),
-               el = el_dis.clone().appendTo( "#qunit-fixture" );
+       // Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
+       var el_dis = jQuery("<div style='width:300px;height:300px;margin:2px;padding:2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;'>test</div>"),
+               el = el_dis.clone().appendTo("#qunit-fixture");
 
        assert.equal( el.css( "width" ), el.css( "width", el.css( "width" ) ).css( "width" ), "css('width') is not respecting box-sizing, see #11004" );
        assert.equal( el_dis.css( "width" ), el_dis.css( "width", el_dis.css( "width" ) ).css( "width" ), "css('width') is not respecting box-sizing for disconnected element, see #11004" );
index 5bd4f33843466950abc488fa92abd844e5e39b10..9ffc6083cf38587217451a1e3194d4759dd8a099 100644 (file)
@@ -409,9 +409,10 @@ QUnit.test( "getters on non elements should return null", function( assert ) {
 QUnit.test( "setters with and without box-sizing:border-box", function( assert ) {
        assert.expect( 60 );
 
+       // 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='margin:5px;padding:1px;border:2px solid black;box-sizing:border-box;'></div>" ).appendTo( parent ),
-               el = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;'></div>" ).appendTo( parent );
+               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 );
 
        jQuery.each( {
                "number": { set: 100, expected: 100 },
index 12f132e0d92d2af4d0d8ad3dcb9032cefdb06ac7..804ece2cafcb64946e0bb639fa914f0bda82ef24 100644 (file)
@@ -1416,7 +1416,7 @@ QUnit.test( "Submit event can be stopped (#11049)", function( assert ) {
        form.remove();
 } );
 
-// Test beforeunload event only if it supported.
+// Test beforeunload event only if it supported (i.e. not Opera)
 // Support: iOS 7+, Android<4.0
 // iOS & old Android have the window.onbeforeunload field but don't support the beforeunload
 // handler making it impossible to feature-detect the support.
@@ -2520,14 +2520,15 @@ testIframeWithCallback(
 
                var input = jQuery( frameDoc ).find( "#frame-input" );
 
+       if ( input.length ) {
                // Create a focusin handler on the parent; shouldn't affect the iframe's fate
-               jQuery( "body" ).on( "focusin.iframeTest", function() {
+               jQuery ( "body" ).on( "focusin.iframeTest", function() {
                        assert.ok( false, "fired a focusin event in the parent document" );
-               } );
+               });
 
                input.on( "focusin", function() {
                        assert.ok( true, "fired a focusin event in the iframe" );
-               } );
+               });
 
                // Avoid a native event; Chrome can't force focus to another frame
                input.trigger( "focusin" );
@@ -2540,8 +2541,12 @@ testIframeWithCallback(
 
                // Remove body handler manually since it's outside the fixture
                jQuery( "body" ).off( "focusin.iframeTest" );
+
+       } else {
+               // Opera 12 (pre-Blink) doesn't select anything
+               assert.ok( true, "SOFTFAIL: no focus event fired in the iframe" );
        }
-);
+});
 
 testIframeWithCallback(
        "jQuery.ready promise",
index 80ea58ef01a653583b3a0e8dbc4bfc9725eae899..93fba8701f9be5402e6b9baf3ca71cef18455908 100644 (file)
@@ -73,6 +73,23 @@ testIframeWithCallback(
                        "radioValue": true,
                        "reliableMarginLeft": true
                };
+       } else if ( /opera.*version\/12\.1/i.test( userAgent ) ) {
+               expected = {
+                       "ajax": true,
+                       "boxSizingReliable": true,
+                       "checkClone": true,
+                       "checkOn": true,
+                       "clearCloneStyle": true,
+                       "cors": true,
+                       "createHTMLDocument": true,
+                       "focusin": false,
+                       "noCloneChecked": true,
+                       "optSelected": true,
+                       "pixelMarginRight": true,
+                       "pixelPosition": true,
+                       "radioValue": false,
+                       "reliableMarginLeft": false
+               };
        } else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
                expected = {
                        "ajax": true,
@@ -161,6 +178,22 @@ testIframeWithCallback(
                        "radioValue": true,
                        "reliableMarginLeft": true
                };
+       } else if ( /5\.1(\.\d+|) safari/i.test( userAgent ) ) {
+               expected = {
+                       "ajax": true,
+                       "boxSizingReliable": true,
+                       "checkClone": false,
+                       "checkOn": false,
+                       "clearCloneStyle": true,
+                       "cors": true,
+                       "focusinBubbles": false,
+                       "noCloneChecked": true,
+                       "optDisabled": true,
+                       "optSelected": true,
+                       "pixelPosition": false,
+                       "radioValue": true,
+                       "reliableMarginRight": true
+               };
        } else if ( /firefox/i.test( userAgent ) ) {
                expected = {
                        "ajax": true,
@@ -212,7 +245,7 @@ testIframeWithCallback(
                        "radioValue": true,
                        "reliableMarginLeft": true
                };
-       } else if ( /iphone os 7_/i.test( userAgent ) ) {
+       } else if ( /iphone os (?:6|7)_/i.test( userAgent ) ) {
                expected = {
                        "ajax": true,
                        "boxSizingReliable": true,