|
153 | 153 | for("boolean" == typeof target && (deep = target, // Skip the boolean and the target
|
154 | 154 | target = arguments[i] || {}, i++), "object" == typeof target || isFunction(target) || (target = {}), i === length && (target = this, i--); i < length; i++)// Only deal with non-null/undefined values
|
155 | 155 | if (null != (options = arguments[i])) // Extend the base object
|
156 |
| - for(name in options)// Prevent Object.prototype pollution |
157 |
| - // Prevent never-ending loop |
158 |
| - copy = options[name], "__proto__" !== name && target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy))) ? (src = target[name], clone = copyIsArray && !Array.isArray(src) ? [] : copyIsArray || jQuery.isPlainObject(src) ? src : {}, copyIsArray = !1, // Never move original objects, clone them |
| 156 | + for(name in options)copy = options[name], "__proto__" !== name && target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy))) ? (src = target[name], clone = copyIsArray && !Array.isArray(src) ? [] : copyIsArray || jQuery.isPlainObject(src) ? src : {}, copyIsArray = !1, // Never move original objects, clone them |
159 | 157 | target[name] = jQuery.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy));
|
160 | 158 | // Return the modified object
|
161 | 159 | return target;
|
|
334 | 332 | {
|
335 | 333 | if (9 === nodeType) {
|
336 | 334 | if (!(elem = context.getElementById(m))) return results;
|
337 |
| - // Support: IE, Opera, Webkit |
| 335 | + else // Support: IE, Opera, Webkit |
338 | 336 | // TODO: identify versions
|
339 | 337 | // getElementById can match elements by name instead of ID
|
340 | 338 | if (elem.id === m) return results.push(elem), results;
|
341 |
| - // Element context |
342 | 339 | } else // Support: IE, Opera, Webkit
|
343 | 340 | // TODO: identify versions
|
344 | 341 | // getElementById can match elements by name instead of ID
|
|
440 | 437 | // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
|
441 | 438 | // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
|
442 | 439 | if ("form" in elem) {
|
443 |
| - return(// Check for inherited disabledness on relevant non-disabled elements: |
| 440 | + // Check for inherited disabledness on relevant non-disabled elements: |
444 | 441 | // * listed form-associated elements in a disabled fieldset
|
445 | 442 | // https://html.spec.whatwg.org/multipage/forms.html#category-listed
|
446 | 443 | // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
|
447 | 444 | // * option elements in a disabled optgroup
|
448 | 445 | // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
|
449 | 446 | // All such elements have a "form" property.
|
450 |
| - elem.parentNode && !1 === elem.disabled ? // Option elements defer to a parent optgroup if present |
451 |
| - "label" in elem ? "label" in elem.parentNode ? elem.parentNode.disabled === disabled : elem.disabled === disabled : elem.isDisabled === disabled || // Where there is no isDisabled, check manually |
452 |
| - /* jshint -W018 */ !disabled !== elem.isDisabled && inDisabledFieldset(elem) === disabled : elem.disabled === disabled); |
| 447 | + if (elem.parentNode && !1 === elem.disabled) { |
| 448 | + // Option elements defer to a parent optgroup if present |
| 449 | + if ("label" in elem) if ("label" in elem.parentNode) return elem.parentNode.disabled === disabled; |
| 450 | + else return elem.disabled === disabled; |
| 451 | + // Support: IE 6 - 11 |
| 452 | + // Use the isDisabled shortcut property to check for disabled fieldset ancestors |
| 453 | + return elem.isDisabled === disabled || // Where there is no isDisabled, check manually |
| 454 | + /* jshint -W018 */ !disabled !== elem.isDisabled && inDisabledFieldset(elem) === disabled; |
| 455 | + } |
| 456 | + return elem.disabled === disabled; |
453 | 457 | // Try to winnow out elements that can't be disabled before trusting the disabled property.
|
454 | 458 | // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
|
455 | 459 | // even exist on them, let alone have a boolean value.
|
|
716 | 720 | */ getText = Sizzle.getText = function(elem) {
|
717 | 721 | var node, ret = "", i = 0, nodeType = elem.nodeType;
|
718 | 722 | if (nodeType) {
|
719 |
| - if (1 === nodeType || 9 === nodeType || 11 === nodeType) { |
720 |
| - // Use textContent for elements |
721 |
| - // innerText usage removed for consistency of new lines (jQuery #11153) |
722 |
| - if ("string" == typeof elem.textContent) return elem.textContent; |
723 |
| - // Traverse its children |
724 |
| - for(elem = elem.firstChild; elem; elem = elem.nextSibling)ret += getText(elem); |
725 |
| - } else if (3 === nodeType || 4 === nodeType) return elem.nodeValue; |
| 723 | + if (1 === nodeType || 9 === nodeType || 11 === nodeType) // Use textContent for elements |
| 724 | + // innerText usage removed for consistency of new lines (jQuery #11153) |
| 725 | + if ("string" == typeof elem.textContent) return elem.textContent; |
| 726 | + else // Traverse its children |
| 727 | + for(elem = elem.firstChild; elem; elem = elem.nextSibling)ret += getText(elem); |
| 728 | + else if (3 === nodeType || 4 === nodeType) return elem.nodeValue; |
726 | 729 | } else // If no nodeType, this is expected to be an array
|
727 | 730 | for(; node = elem[i++];)// Do not traverse comment nodes
|
728 | 731 | ret += getText(node);
|
|
1045 | 1048 | // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
|
1046 | 1049 | if (xml) {
|
1047 | 1050 | for(; elem = elem[dir];)if ((1 === elem.nodeType || checkNonElements) && matcher(elem, context, xml)) return !0;
|
1048 |
| - } else for(; elem = elem[dir];)if (1 === elem.nodeType || checkNonElements) { |
1049 |
| - if (// Support: IE <9 only |
1050 |
| - // Defend against cloned attroperties (jQuery gh-1709) |
1051 |
| - uniqueCache = (outerCache = elem[expando] || (elem[expando] = {}))[elem.uniqueID] || (outerCache[elem.uniqueID] = {}), skip && skip === elem.nodeName.toLowerCase()) elem = elem[dir] || elem; |
1052 |
| - else if ((oldCache = uniqueCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) // Assign to newCache so results back-propagate to previous elements |
| 1051 | + } else for(; elem = elem[dir];)if (1 === elem.nodeType || checkNonElements) if (// Support: IE <9 only |
| 1052 | + // Defend against cloned attroperties (jQuery gh-1709) |
| 1053 | + uniqueCache = (outerCache = elem[expando] || (elem[expando] = {}))[elem.uniqueID] || (outerCache[elem.uniqueID] = {}), skip && skip === elem.nodeName.toLowerCase()) elem = elem[dir] || elem; |
| 1054 | + else { |
| 1055 | + if ((oldCache = uniqueCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) // Assign to newCache so results back-propagate to previous elements |
1053 | 1056 | return newCache[2] = oldCache[2];
|
1054 |
| - else // A match means we're done; a fail means we have to keep checking |
| 1057 | + // A match means we're done; a fail means we have to keep checking |
1055 | 1058 | if (// Reuse newcache so results back-propagate to previous elements
|
1056 | 1059 | uniqueCache[key] = newCache, newCache[2] = matcher(elem, context, xml)) return !0;
|
1057 | 1060 | }
|
|
1329 | 1332 | null,
|
1330 | 1333 | selector,
|
1331 | 1334 | null
|
1332 |
| - ] : rquickExpr.exec(selector)) && (match[1] || !context)) { |
1333 |
| - // HANDLE: $(html) -> $(array) |
1334 |
| - if (!match[1]) return (elem = document.getElementById(match[2])) && (// Inject the element directly into the jQuery object |
1335 |
| - this[0] = elem, this.length = 1), this; |
| 1335 | + ] : rquickExpr.exec(selector)) && (match[1] || !context)) // HANDLE: $(html) -> $(array) |
| 1336 | + if (!match[1]) return (elem = document.getElementById(match[2])) && (// Inject the element directly into the jQuery object |
| 1337 | + this[0] = elem, this.length = 1), this; |
| 1338 | + else { |
1336 | 1339 | // HANDLE: $(html, props)
|
1337 | 1340 | if (context = context instanceof jQuery ? context[0] : context, // Option to run scripts is true for back-compat
|
1338 | 1341 | // Intentionally let the error be thrown if parseHTML is not present
|
1339 | 1342 | jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, !0)), rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) for(match in context)// Properties of context are called as methods if possible
|
1340 | 1343 | isFunction(this[match]) ? this[match](context[match]) : this.attr(match, context[match]);
|
1341 | 1344 | return this;
|
1342 |
| - // HANDLE: $(expr, $(...)) |
| 1345 | + // HANDLE: $(#id) |
1343 | 1346 | }
|
1344 | 1347 | return !context || context.jquery ? (context || root).find(selector) : this.constructor(context).find(selector);
|
1345 | 1348 | // HANDLE: $(DOMElement)
|
|
3164 | 3167 | hooks.unqueued--, jQuery.queue(elem, "fx").length || hooks.empty.fire();
|
3165 | 3168 | });
|
3166 | 3169 | })), props)if (value = props[prop], rfxtypes.test(value)) {
|
3167 |
| - if (delete props[prop], toggle = toggle || "toggle" === value, value === (hidden ? "hide" : "show")) { |
3168 |
| - // Pretend to be hidden if this is a "show" and |
3169 |
| - // there is still data from a stopped show/hide |
3170 |
| - if ("show" !== value || !dataShow || void 0 === dataShow[prop]) continue; |
3171 |
| - hidden = !0; |
3172 |
| - } |
| 3170 | + if (delete props[prop], toggle = toggle || "toggle" === value, value === (hidden ? "hide" : "show")) // Pretend to be hidden if this is a "show" and |
| 3171 | + // there is still data from a stopped show/hide |
| 3172 | + if ("show" !== value || !dataShow || void 0 === dataShow[prop]) continue; |
| 3173 | + else hidden = !0; |
3173 | 3174 | orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
|
3174 | 3175 | }
|
3175 | 3176 | if (!(!// Bail out if this is a no-op like .hide().hide()
|
|
3505 | 3506 | var hooks, ret, valueIsFunction, elem = this[0];
|
3506 | 3507 | return arguments.length ? (valueIsFunction = isFunction(value), this.each(function(i) {
|
3507 | 3508 | var val;
|
3508 |
| - 1 === this.nodeType && (null == (val = valueIsFunction ? value.call(this, i, jQuery(this).val()) : value) ? val = "" : "number" == typeof val ? val += "" : Array.isArray(val) && (val = jQuery.map(val, function(value) { |
| 3509 | + 1 !== this.nodeType || (null == (val = valueIsFunction ? value.call(this, i, jQuery(this).val()) : value) ? val = "" : "number" == typeof val ? val += "" : Array.isArray(val) && (val = jQuery.map(val, function(value) { |
3509 | 3510 | return null == value ? "" : value + "";
|
3510 | 3511 | })), (hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]) && "set" in hooks && void 0 !== hooks.set(this, val, "value") || (this.value = val));
|
3511 | 3512 | })) : elem ? (hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()]) && "get" in hooks && void 0 !== (ret = hooks.get(elem, "value")) ? ret : "string" == typeof (ret = elem.value) ? ret.replace(rreturn, "") : null == ret ? "" : ret : void 0;
|
|
3956 | 3957 | function done(status, nativeStatusText, responses, headers) {
|
3957 | 3958 | var isSuccess, success, error, response, modified, statusText = nativeStatusText;
|
3958 | 3959 | // Ignore repeat invocations
|
3959 |
| - !completed && (completed = !0, timeoutTimer && window1.clearTimeout(timeoutTimer), // Dereference transport for early garbage collection |
| 3960 | + completed || (completed = !0, timeoutTimer && window1.clearTimeout(timeoutTimer), // Dereference transport for early garbage collection |
3960 | 3961 | // (no matter how long the jqXHR object will be used)
|
3961 | 3962 | transport = void 0, // Cache response headers
|
3962 | 3963 | responseHeadersString = headers || "", // Set readyState
|
|
4327 | 4328 | jQuery.offset.setOffset(this, options, i);
|
4328 | 4329 | });
|
4329 | 4330 | var rect, win, elem = this[0];
|
4330 |
| - return elem ? elem.getClientRects().length ? (// Get document-relative position by adding viewport scroll to viewport-relative gBCR |
| 4331 | + if (elem) return(// Return zeros for disconnected and hidden (display: none) elements (gh-2310) |
| 4332 | + // Support: IE <=11 only |
| 4333 | + // Running getBoundingClientRect on a |
| 4334 | + // disconnected node in IE throws an error |
| 4335 | + elem.getClientRects().length ? (// Get document-relative position by adding viewport scroll to viewport-relative gBCR |
4331 | 4336 | rect = elem.getBoundingClientRect(), win = elem.ownerDocument.defaultView, {
|
4332 | 4337 | top: rect.top + win.pageYOffset,
|
4333 | 4338 | left: rect.left + win.pageXOffset
|
4334 | 4339 | }) : {
|
4335 | 4340 | top: 0,
|
4336 | 4341 | left: 0
|
4337 |
| - } : void 0; |
| 4342 | + }); |
4338 | 4343 | },
|
4339 | 4344 | // position() relates an element's margin box to its offset parent's padding box
|
4340 | 4345 | // This corresponds to the behavior of CSS absolute positioning
|
|
0 commit comments