Commit c0185ab7 authored by Timmy Willison's avatar Timmy Willison

Release 2.2.4

parent 5e89585e
...@@ -6,10 +6,10 @@ Michael Geary <mike@geary.com> ...@@ -6,10 +6,10 @@ Michael Geary <mike@geary.com>
Stefan Petre <stefan.petre@gmail.com> Stefan Petre <stefan.petre@gmail.com>
Yehuda Katz <wycats@gmail.com> Yehuda Katz <wycats@gmail.com>
Corey Jewett <cj@syntheticplayground.com> Corey Jewett <cj@syntheticplayground.com>
Klaus Hartl <klaus.hartl@googlemail.com> Klaus Hartl <klaus.hartl@gmail.com>
Franck Marcia <franck.marcia@gmail.com> Franck Marcia <franck.marcia@gmail.com>
Jörn Zaefferer <joern.zaefferer@gmail.com> Jörn Zaefferer <joern.zaefferer@gmail.com>
Paul Bakaus <paul.bakaus@googlemail.com> Paul Bakaus <paul.bakaus@gmail.com>
Brandon Aaron <brandon.aaron@gmail.com> Brandon Aaron <brandon.aaron@gmail.com>
Mike Alsup <malsup@gmail.com> Mike Alsup <malsup@gmail.com>
Dave Methvin <dave.methvin@gmail.com> Dave Methvin <dave.methvin@gmail.com>
...@@ -47,7 +47,7 @@ Matt Curry <matt@pseudocoder.com> ...@@ -47,7 +47,7 @@ Matt Curry <matt@pseudocoder.com>
Michael Monteleone <michael@michaelmonteleone.net> Michael Monteleone <michael@michaelmonteleone.net>
Noah Sloan <noah.sloan@gmail.com> Noah Sloan <noah.sloan@gmail.com>
Tom Viner <github@viner.tv> Tom Viner <github@viner.tv>
Douglas Neiner <doug@pixelgraphics.us> Douglas Neiner <doug@dougneiner.com>
Adam J. Sontag <ajpiano@ajpiano.com> Adam J. Sontag <ajpiano@ajpiano.com>
Dave Reed <dareed@microsoft.com> Dave Reed <dareed@microsoft.com>
Ralph Whitbeck <ralph.whitbeck@gmail.com> Ralph Whitbeck <ralph.whitbeck@gmail.com>
...@@ -57,7 +57,7 @@ J. Ryan Stinnett <jryans@gmail.com> ...@@ -57,7 +57,7 @@ J. Ryan Stinnett <jryans@gmail.com>
unknown <Igen005@.upcorp.ad.uprr.com> unknown <Igen005@.upcorp.ad.uprr.com>
temp01 <temp01irc@gmail.com> temp01 <temp01irc@gmail.com>
Heungsub Lee <h@subl.ee> Heungsub Lee <h@subl.ee>
Colin Snover <colin@alpha.zetafleet.com> Colin Snover <github.com@zetafleet.com>
Ryan W Tenney <ryan@10e.us> Ryan W Tenney <ryan@10e.us>
Pinhook <contact@pinhooklabs.com> Pinhook <contact@pinhooklabs.com>
Ron Otten <r.j.g.otten@gmail.com> Ron Otten <r.j.g.otten@gmail.com>
...@@ -69,7 +69,7 @@ Henri Wiechers <hwiechers@gmail.com> ...@@ -69,7 +69,7 @@ Henri Wiechers <hwiechers@gmail.com>
Russell Holbrook <russell.holbrook@patch.com> Russell Holbrook <russell.holbrook@patch.com>
Julian Aubourg <aubourg.julian@gmail.com> Julian Aubourg <aubourg.julian@gmail.com>
Gianni Alessandro Chiappetta <gianni@runlevel6.org> Gianni Alessandro Chiappetta <gianni@runlevel6.org>
Scott Jehl <scott@scottjehl.com> Scott Jehl <scottjehl@gmail.com>
James Burke <jrburke@gmail.com> James Burke <jrburke@gmail.com>
Jonas Pfenniger <jonas@pfenniger.name> Jonas Pfenniger <jonas@pfenniger.name>
Xavi Ramirez <xavi.rmz@gmail.com> Xavi Ramirez <xavi.rmz@gmail.com>
...@@ -78,10 +78,10 @@ Sylvester Keil <sylvester@keil.or.at> ...@@ -78,10 +78,10 @@ Sylvester Keil <sylvester@keil.or.at>
Brandon Sterne <bsterne@mozilla.com> Brandon Sterne <bsterne@mozilla.com>
Mathias Bynens <mathias@qiwi.be> Mathias Bynens <mathias@qiwi.be>
Timmy Willison <timmywillisn@gmail.com> Timmy Willison <timmywillisn@gmail.com>
Corey Frang <gnarf@gnarf.net> Corey Frang <gnarf37@gmail.com>
Digitalxero <digitalxero> Digitalxero <digitalxero>
Anton Kovalyov <anton@kovalyov.net> Anton Kovalyov <anton@kovalyov.net>
David Murdoch <musicisair@yahoo.com> David Murdoch <david@davidmurdoch.com>
Josh Varner <josh.varner@gmail.com> Josh Varner <josh.varner@gmail.com>
Charles McNulty <cmcnulty@kznf.com> Charles McNulty <cmcnulty@kznf.com>
Jordan Boesch <jboesch26@gmail.com> Jordan Boesch <jboesch26@gmail.com>
...@@ -139,7 +139,7 @@ Chris Faulkner <thefaulkner@gmail.com> ...@@ -139,7 +139,7 @@ Chris Faulkner <thefaulkner@gmail.com>
Elijah Manor <elijah.manor@gmail.com> Elijah Manor <elijah.manor@gmail.com>
Daniel Chatfield <chatfielddaniel@gmail.com> Daniel Chatfield <chatfielddaniel@gmail.com>
Nikita Govorov <nikita.govorov@gmail.com> Nikita Govorov <nikita.govorov@gmail.com>
Wesley Walser <wwalser@atlassian.com> Wesley Walser <waw325@gmail.com>
Mike Pennisi <mike@mikepennisi.com> Mike Pennisi <mike@mikepennisi.com>
Markus Staab <markus.staab@redaxo.de> Markus Staab <markus.staab@redaxo.de>
Dave Riddle <david@joyvuu.com> Dave Riddle <david@joyvuu.com>
...@@ -170,6 +170,8 @@ Paul Ramos <paul.b.ramos@gmail.com> ...@@ -170,6 +170,8 @@ Paul Ramos <paul.b.ramos@gmail.com>
Rod Vagg <rod@vagg.org> Rod Vagg <rod@vagg.org>
Bennett Sorbo <bsorbo@gmail.com> Bennett Sorbo <bsorbo@gmail.com>
Sebastian Burkhard <sebi.burkhard@gmail.com> Sebastian Burkhard <sebi.burkhard@gmail.com>
Zachary Adam Kaplan <razic@viralkitty.com>
nanto_vi <nanto@moon.email.ne.jp>
nanto <nanto@moon.email.ne.jp> nanto <nanto@moon.email.ne.jp>
Danil Somsikov <danilasomsikov@gmail.com> Danil Somsikov <danilasomsikov@gmail.com>
Ryunosuke SATO <tricknotes.rs@gmail.com> Ryunosuke SATO <tricknotes.rs@gmail.com>
...@@ -177,62 +179,70 @@ Jean Boussier <jean.boussier@gmail.com> ...@@ -177,62 +179,70 @@ Jean Boussier <jean.boussier@gmail.com>
Adam Coulombe <me@adam.co> Adam Coulombe <me@adam.co>
Andrew Plummer <plummer.andrew@gmail.com> Andrew Plummer <plummer.andrew@gmail.com>
Mark Raddatz <mraddatz@gmail.com> Mark Raddatz <mraddatz@gmail.com>
Isaac Z. Schlueter <i@izs.me>
Karl Sieburg <ksieburg@yahoo.com>
Pascal Borreli <pascal@borreli.com>
Nguyen Phuc Lam <ruado1987@gmail.com>
Dmitry Gusev <dmitry.gusev@gmail.com> Dmitry Gusev <dmitry.gusev@gmail.com>
Michał Gołębiowski <m.goleb@gmail.com> Michał Gołębiowski <m.goleb@gmail.com>
Nguyen Phuc Lam <ruado1987@gmail.com> Li Xudong <istonelee@gmail.com>
Steven Benner <admin@stevenbenner.com>
Tom H Fuertes <tomfuertes@gmail.com> Tom H Fuertes <tomfuertes@gmail.com>
Brandon Johnson <bjohn465+github@gmail.com> Renato Oliveira dos Santos <ros3@cin.ufpe.br>
ros3cin <ros3@cin.ufpe.br>
Jason Bedard <jason+jquery@jbedard.ca> Jason Bedard <jason+jquery@jbedard.ca>
Kyle Robinson Young <kyle@dontkry.com> Kyle Robinson Young <kyle@dontkry.com>
Renato Oliveira dos Santos <ros3@cin.ufpe.br>
Chris Talkington <chris@talkingtontech.com> Chris Talkington <chris@talkingtontech.com>
Eddie Monge <eddie@eddiemonge.com> Eddie Monge <eddie@eddiemonge.com>
Terry Jones <terry@jon.es> Terry Jones <terry@jon.es>
Jason Merino <jasonmerino@gmail.com> Jason Merino <jasonmerino@gmail.com>
Jeremy Dunck <jdunck@gmail.com> Jeremy Dunck <jdunck@gmail.com>
Chris Price <price.c@gmail.com> Chris Price <price.c@gmail.com>
Guy Bedford <guybedford@gmail.com>
Amey Sakhadeo <me@ameyms.com> Amey Sakhadeo <me@ameyms.com>
Mike Sidorov <mikes.ekb@gmail.com>
Anthony Ryan <anthonyryan1@gmail.com> Anthony Ryan <anthonyryan1@gmail.com>
Dominik D. Geyer <dominik.geyer@gmail.com> Dominik D. Geyer <dominik.geyer@gmail.com>
George Kats <katsgeorgeek@gmail.com> George Kats <katsgeorgeek@gmail.com>
Lihan Li <frankieteardrop@gmail.com> Lihan Li <frankieteardrop@gmail.com>
Ronny Springer <springer.ronny@gmail.com> Ronny Springer <springer.ronny@gmail.com>
Marian Sollmann <marian.sollmann@cargomedia.ch>
Corey Frang <gnarf37@gmail.com>
Chris Antaki <ChrisAntaki@gmail.com> Chris Antaki <ChrisAntaki@gmail.com>
Noah Hamann <njhamann@gmail.com> Marian Sollmann <marian.sollmann@cargomedia.ch>
njhamann <njhamann@gmail.com>
Ilya Kantor <iliakan@gmail.com>
David Hong <d.hong@me.com> David Hong <d.hong@me.com>
John Paul <john@johnkpaul.com>
Jakob Stoeck <jakob@pokermania.de> Jakob Stoeck <jakob@pokermania.de>
Christopher Jones <christopherjonesqed@gmail.com> Christopher Jones <chris@cjqed.com>
Forbes Lindesay <forbes@lindesay.co.uk> Forbes Lindesay <forbes@lindesay.co.uk>
John Paul <john@johnkpaul.com>
S. Andrew Sheppard <andrew@wq.io> S. Andrew Sheppard <andrew@wq.io>
Leonardo Balter <leonardo.balter@gmail.com> Leonardo Balter <leonardo.balter@gmail.com>
Roman Reiß <me@silverwind.io> Roman Reiß <me@silverwind.io>
Benjy Cui <benjytrys@gmail.com> Benjy Cui <benjytrys@gmail.com>
Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>
John Hoven <hovenj@gmail.com> John Hoven <hovenj@gmail.com>
Philip Jägenstedt <philip@foolip.org>
Christian Kosmowski <ksmwsk@gmail.com> Christian Kosmowski <ksmwsk@gmail.com>
Liang Peng <poppinlp@gmail.com> Liang Peng <poppinlp@gmail.com>
TJ VanToll <tj.vantoll@gmail.com> TJ VanToll <tj.vantoll@gmail.com>
Senya Pugach <upisfree@outlook.com> Senya Pugach <upisfree@outlook.com>
Aurelio De Rosa <aurelioderosa@gmail.com> Aurelio De Rosa <aurelioderosa@gmail.com>
Nazar Mokrynskyi <nazar@mokrynskyi.com> Nazar Mokrynskyi <nazar@mokrynskyi.com>
Amit Merchant <bullredeyes@gmail.com>
Jason Bedard <jason+github@jbedard.ca>
Arthur Verschaeve <contact@arthurverschaeve.be> Arthur Verschaeve <contact@arthurverschaeve.be>
Dan Hart <danhart@notonthehighstreet.com> Dan Hart <danhart@notonthehighstreet.com>
Scott González <scott.gonzalez@gmail.com>
Zheming Sun <mescodasun@gmail.com>
Bin Xin <rhyzix@gmail.com> Bin Xin <rhyzix@gmail.com>
David Corbacho <davidcorbacho@gmail.com> David Corbacho <davidcorbacho@gmail.com>
Veaceslav Grimalschi <grimalschi@yandex.ru> Veaceslav Grimalschi <grimalschi@yandex.ru>
Daniel Husar <dano.husar@gmail.com> Daniel Husar <dano.husar@gmail.com>
Jason Bedard <jason+github@jbedard.ca> Frederic Hemberger <mail@frederic-hemberger.de>
Ben Toews <mastahyeti@gmail.com> Ben Toews <mastahyeti@gmail.com>
Aditya Raghavan <araghavan3@gmail.com> Aditya Raghavan <araghavan3@gmail.com>
Victor Homyakov <vkhomyackov@gmail.com>
Shivaji Varma <contact@shivajivarma.com>
Nicolas HENRY <icewil@gmail.com> Nicolas HENRY <icewil@gmail.com>
Norman Xu <homyu.shinn@gmail.com>
Anne-Gaelle Colom <coloma@westminster.ac.uk> Anne-Gaelle Colom <coloma@westminster.ac.uk>
Victor Homyakov <vkhomyackov@gmail.com>
George Mauer <gmauer@gmail.com> George Mauer <gmauer@gmail.com>
Leonardo Braga <leonardo.braga@gmail.com> Leonardo Braga <leonardo.braga@gmail.com>
Stephen Edgar <stephen@netweb.com.au> Stephen Edgar <stephen@netweb.com.au>
...@@ -246,20 +256,22 @@ Calvin Metcalf <calvin.metcalf@gmail.com> ...@@ -246,20 +256,22 @@ Calvin Metcalf <calvin.metcalf@gmail.com>
Mu Haibao <mhbseal@163.com> Mu Haibao <mhbseal@163.com>
Richard McDaniel <rm0026@uah.edu> Richard McDaniel <rm0026@uah.edu>
Chris Rebert <github@rebertia.com> Chris Rebert <github@rebertia.com>
Gabriel Schulhof <gabriel.schulhof@intel.com>
Gilad Peleg <giladp007@gmail.com> Gilad Peleg <giladp007@gmail.com>
Martin Naumann <martin@geekonaut.de> Martin Naumann <martin@geekonaut.de>
Marek Lewandowski <m.lewandowski@cksource.com>
Bruno Pérel <brunoperel@gmail.com> Bruno Pérel <brunoperel@gmail.com>
Reed Loden <reed@reedloden.com> Reed Loden <reed@reedloden.com>
Daniel Nill <daniellnill@gmail.com> Daniel Nill <daniellnill@gmail.com>
Yongwoo Jeon <yongwoo.jeon@navercorp.com> Yongwoo Jeon <yongwoo.jeon@navercorp.com>
Sean Henderson <seanh.za@gmail.com> Sean Henderson <seanh.za@gmail.com>
Adrian Olek <adrianolek@gmail.com>
Richard Kraaijenhagen <stdin+git@riichard.com> Richard Kraaijenhagen <stdin+git@riichard.com>
Connor Atherton <c.liam.atherton@gmail.com>
Gary Ye <garysye@gmail.com> Gary Ye <garysye@gmail.com>
Christian Grete <webmaster@christiangrete.com> Christian Grete <webmaster@christiangrete.com>
Liza Ramo <liza.h.ramo@gmail.com> Liza Ramo <liza.h.ramo@gmail.com>
Joelle Fleurantin <joasqueeniebee@gmail.com>
Julian Alexander Murillo <julian.alexander.murillo@gmail.com> Julian Alexander Murillo <julian.alexander.murillo@gmail.com>
Joelle Fleurantin <joasqueeniebee@gmail.com>
Jun Sun <klsforever@gmail.com> Jun Sun <klsforever@gmail.com>
Devin Wilson <dwilson6.github@gmail.com> Devin Wilson <dwilson6.github@gmail.com>
Todor Prikumov <tono_pr@abv.bg> Todor Prikumov <tono_pr@abv.bg>
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
"name": "jquery", "name": "jquery",
"title": "jQuery", "title": "jQuery",
"description": "JavaScript library for DOM operations", "description": "JavaScript library for DOM operations",
"version": "1.12.4", "version": "2.2.4",
"main": "dist/jquery.js", "main": "dist/jquery.js",
"homepage": "http://jquery.com", "homepage": "http://jquery.com",
"author": { "author": {
"name": "jQuery Foundation and other contributors", "name": "jQuery Foundation and other contributors",
"url": "https://github.com/jquery/jquery/blob/1.12-stable/AUTHORS.txt" "url": "https://github.com/jquery/jquery/blob/2.2.4/AUTHORS.txt"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -41,11 +41,10 @@ ...@@ -41,11 +41,10 @@
"gzip-js": "0.3.2", "gzip-js": "0.3.2",
"jsdom": "5.6.1", "jsdom": "5.6.1",
"load-grunt-tasks": "1.0.0", "load-grunt-tasks": "1.0.0",
"npm": "2.1.12",
"qunitjs": "1.17.1", "qunitjs": "1.17.1",
"qunit-assert-step": "1.0.3", "qunit-assert-step": "1.0.3",
"requirejs": "2.1.17", "requirejs": "2.1.17",
"sinon": "1.12.2", "sinon": "1.10.3",
"sizzle": "2.2.1", "sizzle": "2.2.1",
"strip-json-comments": "1.0.3", "strip-json-comments": "1.0.3",
"testswarm": "1.1.0", "testswarm": "1.1.0",
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
"undef": true, "undef": true,
"unused": true, "unused": true,
"evil": true,
"sub": true, "sub": true,
// Support: IE < 10, Android < 4.1 // Support: IE < 10, Android < 4.1
...@@ -23,8 +22,8 @@ ...@@ -23,8 +22,8 @@
"JSON": false, "JSON": false,
"jQuery": true, "jQuery": true,
"define": false, "define": true,
"module": false, "module": true,
"noGlobal": true "noGlobal": true
} }
} }
...@@ -9,21 +9,19 @@ define( [ ...@@ -9,21 +9,19 @@ define( [
"./core/init", "./core/init",
"./ajax/parseJSON", "./ajax/parseJSON",
"./ajax/parseXML", "./ajax/parseXML",
"./event/trigger",
"./deferred" "./deferred"
], function( jQuery, document, rnotwhite, location, nonce, rquery ) { ], function( jQuery, document, rnotwhite, location, nonce, rquery ) {
var var
rhash = /#.*$/, rhash = /#.*$/,
rts = /([?&])_=[^&]*/, rts = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
// IE leaves an \r character at EOL
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
// #7653, #8125, #8152: local protocol detection // #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/, rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//, rprotocol = /^\/\//,
rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
/* Prefilters /* Prefilters
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
...@@ -46,11 +44,9 @@ var ...@@ -46,11 +44,9 @@ var
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = "*/".concat( "*" ), allTypes = "*/".concat( "*" ),
// Document location // Anchor tag for parsing the document origin
ajaxLocation = location.href, originAnchor = document.createElement( "a" );
originAnchor.href = location.href;
// Segment location into parts
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) { function addToPrefiltersOrTransports( structure ) {
...@@ -73,7 +69,7 @@ function addToPrefiltersOrTransports( structure ) { ...@@ -73,7 +69,7 @@ function addToPrefiltersOrTransports( structure ) {
while ( ( dataType = dataTypes[ i++ ] ) ) { while ( ( dataType = dataTypes[ i++ ] ) ) {
// Prepend if requested // Prepend if requested
if ( dataType.charAt( 0 ) === "+" ) { if ( dataType[ 0 ] === "+" ) {
dataType = dataType.slice( 1 ) || "*"; dataType = dataType.slice( 1 ) || "*";
( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
...@@ -117,7 +113,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX ...@@ -117,7 +113,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
// that takes "flat" options (not to be deep extended) // that takes "flat" options (not to be deep extended)
// Fixes #9887 // Fixes #9887
function ajaxExtend( target, src ) { function ajaxExtend( target, src ) {
var deep, key, var key, deep,
flatOptions = jQuery.ajaxSettings.flatOptions || {}; flatOptions = jQuery.ajaxSettings.flatOptions || {};
for ( key in src ) { for ( key in src ) {
...@@ -137,7 +133,8 @@ function ajaxExtend( target, src ) { ...@@ -137,7 +133,8 @@ function ajaxExtend( target, src ) {
* - returns the corresponding response * - returns the corresponding response
*/ */
function ajaxHandleResponses( s, jqXHR, responses ) { function ajaxHandleResponses( s, jqXHR, responses ) {
var firstDataType, ct, finalDataType, type,
var ct, type, finalDataType, firstDataType,
contents = s.contents, contents = s.contents,
dataTypes = s.dataTypes; dataTypes = s.dataTypes;
...@@ -226,7 +223,7 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) { ...@@ -226,7 +223,7 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) {
if ( current ) { if ( current ) {
// There's only work to do if current dataType is non-auto // There's only work to do if current dataType is non-auto
if ( current === "*" ) { if ( current === "*" ) {
current = prev; current = prev;
...@@ -269,7 +266,7 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) { ...@@ -269,7 +266,7 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) {
if ( conv !== true ) { if ( conv !== true ) {
// Unless errors are allowed to bubble, catch and return them // Unless errors are allowed to bubble, catch and return them
if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation if ( conv && s.throws ) {
response = conv( response ); response = conv( response );
} else { } else {
try { try {
...@@ -299,9 +296,9 @@ jQuery.extend( { ...@@ -299,9 +296,9 @@ jQuery.extend( {
etag: {}, etag: {},
ajaxSettings: { ajaxSettings: {
url: ajaxLocation, url: location.href,
type: "GET", type: "GET",
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), isLocal: rlocalProtocol.test( location.protocol ),
global: true, global: true,
processData: true, processData: true,
async: true, async: true,
...@@ -393,30 +390,26 @@ jQuery.extend( { ...@@ -393,30 +390,26 @@ jQuery.extend( {
// Force options to be an object // Force options to be an object
options = options || {}; options = options || {};
var var transport,
// Cross-domain detection vars
parts,
// Loop variable
i,
// URL without anti-cache param // URL without anti-cache param
cacheURL, cacheURL,
// Response headers as string // Response headers
responseHeadersString, responseHeadersString,
responseHeaders,
// timeout handle // timeout handle
timeoutTimer, timeoutTimer,
// Url cleanup var
urlAnchor,
// To know if global events are to be dispatched // To know if global events are to be dispatched
fireGlobals, fireGlobals,
transport, // Loop variable
i,
// Response headers
responseHeaders,
// Create the final options object // Create the final options object
s = jQuery.ajaxSetup( {}, options ), s = jQuery.ajaxSetup( {}, options ),
...@@ -525,12 +518,11 @@ jQuery.extend( { ...@@ -525,12 +518,11 @@ jQuery.extend( {
jqXHR.error = jqXHR.fail; jqXHR.error = jqXHR.fail;
// Remove hash character (#7531: and string promotion) // Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Add protocol if not provided (prefilters might expect it)
// Handle falsy url in the settings object (#10093: consistency with old signature) // Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available // We also use the url parameter if available
s.url = ( ( url || s.url || ajaxLocation ) + "" ) s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" )
.replace( rhash, "" ) .replace( rprotocol, location.protocol + "//" );
.replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Alias method option to type as per ticket #12004 // Alias method option to type as per ticket #12004
s.type = options.method || options.type || s.method || s.type; s.type = options.method || options.type || s.method || s.type;
...@@ -538,14 +530,26 @@ jQuery.extend( { ...@@ -538,14 +530,26 @@ jQuery.extend( {
// Extract dataTypes list // Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
// A cross-domain request is in order when we have a protocol:host:port mismatch // A cross-domain request is in order when the origin doesn't match the current origin.
if ( s.crossDomain == null ) { if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() ); urlAnchor = document.createElement( "a" );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || // Support: IE8-11+
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== // IE throws exception if url is malformed, e.g. http://example.com:80x/
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) try {
); urlAnchor.href = s.url;
// Support: IE8-11+
// Anchor's host property isn't correctly set when s.url is relative
urlAnchor.href = urlAnchor.href;
s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
urlAnchor.protocol + "//" + urlAnchor.host;
} catch ( e ) {
// If there is an error parsing the URL, assume it is crossDomain,
// it can be rejected by the transport if it is invalid
s.crossDomain = true;
}
} }
// Convert data if not already a string // Convert data if not already a string
...@@ -640,7 +644,7 @@ jQuery.extend( { ...@@ -640,7 +644,7 @@ jQuery.extend( {
return jqXHR.abort(); return jqXHR.abort();
} }
// aborting is no longer a cancellation // Aborting is no longer a cancellation
strAbort = "abort"; strAbort = "abort";
// Install callbacks on deferreds // Install callbacks on deferreds
...@@ -761,8 +765,7 @@ jQuery.extend( { ...@@ -761,8 +765,7 @@ jQuery.extend( {
} }
} else { } else {
// We extract error from statusText // Extract error from statusText and normalize for non-aborts
// then normalize statusText and status for non-aborts
error = statusText; error = statusText;
if ( status || !statusText ) { if ( status || !statusText ) {
statusText = "error"; statusText = "error";
...@@ -820,7 +823,7 @@ jQuery.extend( { ...@@ -820,7 +823,7 @@ jQuery.extend( {
jQuery.each( [ "get", "post" ], function( i, method ) { jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) { jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted // Shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) { if ( jQuery.isFunction( data ) ) {
type = type || callback; type = type || callback;
callback = data; callback = data;
......
...@@ -53,7 +53,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { ...@@ -53,7 +53,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
return responseContainer[ 0 ]; return responseContainer[ 0 ];
}; };
// force json dataType // Force json dataType
s.dataTypes[ 0 ] = "json"; s.dataTypes[ 0 ] = "json";
// Install callback // Install callback
...@@ -77,10 +77,10 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { ...@@ -77,10 +77,10 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
// Save back as free // Save back as free
if ( s[ callbackName ] ) { if ( s[ callbackName ] ) {
// make sure that re-using the options doesn't screw things around // Make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback; s.jsonpCallback = originalSettings.jsonpCallback;
// save the callback name for future use // Save the callback name for future use
oldCallbacks.push( callbackName ); oldCallbacks.push( callbackName );
} }
......
...@@ -26,7 +26,7 @@ jQuery.fn.load = function( url, params, callback ) { ...@@ -26,7 +26,7 @@ jQuery.fn.load = function( url, params, callback ) {
off = url.indexOf( " " ); off = url.indexOf( " " );
if ( off > -1 ) { if ( off > -1 ) {
selector = jQuery.trim( url.slice( off, url.length ) ); selector = jQuery.trim( url.slice( off ) );
url = url.slice( 0, off ); url = url.slice( 0, off );
} }
......
...@@ -2,50 +2,10 @@ define( [ ...@@ -2,50 +2,10 @@ define( [
"../core" "../core"
], function( jQuery ) { ], function( jQuery ) {
var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; // Support: Android 2.3
// Workaround failure to string-cast null input
jQuery.parseJSON = function( data ) { jQuery.parseJSON = function( data ) {
return JSON.parse( data + "" );
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
// Support: Android 2.3
// Workaround failure to string-cast null input
return window.JSON.parse( data + "" );
}
var requireNonComma,
depth = null,
str = jQuery.trim( data + "" );
// Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
// after removing valid tokens
return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
// Force termination if we see a misplaced comma
if ( requireNonComma && comma ) {
depth = 0;
}
// Perform no more replacements after returning to outermost depth
if ( depth === 0 ) {
return token;
}
// Commas must not follow "[", "{", or ","
requireNonComma = open || comma;
// Determine new depth
// array/object open ("[" or "{"): depth += true - false (increment)
// array/object close ("]" or "}"): depth += false - true (decrement)
// other cases ("," or primitive): depth += true - true (numeric cast)
depth += !close - !open;
// Remove this token
return "";
} ) ) ?
( Function( "return " + str ) )() :
jQuery.error( "Invalid JSON: " + data );
}; };
return jQuery.parseJSON; return jQuery.parseJSON;
......
...@@ -4,23 +4,19 @@ define( [ ...@@ -4,23 +4,19 @@ define( [
// Cross-browser xml parsing // Cross-browser xml parsing
jQuery.parseXML = function( data ) { jQuery.parseXML = function( data ) {
var xml, tmp; var xml;
if ( !data || typeof data !== "string" ) { if ( !data || typeof data !== "string" ) {
return null; return null;
} }
// Support: IE9
try { try {
if ( window.DOMParser ) { // Standard xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
tmp = new window.DOMParser();
xml = tmp.parseFromString( data, "text/xml" );
} else { // IE
xml = new window.ActiveXObject( "Microsoft.XMLDOM" );
xml.async = "false";
xml.loadXML( data );
}
} catch ( e ) { } catch ( e ) {
xml = undefined; xml = undefined;
} }
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data ); jQuery.error( "Invalid XML: " + data );
} }
return xml; return xml;
......
...@@ -21,14 +21,13 @@ jQuery.ajaxSetup( { ...@@ -21,14 +21,13 @@ jQuery.ajaxSetup( {
} }
} ); } );
// Handle cache's special case and global // Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) { jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) { if ( s.cache === undefined ) {
s.cache = false; s.cache = false;
} }
if ( s.crossDomain ) { if ( s.crossDomain ) {
s.type = "GET"; s.type = "GET";
s.global = false;
} }
} ); } );
...@@ -37,55 +36,29 @@ jQuery.ajaxTransport( "script", function( s ) { ...@@ -37,55 +36,29 @@ jQuery.ajaxTransport( "script", function( s ) {
// This transport only deals with cross domain requests // This transport only deals with cross domain requests
if ( s.crossDomain ) { if ( s.crossDomain ) {
var script, callback;
var script,
head = document.head || jQuery( "head" )[ 0 ] || document.documentElement;
return { return {
send: function( _, complete ) {
send: function( _, callback ) { script = jQuery( "<script>" ).prop( {
charset: s.scriptCharset,
script = document.createElement( "script" ); src: s.url
} ).on(
script.async = true; "load error",
callback = function( evt ) {
if ( s.scriptCharset ) { script.remove();
script.charset = s.scriptCharset; callback = null;
} if ( evt ) {
complete( evt.type === "error" ? 404 : 200, evt.type );
script.src = s.url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Remove the script
if ( script.parentNode ) {
script.parentNode.removeChild( script );
}
// Dereference the script
script = null;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
} }
} }
}; );
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
// Use native DOM manipulation to avoid our domManip AJAX trickery // Use native DOM manipulation to avoid our domManip AJAX trickery
head.insertBefore( script, head.firstChild ); document.head.appendChild( script[ 0 ] );
}, },
abort: function() { abort: function() {
if ( script ) { if ( callback ) {
script.onload( undefined, true ); callback();
} }
} }
}; };
......
This diff is collapsed.
define( [ define( [
"./core", "./core",
"./attributes/val",
"./attributes/attr", "./attributes/attr",
"./attributes/prop", "./attributes/prop",
"./attributes/classes" "./attributes/classes",
"./attributes/val"
], function( jQuery ) { ], function( jQuery ) {
// Return jQuery for attributes-only inclusion // Return jQuery for attributes-only inclusion
......
...@@ -3,15 +3,11 @@ define( [ ...@@ -3,15 +3,11 @@ define( [
"../core/access", "../core/access",
"./support", "./support",
"../var/rnotwhite", "../var/rnotwhite",
"./val",
"../selector" "../selector"
], function( jQuery, access, support, rnotwhite ) { ], function( jQuery, access, support, rnotwhite ) {
var nodeHook, boolHook, var boolHook,
attrHandle = jQuery.expr.attrHandle, attrHandle = jQuery.expr.attrHandle;
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = support.getSetAttribute,
getSetInput = support.input;
jQuery.fn.extend( { jQuery.fn.extend( {
attr: function( name, value ) { attr: function( name, value ) {
...@@ -45,7 +41,7 @@ jQuery.extend( { ...@@ -45,7 +41,7 @@ jQuery.extend( {
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
name = name.toLowerCase(); name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || hooks = jQuery.attrHooks[ name ] ||
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
} }
if ( value !== undefined ) { if ( value !== undefined ) {
...@@ -78,9 +74,6 @@ jQuery.extend( { ...@@ -78,9 +74,6 @@ jQuery.extend( {
set: function( elem, value ) { set: function( elem, value ) {
if ( !support.radioValue && value === "radio" && if ( !support.radioValue && value === "radio" &&
jQuery.nodeName( elem, "input" ) ) { jQuery.nodeName( elem, "input" ) ) {
// Setting the type on a radio button after the value resets the value in IE8-9
// Reset value to default in case type is set after value during creation
var val = elem.value; var val = elem.value;
elem.setAttribute( "type", value ); elem.setAttribute( "type", value );
if ( val ) { if ( val ) {
...@@ -105,22 +98,10 @@ jQuery.extend( { ...@@ -105,22 +98,10 @@ jQuery.extend( {
if ( jQuery.expr.match.bool.test( name ) ) { if ( jQuery.expr.match.bool.test( name ) ) {
// Set corresponding property to false // Set corresponding property to false
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false;
elem[ propName ] = false;
// Support: IE<9
// Also clear defaultChecked/defaultSelected (if appropriate)
} else {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false;
}
// See #9699 for explanation of this approach (setting first, then removal)
} else {
jQuery.attr( elem, name, "" );
} }
elem.removeAttribute( getSetAttribute ? name : propName ); elem.removeAttribute( name );
} }
} }
} }
...@@ -133,149 +114,29 @@ boolHook = { ...@@ -133,149 +114,29 @@ boolHook = {
// Remove boolean attributes when set to false // Remove boolean attributes when set to false
jQuery.removeAttr( elem, name ); jQuery.removeAttr( elem, name );
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
// IE<8 needs the *property* name
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
} else { } else {
elem.setAttribute( name, name );
// Support: IE<9
// Use defaultChecked and defaultSelected for oldIE
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
} }
return name; return name;
} }
}; };
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
var getter = attrHandle[ name ] || jQuery.find.attr; var getter = attrHandle[ name ] || jQuery.find.attr;
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { attrHandle[ name ] = function( elem, name, isXML ) {
attrHandle[ name ] = function( elem, name, isXML ) { var ret, handle;
var ret, handle; if ( !isXML ) {
if ( !isXML ) {
// Avoid an infinite loop by temporarily removing this function from the getter
// Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ name ];
handle = attrHandle[ name ]; attrHandle[ name ] = ret;
attrHandle[ name ] = ret; ret = getter( elem, name, isXML ) != null ?
ret = getter( elem, name, isXML ) != null ? name.toLowerCase() :
name.toLowerCase() : null;
null; attrHandle[ name ] = handle;
attrHandle[ name ] = handle;
}
return ret;
};
} else {
attrHandle[ name ] = function( elem, name, isXML ) {
if ( !isXML ) {
return elem[ jQuery.camelCase( "default-" + name ) ] ?
name.toLowerCase() :
null;
}
};
}
} );
// fix oldIE attroperties
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
set: function( elem, value, name ) {
if ( jQuery.nodeName( elem, "input" ) ) {
// Does not return so that setAttribute is also used
elem.defaultValue = value;
} else {
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
return nodeHook && nodeHook.set( elem, value, name );
}
} }
return ret;
}; };
} } );
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = {
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
elem.setAttributeNode(
( ret = elem.ownerDocument.createAttribute( name ) )
);
}
ret.value = value += "";
// Break association with cloned elements by also using setAttribute (#9646)
if ( name === "value" || value === elem.getAttribute( name ) ) {
return value;
}
}
};
// Some attributes are constructed with empty-string values when not defined
attrHandle.id = attrHandle.name = attrHandle.coords =
function( elem, name, isXML ) {
var ret;
if ( !isXML ) {
return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ?
ret.value :
null;
}
};
// Fixing value retrieval on a button requires this module
jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
if ( ret && ret.specified ) {
return ret.value;
}
},
set: nodeHook.set
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
set: function( elem, value, name ) {
nodeHook.set( elem, value === "" ? false : value, name );
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each( [ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
};
} );
}
if ( !support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Note: IE uppercases css property names, but if we were to .toLowerCase()
// .cssText, that would destroy case sensitivity in URL's, like in "background"
return elem.style.cssText || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = value + "" );
}
};
}
} ); } );
define( [ define( [
"../core", "../core",
"../var/rnotwhite", "../var/rnotwhite",
"../data/var/dataPriv",
"../core/init" "../core/init"
], function( jQuery, rnotwhite ) { ], function( jQuery, rnotwhite, dataPriv ) {
var rclass = /[\t\r\n\f]/g; var rclass = /[\t\r\n\f]/g;
function getClass( elem ) { function getClass( elem ) {
return jQuery.attr( elem, "class" ) || ""; return elem.getAttribute && elem.getAttribute( "class" ) || "";
} }
jQuery.fn.extend( { jQuery.fn.extend( {
...@@ -37,10 +38,10 @@ jQuery.fn.extend( { ...@@ -37,10 +38,10 @@ jQuery.fn.extend( {
} }
} }
// only assign if different to avoid unneeded rendering. // Only assign if different to avoid unneeded rendering.
finalValue = jQuery.trim( cur ); finalValue = jQuery.trim( cur );
if ( curValue !== finalValue ) { if ( curValue !== finalValue ) {
jQuery.attr( elem, "class", finalValue ); elem.setAttribute( "class", finalValue );
} }
} }
} }
...@@ -86,7 +87,7 @@ jQuery.fn.extend( { ...@@ -86,7 +87,7 @@ jQuery.fn.extend( {
// Only assign if different to avoid unneeded rendering. // Only assign if different to avoid unneeded rendering.
finalValue = jQuery.trim( cur ); finalValue = jQuery.trim( cur );
if ( curValue !== finalValue ) { if ( curValue !== finalValue ) {
jQuery.attr( elem, "class", finalValue ); elem.setAttribute( "class", finalValue );
} }
} }
} }
...@@ -136,19 +137,21 @@ jQuery.fn.extend( { ...@@ -136,19 +137,21 @@ jQuery.fn.extend( {
className = getClass( this ); className = getClass( this );
if ( className ) { if ( className ) {
// store className if set // Store className if set
jQuery._data( this, "__className__", className ); dataPriv.set( this, "__className__", className );
} }
// If the element has a class name or if we're passed "false", // If the element has a class name or if we're passed `false`,
// then remove the whole classname (if there was one, the above saved it). // then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything), // Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored. // falling back to the empty string if nothing was stored.
jQuery.attr( this, "class", if ( this.setAttribute ) {
className || value === false ? this.setAttribute( "class",
"" : className || value === false ?
jQuery._data( this, "__className__" ) || "" "" :
); dataPriv.get( this, "__className__" ) || ""
);
}
} }
} ); } );
}, },
......
...@@ -5,7 +5,7 @@ define( [ ...@@ -5,7 +5,7 @@ define( [
"../selector" "../selector"
], function( jQuery, access, support ) { ], function( jQuery, access, support ) {
var rfocusable = /^(?:input|select|textarea|button|object)$/i, var rfocusable = /^(?:input|select|textarea|button)$/i,
rclickable = /^(?:a|area)$/i; rclickable = /^(?:a|area)$/i;
jQuery.fn.extend( { jQuery.fn.extend( {
...@@ -14,14 +14,8 @@ jQuery.fn.extend( { ...@@ -14,14 +14,8 @@ jQuery.fn.extend( {
}, },
removeProp: function( name ) { removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each( function() { return this.each( function() {
delete this[ jQuery.propFix[ name ] || name ];
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch ( e ) {}
} ); } );
} }
} ); } );
...@@ -85,21 +79,7 @@ jQuery.extend( { ...@@ -85,21 +79,7 @@ jQuery.extend( {
} }
} ); } );
// Some attributes require a special call on IE // Support: IE <=11 only
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !support.hrefNormalized ) {
// href/src property should get the full normalized URL (#10299/#12915)
jQuery.each( [ "href", "src" ], function( i, name ) {
jQuery.propHooks[ name ] = {
get: function( elem ) {
return elem.getAttribute( name, 4 );
}
};
} );
}
// Support: Safari, IE9+
// Accessing the selectedIndex property // Accessing the selectedIndex property
// forces the browser to respect setting selected // forces the browser to respect setting selected
// on the option // on the option
...@@ -109,14 +89,8 @@ if ( !support.optSelected ) { ...@@ -109,14 +89,8 @@ if ( !support.optSelected ) {
jQuery.propHooks.selected = { jQuery.propHooks.selected = {
get: function( elem ) { get: function( elem ) {
var parent = elem.parentNode; var parent = elem.parentNode;
if ( parent && parent.parentNode ) {
if ( parent ) { parent.parentNode.selectedIndex;
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
} }
return null; return null;
}, },
...@@ -148,9 +122,4 @@ jQuery.each( [ ...@@ -148,9 +122,4 @@ jQuery.each( [
jQuery.propFix[ this.toLowerCase() ] = this; jQuery.propFix[ this.toLowerCase() ] = this;
} ); } );
// IE6/7 call enctype encoding
if ( !support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
} ); } );
...@@ -4,64 +4,30 @@ define( [ ...@@ -4,64 +4,30 @@ define( [
], function( document, support ) { ], function( document, support ) {
( function() { ( function() {
var a, var input = document.createElement( "input" ),
input = document.createElement( "input" ),
div = document.createElement( "div" ),
select = document.createElement( "select" ), select = document.createElement( "select" ),
opt = select.appendChild( document.createElement( "option" ) ); opt = select.appendChild( document.createElement( "option" ) );
// Setup input.type = "checkbox";
div = document.createElement( "div" );
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
a = div.getElementsByTagName( "a" )[ 0 ];
// Support: Windows Web Apps (WWA) // Support: iOS<=5.1, Android<=4.2+
// `type` must use .setAttribute for WWA (#14901) // Default value for a checkbox should be "on"
input.setAttribute( "type", "checkbox" ); support.checkOn = input.value !== "";
div.appendChild( input );
a = div.getElementsByTagName( "a" )[ 0 ]; // Support: IE<=11+
// Must access selectedIndex to make default options select
// First batch of tests.
a.style.cssText = "top:1px";
// Test setAttribute on camelCase class.
// If it works, we need attrFixes when doing get/setAttribute (ie6/7)
support.getSetAttribute = div.className !== "t";
// Get the style information from getAttribute
// (IE uses .cssText instead)
support.style = /top/.test( a.getAttribute( "style" ) );
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
support.hrefNormalized = a.getAttribute( "href" ) === "/a";
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
support.checkOn = !!input.value;
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
support.optSelected = opt.selected; support.optSelected = opt.selected;
// Tests for enctype support on a form (#6743) // Support: Android<=2.3
support.enctype = !!document.createElement( "form" ).enctype; // Options inside disabled selects are incorrectly marked as disabled
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true; select.disabled = true;
support.optDisabled = !opt.disabled; support.optDisabled = !opt.disabled;
// Support: IE8 only // Support: IE<=11+
// Check if we can trust getAttribute("value") // An input loses its value after becoming a radio
input = document.createElement( "input" ); input = document.createElement( "input" );
input.setAttribute( "value", "" );
support.input = input.getAttribute( "value" ) === "";
// Check if an input maintains its value after becoming a radio
input.value = "t"; input.value = "t";
input.setAttribute( "type", "radio" ); input.type = "radio";
support.radioValue = input.value === "t"; support.radioValue = input.value === "t";
} )(); } )();
......
...@@ -17,8 +17,7 @@ jQuery.fn.extend( { ...@@ -17,8 +17,7 @@ jQuery.fn.extend( {
hooks = jQuery.valHooks[ elem.type ] || hooks = jQuery.valHooks[ elem.type ] ||
jQuery.valHooks[ elem.nodeName.toLowerCase() ]; jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( if ( hooks &&
hooks &&
"get" in hooks && "get" in hooks &&
( ret = hooks.get( elem, "value" ) ) !== undefined ( ret = hooks.get( elem, "value" ) ) !== undefined
) { ) {
...@@ -29,10 +28,10 @@ jQuery.fn.extend( { ...@@ -29,10 +28,10 @@ jQuery.fn.extend( {
return typeof ret === "string" ? return typeof ret === "string" ?
// handle most common string cases // Handle most common string cases
ret.replace( rreturn, "" ) : ret.replace( rreturn, "" ) :
// handle cases where value is null/undef or number // Handle cases where value is null/undef or number
ret == null ? "" : ret; ret == null ? "" : ret;
} }
...@@ -57,8 +56,10 @@ jQuery.fn.extend( { ...@@ -57,8 +56,10 @@ jQuery.fn.extend( {
// Treat null/undefined as ""; convert numbers to string // Treat null/undefined as ""; convert numbers to string
if ( val == null ) { if ( val == null ) {
val = ""; val = "";
} else if ( typeof val === "number" ) { } else if ( typeof val === "number" ) {
val += ""; val += "";
} else if ( jQuery.isArray( val ) ) { } else if ( jQuery.isArray( val ) ) {
val = jQuery.map( val, function( value ) { val = jQuery.map( val, function( value ) {
return value == null ? "" : value + ""; return value == null ? "" : value + "";
...@@ -79,6 +80,7 @@ jQuery.extend( { ...@@ -79,6 +80,7 @@ jQuery.extend( {
valHooks: { valHooks: {
option: { option: {
get: function( elem ) { get: function( elem ) {
var val = jQuery.find.attr( elem, "value" ); var val = jQuery.find.attr( elem, "value" );
return val != null ? return val != null ?
val : val :
...@@ -106,13 +108,12 @@ jQuery.extend( { ...@@ -106,13 +108,12 @@ jQuery.extend( {
for ( ; i < max; i++ ) { for ( ; i < max; i++ ) {
option = options[ i ]; option = options[ i ];
// oldIE doesn't update selected after form reset (#2551) // IE8-9 doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) && if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup // Don't return options that are disabled or in a disabled optgroup
( support.optDisabled ? ( support.optDisabled ?
!option.disabled : !option.disabled : option.getAttribute( "disabled" ) === null ) &&
option.getAttribute( "disabled" ) === null ) &&
( !option.parentNode.disabled || ( !option.parentNode.disabled ||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
...@@ -140,24 +141,10 @@ jQuery.extend( { ...@@ -140,24 +141,10 @@ jQuery.extend( {
while ( i-- ) { while ( i-- ) {
option = options[ i ]; option = options[ i ];
if ( option.selected =
if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
) {
// Support: IE6 optionSet = true;
// When new option element is added to select box we need to
// force reflow of newly added node in order to workaround delay
// of initialization properties
try {
option.selected = optionSet = true;
} catch ( _ ) {
// Will be executed only in IE6
option.scrollHeight;
}
} else {
option.selected = false;
} }
} }
...@@ -165,8 +152,7 @@ jQuery.extend( { ...@@ -165,8 +152,7 @@ jQuery.extend( {
if ( !optionSet ) { if ( !optionSet ) {
elem.selectedIndex = -1; elem.selectedIndex = -1;
} }
return values;
return options;
} }
} }
} }
......
...@@ -190,9 +190,9 @@ jQuery.Callbacks = function( options ) { ...@@ -190,9 +190,9 @@ jQuery.Callbacks = function( options ) {
// Also disable .add unless we have memory (since it would have no effect) // Also disable .add unless we have memory (since it would have no effect)
// Abort any pending executions // Abort any pending executions
lock: function() { lock: function() {
locked = true; locked = queue = [];
if ( !memory ) { if ( !memory ) {
self.disable(); list = memory = "";
} }
return this; return this;
}, },
......
define( [ define( [
"./var/deletedIds", "./var/arr",
"./var/document", "./var/document",
"./var/slice", "./var/slice",
"./var/concat", "./var/concat",
...@@ -9,8 +9,7 @@ define( [ ...@@ -9,8 +9,7 @@ define( [
"./var/toString", "./var/toString",
"./var/hasOwn", "./var/hasOwn",
"./var/support" "./var/support"
], function( deletedIds, document, slice, concat, push, indexOf, ], function( arr, document, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
class2type, toString, hasOwn, support ) {
var var
version = "@VERSION", version = "@VERSION",
...@@ -23,7 +22,7 @@ var ...@@ -23,7 +22,7 @@ var
return new jQuery.fn.init( selector, context ); return new jQuery.fn.init( selector, context );
}, },
// Support: Android<4.1, IE<9 // Support: Android<4.1
// Make sure we trim BOM and NBSP // Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
...@@ -116,12 +115,12 @@ jQuery.fn = jQuery.prototype = { ...@@ -116,12 +115,12 @@ jQuery.fn = jQuery.prototype = {
// For internal use only. // For internal use only.
// Behaves like an Array's method, not like a jQuery method. // Behaves like an Array's method, not like a jQuery method.
push: push, push: push,
sort: deletedIds.sort, sort: arr.sort,
splice: deletedIds.splice splice: arr.splice
}; };
jQuery.extend = jQuery.fn.extend = function() { jQuery.extend = jQuery.fn.extend = function() {
var src, copyIsArray, copy, name, options, clone, var options, name, src, copy, copyIsArray, clone,
target = arguments[ 0 ] || {}, target = arguments[ 0 ] || {},
i = 1, i = 1,
length = arguments.length, length = arguments.length,
...@@ -131,7 +130,7 @@ jQuery.extend = jQuery.fn.extend = function() { ...@@ -131,7 +130,7 @@ jQuery.extend = jQuery.fn.extend = function() {
if ( typeof target === "boolean" ) { if ( typeof target === "boolean" ) {
deep = target; deep = target;
// skip the boolean and the target // Skip the boolean and the target
target = arguments[ i ] || {}; target = arguments[ i ] || {};
i++; i++;
} }
...@@ -141,7 +140,7 @@ jQuery.extend = jQuery.fn.extend = function() { ...@@ -141,7 +140,7 @@ jQuery.extend = jQuery.fn.extend = function() {
target = {}; target = {};
} }
// extend jQuery itself if only one argument is passed // Extend jQuery itself if only one argument is passed
if ( i === length ) { if ( i === length ) {
target = this; target = this;
i--; i--;
...@@ -203,20 +202,14 @@ jQuery.extend( { ...@@ -203,20 +202,14 @@ jQuery.extend( {
noop: function() {}, noop: function() {},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) { isFunction: function( obj ) {
return jQuery.type( obj ) === "function"; return jQuery.type( obj ) === "function";
}, },
isArray: Array.isArray || function( obj ) { isArray: Array.isArray,
return jQuery.type( obj ) === "array";
},
isWindow: function( obj ) { isWindow: function( obj ) {
/* jshint eqeqeq: false */ return obj != null && obj === obj.window;
return obj != null && obj == obj.window;
}, },
isNumeric: function( obj ) { isNumeric: function( obj ) {
...@@ -229,77 +222,78 @@ jQuery.extend( { ...@@ -229,77 +222,78 @@ jQuery.extend( {
return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
}, },
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
isPlainObject: function( obj ) { isPlainObject: function( obj ) {
var key; var key;
// Must be an Object. // Not plain objects:
// Because of IE, we also have to check the presence of the constructor property. // - Any object or value whose internal [[Class]] property is not "[object Object]"
// Make sure that DOM nodes and window objects don't pass through, as well // - DOM nodes
if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { // - window
if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false; return false;
} }
try { // Not own constructor property must be Object
if ( obj.constructor &&
// Not own constructor property must be Object
if ( obj.constructor &&
!hasOwn.call( obj, "constructor" ) && !hasOwn.call( obj, "constructor" ) &&
!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { !hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false; return false;
} }
// Support: IE<9
// Handle iteration over inherited properties before own properties.
if ( !support.ownFirst ) {
for ( key in obj ) {
return hasOwn.call( obj, key );
}
}
// Own properties are enumerated firstly, so to speed up, // Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own. // if last one is own, then all properties are own
for ( key in obj ) {} for ( key in obj ) {}
return key === undefined || hasOwn.call( obj, key ); return key === undefined || hasOwn.call( obj, key );
}, },
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
type: function( obj ) { type: function( obj ) {
if ( obj == null ) { if ( obj == null ) {
return obj + ""; return obj + "";
} }
// 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;
}, },
// Workarounds based on findings by Jim Driscoll // Evaluates a script in a global context
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( code ) {
globalEval: function( data ) { var script,
if ( data && jQuery.trim( data ) ) { indirect = eval;
// We use execScript on Internet Explorer code = jQuery.trim( code );
// We use an anonymous function so that context is window
// rather than jQuery in Firefox if ( code ) {
( window.execScript || function( data ) {
window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation // If the code includes a valid, prologue position
} )( data ); // strict mode pragma, execute code by injecting a
// script tag into the document.
if ( code.indexOf( "use strict" ) === 1 ) {
script = document.createElement( "script" );
script.text = code;
document.head.appendChild( script ).parentNode.removeChild( script );
} else {
// Otherwise, avoid the DOM node creation, insertion
// and removal by using an indirect global eval
indirect( code );
}
} }
}, },
// Convert dashed to camelCase; used by the css and data modules // Convert dashed to camelCase; used by the css and data modules
// Support: IE9-11+
// Microsoft forgot to hump their vendor prefix (#9572) // Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) { camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
...@@ -330,7 +324,7 @@ jQuery.extend( { ...@@ -330,7 +324,7 @@ jQuery.extend( {
return obj; return obj;
}, },
// Support: Android<4.1, IE<9 // Support: Android<4.1
trim: function( text ) { trim: function( text ) {
return text == null ? return text == null ?
"" : "" :
...@@ -356,26 +350,7 @@ jQuery.extend( { ...@@ -356,26 +350,7 @@ jQuery.extend( {
}, },
inArray: function( elem, arr, i ) { inArray: function( elem, arr, i ) {
var len; return arr == null ? -1 : indexOf.call( arr, elem, i );
if ( arr ) {
if ( indexOf ) {
return indexOf.call( arr, elem, i );
}
len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
}
return -1;
}, },
merge: function( first, second ) { merge: function( first, second ) {
...@@ -383,16 +358,8 @@ jQuery.extend( { ...@@ -383,16 +358,8 @@ jQuery.extend( {
j = 0, j = 0,
i = first.length; i = first.length;
while ( j < len ) { for ( ; j < len; j++ ) {
first[ i++ ] = second[ j++ ]; first[ i++ ] = second[ j ];
}
// Support: IE<9
// Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
if ( len !== len ) {
while ( second[ j ] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
} }
first.length = i; first.length = i;
...@@ -457,7 +424,7 @@ jQuery.extend( { ...@@ -457,7 +424,7 @@ jQuery.extend( {
// Bind a function to a context, optionally partially applying any // Bind a function to a context, optionally partially applying any
// arguments. // arguments.
proxy: function( fn, context ) { proxy: function( fn, context ) {
var args, proxy, tmp; var tmp, args, proxy;
if ( typeof context === "string" ) { if ( typeof context === "string" ) {
tmp = fn[ context ]; tmp = fn[ context ];
...@@ -483,9 +450,7 @@ jQuery.extend( { ...@@ -483,9 +450,7 @@ jQuery.extend( {
return proxy; return proxy;
}, },
now: function() { now: Date.now,
return +( new Date() );
},
// jQuery.support is not used in Core but other projects attach their // jQuery.support is not used in Core but other projects attach their
// properties to it so it needs to exist. // properties to it so it needs to exist.
...@@ -498,7 +463,7 @@ jQuery.extend( { ...@@ -498,7 +463,7 @@ jQuery.extend( {
// three lines. // three lines.
/* jshint ignore: start */ /* jshint ignore: start */
if ( typeof Symbol === "function" ) { if ( typeof Symbol === "function" ) {
jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
} }
/* jshint ignore: end */ /* jshint ignore: end */
......
...@@ -6,7 +6,7 @@ define( [ ...@@ -6,7 +6,7 @@ define( [
// The value/s can optionally be executed if it's a function // The value/s can optionally be executed if it's a function
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0, var i = 0,
length = elems.length, len = elems.length,
bulk = key == null; bulk = key == null;
// Sets many values // Sets many values
...@@ -41,11 +41,11 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { ...@@ -41,11 +41,11 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
} }
if ( fn ) { if ( fn ) {
for ( ; i < length; i++ ) { for ( ; i < len; i++ ) {
fn( fn(
elems[ i ], elems[ i ], key, raw ?
key, value :
raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) value.call( elems[ i ], i, fn( elems[ i ], key ) )
); );
} }
} }
...@@ -57,7 +57,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { ...@@ -57,7 +57,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
// Gets // Gets
bulk ? bulk ?
fn.call( elems ) : fn.call( elems ) :
length ? fn( elems[ 0 ], key ) : emptyGet; len ? fn( elems[ 0 ], key ) : emptyGet;
}; };
return access; return access;
......
...@@ -22,14 +22,14 @@ var rootjQuery, ...@@ -22,14 +22,14 @@ var rootjQuery,
return this; return this;
} }
// init accepts an alternate rootjQuery // Method init() accepts an alternate rootjQuery
// so migrate can support jQuery.sub (gh-2101) // so migrate can support jQuery.sub (gh-2101)
root = root || rootjQuery; root = root || rootjQuery;
// Handle HTML strings // Handle HTML strings
if ( typeof selector === "string" ) { if ( typeof selector === "string" ) {
if ( selector.charAt( 0 ) === "<" && if ( selector[ 0 ] === "<" &&
selector.charAt( selector.length - 1 ) === ">" && selector[ selector.length - 1 ] === ">" &&
selector.length >= 3 ) { selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check // Assume that strings that start and end with <> are HTML and skip the regex check
...@@ -46,7 +46,7 @@ var rootjQuery, ...@@ -46,7 +46,7 @@ var rootjQuery,
if ( match[ 1 ] ) { if ( match[ 1 ] ) {
context = context instanceof jQuery ? context[ 0 ] : context; context = context instanceof jQuery ? context[ 0 ] : context;
// scripts is true for back-compat // Option to run scripts is true for back-compat
// Intentionally let the error be thrown if parseHTML is not present // Intentionally let the error be thrown if parseHTML is not present
jQuery.merge( this, jQuery.parseHTML( jQuery.merge( this, jQuery.parseHTML(
match[ 1 ], match[ 1 ],
...@@ -75,17 +75,11 @@ var rootjQuery, ...@@ -75,17 +75,11 @@ var rootjQuery,
} else { } else {
elem = document.getElementById( match[ 2 ] ); elem = document.getElementById( match[ 2 ] );
// Check parentNode to catch when Blackberry 4.6 returns // Support: Blackberry 4.6
// nodes that are no longer in the document #6963 // gEBID returns nodes no longer in the document (#6963)
if ( elem && elem.parentNode ) { if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items // Inject the element directly into the jQuery object
// by name instead of ID
if ( elem.id !== match[ 2 ] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1; this.length = 1;
this[ 0 ] = elem; this[ 0 ] = elem;
} }
...@@ -114,7 +108,7 @@ var rootjQuery, ...@@ -114,7 +108,7 @@ var rootjQuery,
// HANDLE: $(function) // HANDLE: $(function)
// Shortcut for document ready // Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) { } else if ( jQuery.isFunction( selector ) ) {
return typeof root.ready !== "undefined" ? return root.ready !== undefined ?
root.ready( selector ) : root.ready( selector ) :
// Execute immediately if ready is not present // Execute immediately if ready is not present
......
...@@ -5,7 +5,7 @@ define( [ ...@@ -5,7 +5,7 @@ define( [
"../manipulation/buildFragment" "../manipulation/buildFragment"
], function( jQuery, document, rsingleTag, buildFragment ) { ], function( jQuery, document, rsingleTag, buildFragment ) {
// data: string of html // Argument "data" should be string of html
// context (optional): If specified, the fragment will be created in this context, // context (optional): If specified, the fragment will be created in this context,
// defaults to document // defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string // keepScripts (optional): If true, will include scripts passed in the html string
......
...@@ -61,33 +61,13 @@ jQuery.extend( { ...@@ -61,33 +61,13 @@ jQuery.extend( {
} }
} ); } );
/**
* Clean-up method for dom ready events
*/
function detach() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed );
window.removeEventListener( "load", completed );
} else {
document.detachEvent( "onreadystatechange", completed );
window.detachEvent( "onload", completed );
}
}
/** /**
* The ready event handler and self cleanup method * The ready event handler and self cleanup method
*/ */
function completed() { function completed() {
document.removeEventListener( "DOMContentLoaded", completed );
// readyState === "complete" is good enough for us to call the dom ready in oldIE window.removeEventListener( "load", completed );
if ( document.addEventListener || jQuery.ready();
window.event.type === "load" ||
document.readyState === "complete" ) {
detach();
jQuery.ready();
}
} }
jQuery.ready.promise = function( obj ) { jQuery.ready.promise = function( obj ) {
...@@ -97,7 +77,7 @@ jQuery.ready.promise = function( obj ) { ...@@ -97,7 +77,7 @@ jQuery.ready.promise = function( obj ) {
// Catch cases where $(document).ready() is called // Catch cases where $(document).ready() is called
// after the browser event has already occurred. // after the browser event has already occurred.
// Support: IE6-10 // Support: IE9-10 only
// Older IE sometimes signals "interactive" too soon // Older IE sometimes signals "interactive" too soon
if ( document.readyState === "complete" || if ( document.readyState === "complete" ||
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
...@@ -105,53 +85,13 @@ jQuery.ready.promise = function( obj ) { ...@@ -105,53 +85,13 @@ jQuery.ready.promise = function( obj ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready // Handle it asynchronously to allow scripts the opportunity to delay ready
window.setTimeout( jQuery.ready ); window.setTimeout( jQuery.ready );
// Standards-based browsers support DOMContentLoaded } else {
} else if ( document.addEventListener ) {
// Use the handy event callback // Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed ); document.addEventListener( "DOMContentLoaded", completed );
// A fallback to window.onload, that will always work // A fallback to window.onload, that will always work
window.addEventListener( "load", completed ); window.addEventListener( "load", completed );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", completed );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", completed );
// If IE and not a frame
// continually check to see if the document is ready
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch ( e ) {}
if ( top && top.doScroll ) {
( function doScrollCheck() {
if ( !jQuery.isReady ) {
try {
// Use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
top.doScroll( "left" );
} catch ( e ) {
return window.setTimeout( doScrollCheck, 50 );
}
// detach all dom ready events
detach();
// and execute any waiting functions
jQuery.ready();
}
} )();
}
} }
} }
return readyList.promise( obj ); return readyList.promise( obj );
......
This diff is collapsed.
define( [ define( [
"exports",
"../core", "../core",
"../var/documentElement",
"./var/rnumnonpx", "./var/rnumnonpx",
"./var/rmargin", "./var/rmargin",
"./var/getStyles",
"./support", "./support",
"../selector" // contains "../selector" // Get jQuery.contains
], function( exports, jQuery, documentElement, rnumnonpx, rmargin, support ) { ], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {
var getStyles, curCSS, function curCSS( elem, name, computed ) {
rposition = /^(top|right|bottom|left)$/; var width, minWidth, maxWidth, ret,
style = elem.style;
if ( window.getComputedStyle ) {
getStyles = function( elem ) { computed = computed || getStyles( elem );
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
// IE throws on elements created in popups // Support: Opera 12.1x only
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle" // Fall back to style even without computed
var view = elem.ownerDocument.defaultView; // computed is undefined for elems on document fragments
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
if ( !view || !view.opener ) { ret = jQuery.style( elem, name );
view = window; }
}
// Support: IE9
return view.getComputedStyle( elem ); // getPropertyValue is only needed for .css('filter') (#12537)
}; if ( computed ) {
curCSS = function( elem, name, computed ) { // A tribute to the "awesome hack by Dean Edwards"
var width, minWidth, maxWidth, ret, // Android Browser returns percentage for some values,
style = elem.style; // but width seems to be reliably pixels.
// This is against the CSSOM draft spec:
computed = computed || getStyles( elem ); // http://dev.w3.org/csswg/cssom/#resolved-values
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
// Support: Opera 12.1x only
// Fall back to style even without computed
// computed is undefined for elems on document fragments
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
if ( computed ) {
// A tribute to the "awesome hack by Dean Edwards"
// Chrome < 17 and Safari 5.0 uses "computed value"
// instead of "used value" for margin-right
// Safari 5.1.7 (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 ) ) {
// 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;
}
}
// Support: IE
// IE returns zIndex value as an integer.
return ret === undefined ?
ret :
ret + "";
};
} else if ( documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, computed ) {
var left, rs, rsLeft, ret,
style = elem.style;
computed = computed || getStyles( elem );
ret = computed ? computed[ name ] : undefined;
// Avoid setting ret to empty string here
// so we don't default to auto
if ( ret == null && style && style[ name ] ) {
ret = style[ name ];
}
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// but not position css attributes, as those are
// proportional to the parent element instead
// and we can't measure the parent instead because it
// might trigger a "stacking dolls" problem
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
// Remember the original values // Remember the original values
left = style.left; width = style.width;
rs = elem.runtimeStyle; minWidth = style.minWidth;
rsLeft = rs && rs.left; maxWidth = style.maxWidth;
// Put in the new values to get a computed value out // Put in the new values to get a computed value out
if ( rsLeft ) { style.minWidth = style.maxWidth = style.width = ret;
rs.left = elem.currentStyle.left; ret = computed.width;
}
style.left = name === "fontSize" ? "1em" : ret;
ret = style.pixelLeft + "px";
// Revert the changed values // Revert the changed values
style.left = left; style.width = width;
if ( rsLeft ) { style.minWidth = minWidth;
rs.left = rsLeft; style.maxWidth = maxWidth;
}
} }
}
return ret !== undefined ?
// Support: IE // Support: IE9-11+
// IE returns zIndex value as an integer. // IE returns zIndex value as an integer.
return ret === undefined ? ret + "" :
ret : ret;
ret + "" || "auto";
};
} }
exports.getStyles = getStyles; return curCSS;
exports.curCSS = curCSS;
} ); } );
...@@ -51,7 +51,7 @@ function defaultDisplay( nodeName ) { ...@@ -51,7 +51,7 @@ function defaultDisplay( nodeName ) {
.appendTo( doc.documentElement ); .appendTo( doc.documentElement );
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; doc = iframe[ 0 ].contentDocument;
// Support: IE // Support: IE
doc.write(); doc.write();
......
define( [ define( [
"../core", "../core",
"../var/document", "../selector"
"./support", ], function( jQuery ) {
"../selector",
"../css"
], function( jQuery, document, support ) {
function getDisplay( elem ) {
return elem.style && elem.style.display || jQuery.css( elem, "display" );
}
function filterHidden( elem ) {
// Disconnected elements are considered hidden
if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) {
return true;
}
while ( elem && elem.nodeType === 1 ) {
if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
return true;
}
elem = elem.parentNode;
}
return false;
}
jQuery.expr.filters.hidden = function( elem ) { jQuery.expr.filters.hidden = function( elem ) {
return !jQuery.expr.filters.visible( elem );
};
jQuery.expr.filters.visible = function( elem ) {
// Support: Opera <= 12.12 // Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements // Opera reports offsetWidths and offsetHeights less than zero on some elements
return support.reliableHiddenOffsets() ? // Use OR instead of AND as the element is not visible if either is true
( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 && // See tickets #10406 and #13132
!elem.getClientRects().length ) : return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
filterHidden( elem );
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
}; };
} ); } );
define( [], function() { define( [
"../data/var/dataPriv"
], function( dataPriv ) {
function showHide( elements, show ) { function showHide( elements, show ) {
var display, elem, var display, elem,
values = [], values = [],
...@@ -17,14 +20,14 @@ function showHide( elements, show ) { ...@@ -17,14 +20,14 @@ function showHide( elements, show ) {
if ( display === "none" ) { if ( display === "none" ) {
// Restore a pre-hide() value if we have one // Restore a pre-hide() value if we have one
values[ index ] = jQuery._data( elem, "display" ) || ""; values[ index ] = dataPriv.get( elem, "display" ) || "";
} }
} else { } else {
if ( display !== "none" ) { if ( display !== "none" ) {
values[ index ] = "none"; values[ index ] = "none";
// Remember the value we're replacing // Remember the value we're replacing
jQuery._data( elem, "display", display ); dataPriv.set( elem, "display", display );
} }
} }
} }
......
...@@ -6,8 +6,7 @@ define( [ ...@@ -6,8 +6,7 @@ define( [
], function( jQuery, document, documentElement, support ) { ], function( jQuery, document, documentElement, support ) {
( function() { ( function() {
var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal, var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal,
container = document.createElement( "div" ), container = document.createElement( "div" ),
div = document.createElement( "div" ); div = document.createElement( "div" );
...@@ -16,167 +15,105 @@ define( [ ...@@ -16,167 +15,105 @@ define( [
return; return;
} }
div.style.cssText = "float:left;opacity:.5"; // Support: IE9-11+
// Style of cloned element affects source element cloned (#8908)
// Support: IE<9
// Make sure that element opacity exists (as opposed to filter)
support.opacity = div.style.opacity === "0.5";
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
support.cssFloat = !!div.style.cssFloat;
div.style.backgroundClip = "content-box"; div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = ""; div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box"; support.clearCloneStyle = div.style.backgroundClip === "content-box";
container = document.createElement( "div" );
container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
"padding:0;margin-top:1px;position:absolute"; "padding:0;margin-top:1px;position:absolute";
div.innerHTML = "";
container.appendChild( div ); container.appendChild( div );
// Support: Firefox<29, Android 2.3 // Executing both pixelPosition & boxSizingReliable tests require only one layout
// Vendor-prefix box-sizing // so they're executed at the same time to save the second computation.
support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" || function computeStyleTests() {
div.style.WebkitBoxSizing === ""; div.style.cssText =
// Support: Firefox<29, Android 2.3
// Vendor-prefix box-sizing
"-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 );
var divStyle = window.getComputedStyle( div );
pixelPositionVal = divStyle.top !== "1%";
reliableMarginLeftVal = divStyle.marginLeft === "2px";
boxSizingReliableVal = divStyle.width === "4px";
// Support: Android 4.0 - 4.3 only
// Some styles come back with percentage values, even though they shouldn't
div.style.marginRight = "50%";
pixelMarginRightVal = divStyle.marginRight === "4px";
documentElement.removeChild( container );
}
jQuery.extend( support, { jQuery.extend( support, {
reliableHiddenOffsets: function() { pixelPosition: function() {
if ( pixelPositionVal == null ) {
computeStyleTests();
}
return reliableHiddenOffsetsVal;
},
// This test is executed only once but we still do memoizing
// since we can use the boxSizingReliable pre-computing.
// No need to check if the test was already performed, though.
computeStyleTests();
return pixelPositionVal;
},
boxSizingReliable: function() { boxSizingReliable: function() {
if ( boxSizingReliableVal == null ) {
// We're checking for pixelPositionVal here instead of boxSizingReliableVal
// since that compresses better and they're computed together anyway.
if ( pixelPositionVal == null ) {
computeStyleTests(); computeStyleTests();
} }
return boxSizingReliableVal; return boxSizingReliableVal;
}, },
pixelMarginRight: function() { pixelMarginRight: function() {
// Support: Android 4.0-4.3 // Support: Android 4.0-4.3
if ( pixelPositionVal == null ) { // We're checking for boxSizingReliableVal here instead of pixelMarginRightVal
// since that compresses better and they're computed together anyway.
if ( boxSizingReliableVal == null ) {
computeStyleTests(); computeStyleTests();
} }
return pixelMarginRightVal; return pixelMarginRightVal;
}, },
pixelPosition: function() {
if ( pixelPositionVal == null ) {
computeStyleTests();
}
return pixelPositionVal;
},
reliableMarginRight: function() {
// Support: Android 2.3
if ( pixelPositionVal == null ) {
computeStyleTests();
}
return reliableMarginRightVal;
},
reliableMarginLeft: function() { reliableMarginLeft: function() {
// Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
if ( pixelPositionVal == null ) { if ( boxSizingReliableVal == null ) {
computeStyleTests(); computeStyleTests();
} }
return reliableMarginLeftVal; return reliableMarginLeftVal;
} },
} ); reliableMarginRight: function() {
function computeStyleTests() {
var contents, divStyle,
documentElement = document.documentElement;
// Setup
documentElement.appendChild( container );
div.style.cssText =
// Support: Android 2.3 // Support: Android 2.3
// Vendor-prefix box-sizing // Check if div with explicit width and no margin-right incorrectly
"-webkit-box-sizing:border-box;box-sizing:border-box;" + // gets computed margin-right based on width of container. (#3333)
"position:relative;display:block;" +
"margin:auto;border:1px;padding:1px;" +
"top:1%;width:50%";
// Support: IE<9
// Assume reasonable values in the absence of getComputedStyle
pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false;
pixelMarginRightVal = reliableMarginRightVal = true;
// Check for getComputedStyle so that this code is not run in IE<9.
if ( window.getComputedStyle ) {
divStyle = window.getComputedStyle( div );
pixelPositionVal = ( divStyle || {} ).top !== "1%";
reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px";
boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px";
// Support: Android 4.0 - 4.3 only
// Some styles come back with percentage values, even though they shouldn't
div.style.marginRight = "50%";
pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
// Support: Android 2.3 only
// Div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container (#3333)
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
contents = div.appendChild( document.createElement( "div" ) ); // This support function is only executed once so no memoizing is needed.
var ret,
marginDiv = div.appendChild( document.createElement( "div" ) );
// Reset CSS: box-sizing; display; margin; border; padding // Reset CSS: box-sizing; display; margin; border; padding
contents.style.cssText = div.style.cssText = marginDiv.style.cssText = div.style.cssText =
// Support: Android 2.3 // Support: Android 2.3
// Vendor-prefix box-sizing // Vendor-prefix box-sizing
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "-webkit-box-sizing:content-box;box-sizing:content-box;" +
"box-sizing:content-box;display:block;margin:0;border:0;padding:0"; "display:block;margin:0;border:0;padding:0";
contents.style.marginRight = contents.style.width = "0"; marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px"; div.style.width = "1px";
documentElement.appendChild( container );
reliableMarginRightVal = ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
!parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
div.removeChild( contents ); documentElement.removeChild( container );
} div.removeChild( marginDiv );
// Support: IE6-8 return ret;
// First check that getClientRects works as expected
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
div.style.display = "none";
reliableHiddenOffsetsVal = div.getClientRects().length === 0;
if ( reliableHiddenOffsetsVal ) {
div.style.display = "";
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
div.childNodes[ 0 ].style.borderCollapse = "separate";
contents = div.getElementsByTagName( "td" );
contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
if ( reliableHiddenOffsetsVal ) {
contents[ 0 ].style.display = "";
contents[ 1 ].style.display = "none";
reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
}
} }
} );
// Teardown
documentElement.removeChild( container );
}
} )(); } )();
return support; return support;
......
define( function() {
return function( elem ) {
// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
var view = elem.ownerDocument.defaultView;
if ( !view || !view.opener ) {
view = window;
}
return view.getComputedStyle( elem );
};
} );
This diff is collapsed.
define( [
"../core",
"../var/rnotwhite",
"./var/acceptData"
], function( jQuery, rnotwhite, acceptData ) {
function Data() {
this.expando = jQuery.expando + Data.uid++;
}
Data.uid = 1;
Data.prototype = {
register: function( owner, initial ) {
var value = initial || {};
// If it is a node unlikely to be stringify-ed or looped over
// use plain assignment
if ( owner.nodeType ) {
owner[ this.expando ] = value;
// Otherwise secure it in a non-enumerable, non-writable property
// configurability must be true to allow the property to be
// deleted with the delete operator
} else {
Object.defineProperty( owner, this.expando, {
value: value,
writable: true,
configurable: true
} );
}
return owner[ this.expando ];
},
cache: function( owner ) {
// We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335.
// Always return an empty object.
if ( !acceptData( owner ) ) {
return {};
}
// Check if the owner object already has a cache
var value = owner[ this.expando ];
// If not, create one
if ( !value ) {
value = {};
// We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335.
// Always return an empty object.
if ( acceptData( owner ) ) {
// If it is a node unlikely to be stringify-ed or looped over
// use plain assignment
if ( owner.nodeType ) {
owner[ this.expando ] = value;
// Otherwise secure it in a non-enumerable property
// configurable must be true to allow the property to be
// deleted when data is removed
} else {
Object.defineProperty( owner, this.expando, {
value: value,
configurable: true
} );
}
}
}
return value;
},
set: function( owner, data, value ) {
var prop,
cache = this.cache( owner );
// Handle: [ owner, key, value ] args
if ( typeof data === "string" ) {
cache[ data ] = value;
// Handle: [ owner, { properties } ] args
} else {
// Copy the properties one-by-one to the cache object
for ( prop in data ) {
cache[ prop ] = data[ prop ];
}
}
return cache;
},
get: function( owner, key ) {
return key === undefined ?
this.cache( owner ) :
owner[ this.expando ] && owner[ this.expando ][ key ];
},
access: function( owner, key, value ) {
var stored;
// In cases where either:
//
// 1. No key was specified
// 2. A string key was specified, but no value provided
//
// Take the "read" path and allow the get method to determine
// which value to return, respectively either:
//
// 1. The entire cache object
// 2. The data stored at the key
//
if ( key === undefined ||
( ( key && typeof key === "string" ) && value === undefined ) ) {
stored = this.get( owner, key );
return stored !== undefined ?
stored : this.get( owner, jQuery.camelCase( key ) );
}
// When the key is not a string, or both a key and value
// are specified, set or extend (existing objects) with either:
//
// 1. An object of properties
// 2. A key and value
//
this.set( owner, key, value );
// Since the "set" path can have two possible entry points
// return the expected data based on which path was taken[*]
return value !== undefined ? value : key;
},
remove: function( owner, key ) {
var i, name, camel,
cache = owner[ this.expando ];
if ( cache === undefined ) {
return;
}
if ( key === undefined ) {
this.register( owner );
} else {
// Support array or space separated string of keys
if ( jQuery.isArray( key ) ) {
// If "name" is an array of keys...
// When data is initially created, via ("key", "val") signature,
// keys will be converted to camelCase.
// Since there is no way to tell _how_ a key was added, remove
// both plain key and camelCase key. #12786
// This will only penalize the array argument path.
name = key.concat( key.map( jQuery.camelCase ) );
} else {
camel = jQuery.camelCase( key );
// Try the string as a key before any manipulation
if ( key in cache ) {
name = [ key, camel ];
} else {
// If a key with the spaces exists, use it.
// Otherwise, create an array by matching non-whitespace
name = camel;
name = name in cache ?
[ name ] : ( name.match( rnotwhite ) || [] );
}
}
i = name.length;
while ( i-- ) {
delete cache[ name[ i ] ];
}
}
// Remove the expando if there's no more data
if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
// Support: Chrome <= 35-45+
// Webkit & Blink performance suffers when deleting properties
// from DOM nodes, so set to undefined instead
// https://code.google.com/p/chromium/issues/detail?id=378607
if ( owner.nodeType ) {
owner[ this.expando ] = undefined;
} else {
delete owner[ this.expando ];
}
}
},
hasData: function( owner ) {
var cache = owner[ this.expando ];
return cache !== undefined && !jQuery.isEmptyObject( cache );
}
};
return Data;
} );
define( [
"../var/document",
"../var/support"
], function( document, support ) {
( function() {
var div = document.createElement( "div" );
// Support: IE<9
support.deleteExpando = true;
try {
delete div.test;
} catch ( e ) {
support.deleteExpando = false;
}
// Null elements to avoid leaks in IE.
div = null;
} )();
return support;
} );
define( [ define( function() {
"../../core"
], function( jQuery ) {
/** /**
* Determines whether an object can have data * Determines whether an object can have data
*/ */
return function( elem ) { return function( owner ) {
var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ],
nodeType = +elem.nodeType || 1;
// Do not set data on non-element DOM nodes because it will not be cleared (#8335). // Accepts only:
return nodeType !== 1 && nodeType !== 9 ? // - Node
false : // - Node.ELEMENT_NODE
// - Node.DOCUMENT_NODE
// Nodes accept data unless otherwise specified; rejection can be conditional // - Object
!noData || noData !== true && elem.getAttribute( "classid" ) === noData; // - Any
/* jshint -W018 */
return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
}; };
} ); } );
define( [
"../Data"
], function( Data ) {
return new Data();
} );
define( [
"../Data"
], function( Data ) {
return new Data();
} );
...@@ -120,7 +120,6 @@ jQuery.extend( { ...@@ -120,7 +120,6 @@ jQuery.extend( {
values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
if ( values === progressValues ) { if ( values === progressValues ) {
deferred.notifyWith( contexts, values ); deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) { } else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values ); deferred.resolveWith( contexts, values );
} }
...@@ -129,7 +128,7 @@ jQuery.extend( { ...@@ -129,7 +128,7 @@ jQuery.extend( {
progressValues, progressContexts, resolveContexts; progressValues, progressContexts, resolveContexts;
// add listeners to Deferred subordinates; treat others as resolved // Add listeners to Deferred subordinates; treat others as resolved
if ( length > 1 ) { if ( length > 1 ) {
progressValues = new Array( length ); progressValues = new Array( length );
progressContexts = new Array( length ); progressContexts = new Array( length );
...@@ -146,7 +145,7 @@ jQuery.extend( { ...@@ -146,7 +145,7 @@ jQuery.extend( {
} }
} }
// if we're not waiting on anything, resolve the master // If we're not waiting on anything, resolve the master
if ( !remaining ) { if ( !remaining ) {
deferred.resolveWith( resolveContexts, resolveValues ); deferred.resolveWith( resolveContexts, resolveValues );
} }
......
define( [ define( [
"./core", "./core"
"./traversing"
], function( jQuery ) { ], function( jQuery ) {
jQuery.fn.extend( { jQuery.fn.extend( {
...@@ -21,14 +20,13 @@ jQuery.fn.extend( { ...@@ -21,14 +20,13 @@ jQuery.fn.extend( {
return arguments.length === 1 ? return arguments.length === 1 ?
this.off( selector, "**" ) : this.off( selector, "**" ) :
this.off( types, selector || "**", fn ); this.off( types, selector || "**", fn );
},
size: function() {
return this.length;
} }
} ); } );
// The number of elements contained in the matched element set
jQuery.fn.size = function() {
return this.length;
};
jQuery.fn.andSelf = jQuery.fn.addBack; jQuery.fn.andSelf = jQuery.fn.addBack;
} ); } );
...@@ -7,9 +7,9 @@ define( [ ...@@ -7,9 +7,9 @@ define( [
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
function( defaultExtra, funcName ) { function( defaultExtra, funcName ) {
// margin is only for outerHeight, outerWidth // Margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) { jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
...@@ -31,8 +31,6 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { ...@@ -31,8 +31,6 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
// whichever is greatest // whichever is greatest
// unfortunately, this causes bug #3838 in IE6/8 only,
// but there is currently no good, small way to fix it.
return Math.max( return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ],
......
This diff is collapsed.
...@@ -66,10 +66,10 @@ Tween.propHooks = { ...@@ -66,10 +66,10 @@ Tween.propHooks = {
return tween.elem[ tween.prop ]; return tween.elem[ tween.prop ];
} }
// passing an empty string as a 3rd parameter to .css will automatically // Passing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails // attempt a parseFloat and fallback to a string if the parse fails.
// so, simple values such as "10px" are parsed to Float. // Simple values such as "10px" are parsed to Float;
// complex values such as "rotate(1rad)" are returned as is. // complex values such as "rotate(1rad)" are returned as-is.
result = jQuery.css( tween.elem, tween.prop, "" ); result = jQuery.css( tween.elem, tween.prop, "" );
// Empty strings, null, undefined and "auto" are converted to 0. // Empty strings, null, undefined and "auto" are converted to 0.
...@@ -77,8 +77,9 @@ Tween.propHooks = { ...@@ -77,8 +77,9 @@ Tween.propHooks = {
}, },
set: function( tween ) { set: function( tween ) {
// use step hook for back compat - use cssHook if its there - use .style if its // Use step hook for back compat.
// available and use plain properties where available // Use cssHook if its there.
// Use .style if available and use plain properties where available.
if ( jQuery.fx.step[ tween.prop ] ) { if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween ); jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.nodeType === 1 && } else if ( tween.elem.nodeType === 1 &&
...@@ -92,9 +93,8 @@ Tween.propHooks = { ...@@ -92,9 +93,8 @@ Tween.propHooks = {
} }
}; };
// Support: IE <=9 // Support: IE9
// Panic based approach to setting things on disconnected nodes // Panic based approach to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) { set: function( tween ) {
if ( tween.elem.nodeType && tween.elem.parentNode ) { if ( tween.elem.nodeType && tween.elem.parentNode ) {
......
define( [
"../var/support",
"../var/document"
], function( support, document ) {
( function() {
var shrinkWrapBlocksVal;
support.shrinkWrapBlocks = function() {
if ( shrinkWrapBlocksVal != null ) {
return shrinkWrapBlocksVal;
}
// Will be changed later if needed.
shrinkWrapBlocksVal = false;
// Minified: var b,c,d
var div, body, container;
body = document.getElementsByTagName( "body" )[ 0 ];
if ( !body || !body.style ) {
// Test fired too early or in an unsupported environment, exit.
return;
}
// Setup
div = document.createElement( "div" );
container = document.createElement( "div" );
container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
body.appendChild( container ).appendChild( div );
// Support: IE6
// Check if elements with layout shrink-wrap their children
if ( typeof div.style.zoom !== "undefined" ) {
// Reset CSS: box-sizing; display; margin; border
div.style.cssText =
// Support: Firefox<29, 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:1px;width:1px;zoom:1";
div.appendChild( document.createElement( "div" ) ).style.width = "5px";
shrinkWrapBlocksVal = div.offsetWidth !== 3;
}
body.removeChild( container );
return shrinkWrapBlocksVal;
};
} )();
return support;
} );
This diff is collapsed.
define( [ define( [
"../core", "../core",
"../event"
"../event",
"./trigger"
], function( jQuery ) { ], function( jQuery ) {
jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
......
define( [
"../core",
"../data/var/dataPriv",
"./support",
"../event",
"./trigger"
], function( jQuery, dataPriv, support ) {
// Support: Firefox
// Firefox doesn't have focus(in | out) events
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
//
// Support: Chrome, Safari
// focus(in | out) events fire after focus & blur events,
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
if ( !support.focusin ) {
jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler on the document while someone wants focusin/focusout
var handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
};
jQuery.event.special[ fix ] = {
setup: function() {
var doc = this.ownerDocument || this,
attaches = dataPriv.access( doc, fix );
if ( !attaches ) {
doc.addEventListener( orig, handler, true );
}
dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
},
teardown: function() {
var doc = this.ownerDocument || this,
attaches = dataPriv.access( doc, fix ) - 1;
if ( !attaches ) {
doc.removeEventListener( orig, handler, true );
dataPriv.remove( doc, fix );
} else {
dataPriv.access( doc, fix, attaches );
}
}
};
} );
}
return jQuery;
} );
define( [ define( [
"../var/document",
"../var/support" "../var/support"
], function( document, support ) { ], function( support ) {
( function() { support.focusin = "onfocusin" in window;
var i, eventName,
div = document.createElement( "div" );
// Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events)
for ( i in { submit: true, change: true, focusin: true } ) {
eventName = "on" + i;
if ( !( support[ i ] = eventName in window ) ) {
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
div.setAttribute( eventName, "t" );
support[ i ] = div.attributes[ eventName ].expando === false;
}
}
// Null elements to avoid leaks in IE.
div = null;
} )();
return support; return support;
......
This diff is collapsed.
...@@ -18,8 +18,8 @@ jQuery.noConflict = function( deep ) { ...@@ -18,8 +18,8 @@ jQuery.noConflict = function( deep ) {
return jQuery; return jQuery;
}; };
// Expose jQuery and $ identifiers, even in // Expose jQuery and $ identifiers, even in AMD
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566) // and CommonJS for browser emulators (#13566)
if ( !noGlobal ) { if ( !noGlobal ) {
window.jQuery = window.$ = jQuery; window.jQuery = window.$ = jQuery;
......
...@@ -5,13 +5,13 @@ define( [ ...@@ -5,13 +5,13 @@ define( [
"./callbacks", "./callbacks",
"./deferred", "./deferred",
"./core/ready", "./core/ready",
"./support",
"./data", "./data",
"./queue", "./queue",
"./queue/delay", "./queue/delay",
"./attributes", "./attributes",
"./event", "./event",
"./event/alias", "./event/alias",
"./event/focusin",
"./manipulation", "./manipulation",
"./manipulation/_evalUrl", "./manipulation/_evalUrl",
"./wrap", "./wrap",
......
This diff is collapsed.
...@@ -9,7 +9,6 @@ jQuery._evalUrl = function( url ) { ...@@ -9,7 +9,6 @@ jQuery._evalUrl = function( url ) {
// Make this explicit, since user can override this through ajaxSetup (#11264) // Make this explicit, since user can override this through ajaxSetup (#11264)
type: "GET", type: "GET",
dataType: "script", dataType: "script",
cache: true,
async: false, async: false,
global: false, global: false,
"throws": true "throws": true
......
This diff is collapsed.
define( [
"./var/nodeNames"
], function( nodeNames ) {
function createSafeFragment( document ) {
var list = nodeNames.split( "|" ),
safeFrag = document.createDocumentFragment();
if ( safeFrag.createElement ) {
while ( list.length ) {
safeFrag.createElement(
list.pop()
);
}
}
return safeFrag;
}
return createSafeFragment;
} );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
define( function() {
return "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
"details|dialog|figcaption|figure|footer|header|hgroup|main|" +
"mark|meter|nav|output|picture|progress|section|summary|template|time|video";
} );
define( function() {
return ( /^\s+/ );
} );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment