Skip to content

Commit

Permalink
Selector: Remove the "a:enabled" workaround for Chrome <=77
Browse files Browse the repository at this point in the history
Remove the workaround for a broken `:enabled` pseudo-class on anchor elements
in Chrome <=77. These versions of Chrome considers anchor elements with the
`href` attribute as matching `:enabled`.

Closes gh-4569
  • Loading branch information
mgol committed Dec 16, 2019
1 parent f1c16de commit c1ee33a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
9 changes: 0 additions & 9 deletions src/selector/rbuggyQSA.js
Expand Up @@ -6,15 +6,6 @@ var rbuggyQSA = [],
testEl = document.createElement( "div" ),
input = document.createElement( "input" );

testEl.innerHTML = "<a href=''></a>";

// Support: Chrome 38 - 77 only
// Chrome considers anchor elements with href to match ":enabled"
// See https://bugs.chromium.org/p/chromium/issues/detail?id=993387
if ( testEl.querySelectorAll( ":enabled" ).length ) {
rbuggyQSA.push( ":enabled" );
}

// Support: IE 9 - 11+
// IE's :disabled selector does not pick up the children of disabled fieldsets
if ( isIE ) {
Expand Down
6 changes: 1 addition & 5 deletions test/unit/selector.js
Expand Up @@ -2,8 +2,6 @@ QUnit.module( "selector", {
beforeEach: function() {
this.safari = /\bsafari\b/i.test( navigator.userAgent ) &&
!/\bchrome\b/i.test( navigator.userAgent );
this.chrome = /\bchrome\b/i.test( navigator.userAgent ) &&
!/\bedge\b/i.test( navigator.userAgent );
},
afterEach: moduleTeardown
} );
Expand Down Expand Up @@ -1379,9 +1377,7 @@ QUnit.test( "pseudo - :(dis|en)abled, explicitly disabled", function( assert ) {
"disabled-select", "disabled-optgroup", "disabled-option" ]
);

if ( QUnit.jQuerySelectors || !this.chrome ) {
// Support: Chrome 75+
// Chrome recognizes anchor elements as enabled.
if ( QUnit.jQuerySelectors ) {
assert.t(
"Enabled elements",
"#enabled-fieldset :enabled",
Expand Down

0 comments on commit c1ee33a

Please sign in to comment.