aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2014-10-27 18:36:07 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2014-11-03 18:37:26 +0100
commit740e190223d19a114d5373758127285d14d6b71e (patch)
treef449fdea7a436cdabf7d6f764454887791d010a6 /src
parent758fd6cea9e82f7bfebce07ba6ecf0d107e8a53c (diff)
downloadjquery-740e190223d19a114d5373758127285d14d6b71e.tar.gz
jquery-740e190223d19a114d5373758127285d14d6b71e.zip
Misc: Drop support for older browsers; update support comments
That includes Opera 12.x, Firefox<29, Safari<6.0 and some hacks for old Blackberry. Closes gh-1820 Refs gh-1815
Diffstat (limited to 'src')
-rw-r--r--src/attributes/support.js2
-rw-r--r--src/core.js4
-rw-r--r--src/core/init.js4
-rw-r--r--src/css.js2
-rw-r--r--src/css/curCSS.js28
-rw-r--r--src/css/hiddenVisibleSelectors.js4
-rw-r--r--src/css/support.js12
-rw-r--r--src/event.js13
-rw-r--r--src/manipulation.js12
-rw-r--r--src/manipulation/support.js5
-rw-r--r--src/offset.js6
11 files changed, 28 insertions, 64 deletions
diff --git a/src/attributes/support.js b/src/attributes/support.js
index 5db5c5212..bc5eb472e 100644
--- a/src/attributes/support.js
+++ b/src/attributes/support.js
@@ -9,7 +9,7 @@ define([
input.type = "checkbox";
- // Support: iOS<=5.1, Android<=4.2+
+ // Support: Android<4.4
// Default value for a checkbox should be "on"
support.checkOn = input.value !== "";
diff --git a/src/core.js b/src/core.js
index 2b3fbb180..0dd80dd33 100644
--- a/src/core.js
+++ b/src/core.js
@@ -250,7 +250,7 @@ jQuery.extend({
if ( obj == null ) {
return obj + "";
}
- // Support: Android<4.0, iOS<6 (functionish RegExp)
+ // Support: Android<4.0 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ?
class2type[ toString.call(obj) ] || "object" :
typeof obj;
@@ -354,6 +354,8 @@ 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,
diff --git a/src/core/init.js b/src/core/init.js
index 50f310c56..9beaedd04 100644
--- a/src/core/init.js
+++ b/src/core/init.js
@@ -69,9 +69,7 @@ var rootjQuery,
} else {
elem = document.getElementById( match[2] );
- // Support: Blackberry 4.6
- // gEBID returns nodes no longer in the document (#6963)
- if ( elem && elem.parentNode ) {
+ if ( elem ) {
// Inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
diff --git a/src/css.js b/src/css.js
index 94a1d234f..d8e60b857 100644
--- a/src/css.js
+++ b/src/css.js
@@ -34,7 +34,7 @@ var
fontWeight: "400"
},
- cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+ cssPrefixes = [ "Webkit", "Moz", "ms" ];
// Return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) {
diff --git a/src/css/curCSS.js b/src/css/curCSS.js
index 420d19fa9..260184b47 100644
--- a/src/css/curCSS.js
+++ b/src/css/curCSS.js
@@ -7,8 +7,7 @@ define([
], function( jQuery, rnumnonpx, rmargin, getStyles ) {
function curCSS( elem, name, computed ) {
- var width, minWidth, maxWidth, ret,
- style = elem.style;
+ var ret;
computed = computed || getStyles( elem );
@@ -23,33 +22,10 @@ function curCSS( elem, name, computed ) {
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
-
- // Support: iOS < 6
- // 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:
- // http://dev.w3.org/csswg/cssom/#resolved-values
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
- // Remember the original values
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
-
- // Put in the new values to get a computed value out
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
-
- // Revert the changed values
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
}
return ret !== undefined ?
- // Support: IE
+ // Support: IE9-11+
// IE returns zIndex value as an integer.
ret + "" :
ret;
diff --git a/src/css/hiddenVisibleSelectors.js b/src/css/hiddenVisibleSelectors.js
index 2b1eb8155..01ecc3396 100644
--- a/src/css/hiddenVisibleSelectors.js
+++ b/src/css/hiddenVisibleSelectors.js
@@ -4,11 +4,9 @@ define([
], function( jQuery ) {
jQuery.expr.filters.hidden = 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;
+ return !elem.offsetWidth || !elem.offsetHeight;
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
diff --git a/src/css/support.js b/src/css/support.js
index 2cb6fe81d..4279d12e7 100644
--- a/src/css/support.js
+++ b/src/css/support.js
@@ -27,10 +27,10 @@ define([
// so they're executed at the same time to save the second computation.
function computePixelPositionAndBoxSizingReliable() {
div.style.cssText =
- // Support: Firefox<29, Android 2.3
+ // Support: 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%;" +
+ "-webkit-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 = "";
docElem.appendChild( container );
@@ -72,10 +72,10 @@ define([
// Reset CSS: box-sizing; display; margin; border; padding
marginDiv.style.cssText = div.style.cssText =
- // Support: Firefox<29, Android 2.3
+ // Support: Android 2.3
// Vendor-prefix box-sizing
- "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
- "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
+ "-webkit-box-sizing:content-box;box-sizing:content-box;" +
+ "display:block;margin:0;border:0;padding:0";
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
docElem.appendChild( container );
diff --git a/src/event.js b/src/event.js
index 7cf14c5c9..aee6cb78f 100644
--- a/src/event.js
+++ b/src/event.js
@@ -536,13 +536,7 @@ jQuery.event = {
event[ prop ] = originalEvent[ prop ];
}
- // 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
+ // Support: Safari 6.0+
// Target should not be a text node (#504, #13143)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
@@ -709,7 +703,10 @@ jQuery.Event.prototype = {
};
// Create mouseenter/leave events using mouseover/out and event-time checks
-// Support: Chrome 15+
+// so that event delegation works in jQuery.
+// Do the same for pointerenter/pointerleave and pointerover/pointerout
+// Support: Safari<7.0
+// Safari doesn't support mouseenter/mouseleave at all.
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout",
diff --git a/src/manipulation.js b/src/manipulation.js
index 0b2637db6..52b83c71b 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -204,7 +204,7 @@ jQuery.extend({
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {
- // Support: QtWebKit, PhantomJS
+ // Support: Android<4.1, PhantomJS<2
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
@@ -227,7 +227,7 @@ jQuery.extend({
tmp = tmp.lastChild;
}
- // Support: QtWebKit, PhantomJS
+ // Support: Android<4.1, PhantomJS<2
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( nodes, tmp.childNodes );
@@ -514,8 +514,8 @@ jQuery.fn.extend({
// Keep references to cloned scripts for later restoration
if ( hasScripts ) {
- // Support: QtWebKit
- // jQuery.merge because push.apply(_, arraylike) throws
+ // Support: Android<4.1, PhantomJS<2
+ // push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( scripts, getAll( node, "script" ) );
}
}
@@ -572,8 +572,8 @@ jQuery.each({
elems = i === last ? this : this.clone( true );
jQuery( insert[ i ] )[ original ]( elems );
- // Support: QtWebKit
- // .get() because push.apply(_, arraylike) throws
+ // Support: Android<4.1, PhantomJS<2
+ // .get() because push.apply(_, arraylike) throws on ancient WebKit
push.apply( ret, elems.get() );
}
diff --git a/src/manipulation/support.js b/src/manipulation/support.js
index 822a014f5..92c92b5ff 100644
--- a/src/manipulation/support.js
+++ b/src/manipulation/support.js
@@ -7,17 +7,14 @@ define([
div = fragment.appendChild( document.createElement( "div" ) ),
input = document.createElement( "input" );
- // Support: 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)
input.setAttribute( "type", "radio" );
input.setAttribute( "checked", "checked" );
- input.setAttribute( "name", "t" );
div.appendChild( input );
- // Support: Safari<=5.1, Android<4.2
+ // Support: Android<4.2
// Older WebKit doesn't clone checked state correctly in fragments
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
diff --git a/src/offset.js b/src/offset.js
index ffd049157..aee95efde 100644
--- a/src/offset.js
+++ b/src/offset.js
@@ -96,11 +96,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,