mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Revert "Misc: Drop support for older browsers; update support comments"
This reverts commit 740e190223
.
This commit is contained in:
parent
ae88b3971c
commit
65d71843b7
@ -10,7 +10,7 @@ define( [
|
|||||||
|
|
||||||
input.type = "checkbox";
|
input.type = "checkbox";
|
||||||
|
|
||||||
// Support: Android<4.4
|
// Support: iOS<=5.1, Android<=4.2+
|
||||||
// Default value for a checkbox should be "on"
|
// Default value for a checkbox should be "on"
|
||||||
support.checkOn = input.value !== "";
|
support.checkOn = input.value !== "";
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ jQuery.extend( {
|
|||||||
return obj + "";
|
return obj + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support: Android<4.0 (functionish RegExp)
|
// Support: Android<4.0, iOS<6 (functionish RegExp)
|
||||||
return typeof obj === "object" || typeof obj === "function" ?
|
return typeof obj === "object" || typeof obj === "function" ?
|
||||||
class2type[ toString.call( obj ) ] || "object" :
|
class2type[ toString.call( obj ) ] || "object" :
|
||||||
typeof obj;
|
typeof obj;
|
||||||
@ -348,8 +348,6 @@ jQuery.extend( {
|
|||||||
return arr == null ? -1 : indexOf.call( arr, elem, i );
|
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 ) {
|
merge: function( first, second ) {
|
||||||
var len = +second.length,
|
var len = +second.length,
|
||||||
j = 0,
|
j = 0,
|
||||||
|
@ -75,7 +75,9 @@ var rootjQuery,
|
|||||||
} else {
|
} else {
|
||||||
elem = document.getElementById( match[ 2 ] );
|
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
|
// Inject the element directly into the jQuery object
|
||||||
this.length = 1;
|
this.length = 1;
|
||||||
|
@ -36,7 +36,7 @@ var
|
|||||||
fontWeight: "400"
|
fontWeight: "400"
|
||||||
},
|
},
|
||||||
|
|
||||||
cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
|
||||||
emptyStyle = document.createElement( "div" ).style;
|
emptyStyle = document.createElement( "div" ).style;
|
||||||
|
|
||||||
// Return a css property mapped to a potentially vendor prefixed property
|
// Return a css property mapped to a potentially vendor prefixed property
|
||||||
|
@ -5,7 +5,7 @@ define( [
|
|||||||
"./var/getStyles",
|
"./var/getStyles",
|
||||||
"./support",
|
"./support",
|
||||||
"../selector" // Get jQuery.contains
|
"../selector" // Get jQuery.contains
|
||||||
], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
|
], function( jQuery, rnumnonpx, rmargin, getStyles ) {
|
||||||
|
|
||||||
function curCSS( elem, name, computed ) {
|
function curCSS( elem, name, computed ) {
|
||||||
var width, minWidth, maxWidth, ret,
|
var width, minWidth, maxWidth, ret,
|
||||||
@ -22,12 +22,13 @@ function curCSS( elem, name, computed ) {
|
|||||||
ret = jQuery.style( elem, name );
|
ret = jQuery.style( elem, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support: iOS < 6, Android 4.0-4.3 only
|
||||||
// A tribute to the "awesome hack by Dean Edwards"
|
// A tribute to the "awesome hack by Dean Edwards"
|
||||||
// Android Browser returns percentage for some values,
|
// iOS < 6 (at least) returns percentage for a larger set of values,
|
||||||
// but width seems to be reliably pixels.
|
// but width seems to be reliably pixels
|
||||||
// This is against the CSSOM draft spec:
|
// this is against the CSSOM draft spec:
|
||||||
// http://dev.w3.org/csswg/cssom/#resolved-values
|
// 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
|
// Remember the original values
|
||||||
width = style.width;
|
width = style.width;
|
||||||
|
@ -4,7 +4,12 @@ define( [
|
|||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
|
|
||||||
jQuery.expr.filters.hidden = function( elem ) {
|
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 ) {
|
jQuery.expr.filters.visible = function( elem ) {
|
||||||
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
|
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
|
||||||
|
@ -29,10 +29,12 @@ define( [
|
|||||||
// so they're executed at the same time to save the second computation.
|
// so they're executed at the same time to save the second computation.
|
||||||
function computeStyleTests() {
|
function computeStyleTests() {
|
||||||
div.style.cssText =
|
div.style.cssText =
|
||||||
"box-sizing:border-box;" +
|
|
||||||
"position:relative;display:block;" +
|
// Support: Firefox<29, Android 2.3
|
||||||
"margin:auto;border:1px;padding:1px;" +
|
// Vendor-prefix box-sizing
|
||||||
"top:1%;width:50%";
|
"-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 = "";
|
div.innerHTML = "";
|
||||||
documentElement.appendChild( container );
|
documentElement.appendChild( container );
|
||||||
|
|
||||||
|
@ -469,7 +469,13 @@ jQuery.event = {
|
|||||||
event[ prop ] = originalEvent[ prop ];
|
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)
|
// Target should not be a text node (#504, #13143)
|
||||||
if ( event.target.nodeType === 3 ) {
|
if ( event.target.nodeType === 3 ) {
|
||||||
event.target = event.target.parentNode;
|
event.target = event.target.parentNode;
|
||||||
|
@ -464,8 +464,8 @@ jQuery.each( {
|
|||||||
elems = i === last ? this : this.clone( true );
|
elems = i === last ? this : this.clone( true );
|
||||||
jQuery( insert[ i ] )[ original ]( elems );
|
jQuery( insert[ i ] )[ original ]( elems );
|
||||||
|
|
||||||
// Support: Android<4.1, PhantomJS<2
|
// Support: QtWebKit
|
||||||
// .get() because push.apply(_, arraylike) throws on ancient WebKit
|
// .get() because push.apply(_, arraylike) throws
|
||||||
push.apply( ret, elems.get() );
|
push.apply( ret, elems.get() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ define( [
|
|||||||
div = fragment.appendChild( document.createElement( "div" ) ),
|
div = fragment.appendChild( document.createElement( "div" ) ),
|
||||||
input = document.createElement( "input" );
|
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)
|
// Check state lost if the name is set (#11217)
|
||||||
// Support: Windows Web Apps (WWA)
|
// Support: Windows Web Apps (WWA)
|
||||||
// `name` and `type` must use .setAttribute for WWA (#14901)
|
// `name` and `type` must use .setAttribute for WWA (#14901)
|
||||||
@ -18,7 +18,7 @@ define( [
|
|||||||
|
|
||||||
div.appendChild( input );
|
div.appendChild( input );
|
||||||
|
|
||||||
// Support: Android<4.2
|
// Support: Safari<=5.1, Android<4.2
|
||||||
// Older WebKit doesn't clone checked state correctly in fragments
|
// Older WebKit doesn't clone checked state correctly in fragments
|
||||||
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
||||||
|
|
||||||
|
@ -98,7 +98,11 @@ jQuery.fn.extend( {
|
|||||||
return box;
|
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 );
|
win = getWindow( doc );
|
||||||
return {
|
return {
|
||||||
top: box.top + win.pageYOffset - docElem.clientTop,
|
top: box.top + win.pageYOffset - docElem.clientTop,
|
||||||
|
@ -293,6 +293,9 @@ QUnit.test( "css(String, Object)", function( assert ) {
|
|||||||
j = jQuery( "#nonnodes" ).contents();
|
j = jQuery( "#nonnodes" ).contents();
|
||||||
j.css( "overflow", "visible" );
|
j.css( "overflow", "visible" );
|
||||||
assert.equal( j.css( "overflow" ), "visible", "Check node,textnode,comment css works" );
|
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" );
|
assert.equal( jQuery( "#t2037 .hidden" ).css( "display" ), "none", "Make sure browser thinks it is hidden" );
|
||||||
|
|
||||||
div = jQuery( "#nothiddendiv" );
|
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 ) {
|
QUnit.test( "css('width') and css('height') should respect box-sizing, see #11004", function( assert ) {
|
||||||
assert.expect( 4 );
|
assert.expect( 4 );
|
||||||
|
|
||||||
// Support: Android 2.3 (-webkit-box-sizing).
|
// 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;box-sizing:border-box;'>test</div>" ),
|
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" );
|
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.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" );
|
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" );
|
||||||
|
@ -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 ) {
|
QUnit.test( "setters with and without box-sizing:border-box", function( assert ) {
|
||||||
assert.expect( 60 );
|
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" } ),
|
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_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='margin:5px;padding:1px;border:2px solid black;'></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( {
|
jQuery.each( {
|
||||||
"number": { set: 100, expected: 100 },
|
"number": { set: 100, expected: 100 },
|
||||||
|
@ -1416,7 +1416,7 @@ QUnit.test( "Submit event can be stopped (#11049)", function( assert ) {
|
|||||||
form.remove();
|
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
|
// Support: iOS 7+, Android<4.0
|
||||||
// iOS & old Android have the window.onbeforeunload field but don't support the beforeunload
|
// iOS & old Android have the window.onbeforeunload field but don't support the beforeunload
|
||||||
// handler making it impossible to feature-detect the support.
|
// handler making it impossible to feature-detect the support.
|
||||||
@ -2520,14 +2520,15 @@ testIframeWithCallback(
|
|||||||
|
|
||||||
var input = jQuery( frameDoc ).find( "#frame-input" );
|
var input = jQuery( frameDoc ).find( "#frame-input" );
|
||||||
|
|
||||||
|
if ( input.length ) {
|
||||||
// Create a focusin handler on the parent; shouldn't affect the iframe's fate
|
// 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" );
|
assert.ok( false, "fired a focusin event in the parent document" );
|
||||||
} );
|
});
|
||||||
|
|
||||||
input.on( "focusin", function() {
|
input.on( "focusin", function() {
|
||||||
assert.ok( true, "fired a focusin event in the iframe" );
|
assert.ok( true, "fired a focusin event in the iframe" );
|
||||||
} );
|
});
|
||||||
|
|
||||||
// Avoid a native event; Chrome can't force focus to another frame
|
// Avoid a native event; Chrome can't force focus to another frame
|
||||||
input.trigger( "focusin" );
|
input.trigger( "focusin" );
|
||||||
@ -2540,8 +2541,12 @@ testIframeWithCallback(
|
|||||||
|
|
||||||
// Remove body handler manually since it's outside the fixture
|
// Remove body handler manually since it's outside the fixture
|
||||||
jQuery( "body" ).off( "focusin.iframeTest" );
|
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(
|
testIframeWithCallback(
|
||||||
"jQuery.ready promise",
|
"jQuery.ready promise",
|
||||||
|
@ -73,6 +73,23 @@ testIframeWithCallback(
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableMarginLeft": 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 ) ) {
|
} else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
@ -161,6 +178,22 @@ testIframeWithCallback(
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableMarginLeft": 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 ) ) {
|
} else if ( /firefox/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
@ -212,7 +245,7 @@ testIframeWithCallback(
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableMarginLeft": true
|
"reliableMarginLeft": true
|
||||||
};
|
};
|
||||||
} else if ( /iphone os 7_/i.test( userAgent ) ) {
|
} else if ( /iphone os (?:6|7)_/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user