Skip to content
Closed
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
14 changes: 10 additions & 4 deletions sizzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1373,11 +1373,16 @@ if ( document.querySelectorAll ) {
oldSelect = select,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
rbuggyQSA = [],

// qSa(:focus) reports false when true (Chrome 21),
// A support test would require too much code (would include document ready)
rbuggyQSA = [":focus"],

// matchesSelector(:focus) reports false when true (Chrome 21),
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
// A support test would require too much code (would include document ready)
// just skip matchesSelector for :active
rbuggyMatches = [":active"],
rbuggyMatches = [ ":active", ":focus" ],
matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
Expand Down Expand Up @@ -1424,7 +1429,8 @@ if ( document.querySelectorAll ) {
}
});

rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
// rbuggyQSA always contains :focus, so no need for a length check
rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );

select = function( selector, context, results, seed, xml ) {
// Only use querySelectorAll when not filtering,
Expand Down Expand Up @@ -1490,7 +1496,7 @@ if ( document.querySelectorAll ) {
} catch ( e ) {}
});

// rbuggyMatches always contains :active, so no need for a length check
// rbuggyMatches always contains :active and :focus, so no need for a length check
rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );

Sizzle.matchesSelector = function( elem, expr ) {
Expand Down