Skip to content

Commit

Permalink
Merge pull request #254 from LeaVerou/pseudo-element-selector-tests
Browse files Browse the repository at this point in the history
Fixed checks of pseudo-element selectors
  • Loading branch information
SebastianZ authored Aug 11, 2024
2 parents 53bee08 + b15ab06 commit 9886f17
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions supports.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,13 @@
for (var i = 0; i < _.prefixes.length; i++) {
var prefixed = selector.replace(/^(:+)/, '$1' + _.prefixes[i]);

try {
document.querySelector(prefixed);
if (CSS.supports('selector(' + prefixed + ')')) {
_.selector.cached[selector] = true;
return {
success: true,
propertyPrefix: _.prefixes[i],
prefix: _.prefixes[i],
};
} catch (e) {}
}
}

_.selector.cached[selector] = false;
Expand Down

0 comments on commit 9886f17

Please sign in to comment.