Selector: Rename rcombinators to rleadingCombinator

Closes gh-5208
This commit is contained in:
Michał Gołębiowski-Owczarek 2023-02-13 18:35:02 +01:00 committed by GitHub
parent 582785e047
commit ac1c59a354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ var i,
rwhitespace = new RegExp( whitespace + "+", "g" ), rwhitespace = new RegExp( whitespace + "+", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
whitespace + "*" ), whitespace + "*" ),
rdescend = new RegExp( whitespace + "|>" ), rdescend = new RegExp( whitespace + "|>" ),
@ -270,7 +270,7 @@ function find( selector, context, results, seed ) {
// as such selectors are not recognized by querySelectorAll. // as such selectors are not recognized by querySelectorAll.
// Thanks to Andrew Dupont for this technique. // Thanks to Andrew Dupont for this technique.
if ( nodeType === 1 && if ( nodeType === 1 &&
( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
// Expand context for sibling selectors // Expand context for sibling selectors
newContext = rsibling.test( selector ) && testContext( context.parentNode ) || newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
@ -1527,7 +1527,7 @@ function tokenize( selector, parseOnly ) {
matched = false; matched = false;
// Combinators // Combinators
if ( ( match = rcombinators.exec( soFar ) ) ) { if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
matched = match.shift(); matched = match.shift();
tokens.push( { tokens.push( {
value: matched, value: matched,