🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions external/sizzle/dist/sizzle.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*!
* Sizzle CSS Selector Engine v2.3.7
* Sizzle CSS Selector Engine v2.3.8
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2022-10-03
* Date: 2022-11-16
*/
( function( window ) {
var i,
Expand Down Expand Up @@ -987,7 +987,14 @@ setDocument = Sizzle.setDocument = function( node ) {
// As in, an element does not contain itself
contains = hasCompare || rnative.test( docElem.contains ) ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,

// Support: IE <9 only
// IE doesn't have `contains` on `document` so we need to check for
// `documentElement` presence.
// We need to fall back to `a` when `documentElement` is missing
// as `ownerDocument` of elements within `<template/>` may have
// a null one - a default behavior of all modern browsers.
var adown = a.nodeType === 9 && a.documentElement || a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
Expand Down
4 changes: 2 additions & 2 deletions external/sizzle/dist/sizzle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion external/sizzle/dist/sizzle.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"raw-body": "2.3.3",
"requirejs": "2.3.6",
"sinon": "2.3.7",
"sizzle": "2.3.7",
"sizzle": "2.3.8",
"strip-json-comments": "2.0.1",
"testswarm": "1.1.2",
"uglify-js": "3.4.7"
Expand Down
5 changes: 2 additions & 3 deletions src/selector-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ jQuery.extend( {
return ret;
},
contains: function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains( bup ) );
var bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && a.contains( bup ) );
},
isXMLDoc: function( elem ) {
var namespace = elem.namespaceURI,
Expand Down
43 changes: 43 additions & 0 deletions test/unit/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2837,6 +2837,49 @@ QUnit.test( "Make sure tr is not appended to the wrong tbody (gh-3439)", functio
assert.strictEqual( htmlOut, htmlExpected );
} );

[ true, false ].forEach( function( adoptedCase ) {
QUnit[
typeof HTMLTemplateElement === "function" ?
"test" :
"skip"
]( "Manip within <template /> content moved back & forth doesn't throw - " + (
adoptedCase ? "explicitly adopted" : "not explicitly adopted"
) + " (gh-5147)",
function( assert ) {
assert.expect( 1 );

var fragment, diva, divb,
div = jQuery( "" +
"<div>\n" +
" <div><div class='a'></div></div>\n" +
" <div><div class='b'></div></div>\n" +
"</div>" +
"" ),
template = jQuery( "<template></template>" );

jQuery( "#qunit-fixture" )
.append( div )
.append( template );

fragment = template[ 0 ].content;
diva = div.find( ".a" );
divb = div.find( ".b" );

if ( adoptedCase ) {
document.adoptNode( fragment );
}

fragment.appendChild( div.children()[ 0 ] );
fragment.appendChild( div.children()[ 0 ] );

diva.insertBefore( divb );

assert.strictEqual( diva.siblings( ".b" ).length, 1,
"Insertion worked" );
}
);
} );

QUnit.test( "Make sure tags with single-character names are found (gh-4124)", function( assert ) {
assert.expect( 1 );

Expand Down