From ed8595a55c008ac96404f2d95408f59c9a3833b6 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Fri, 11 Feb 2022 17:41:21 +0000 Subject: [PATCH] Remove disabled condition from :active matching We are changing this behavior because other browsers don't have disabled conditioning for :active and because it will become more consistent with other pseudo classes: https://github.com/whatwg/html/issues/6635#issuecomment-966432852 Fixed: 1287171 Change-Id: Idab2abbbc94cc73fac70e34ef391c5d63518d569 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3453424 Commit-Queue: Joey Arhar Reviewed-by: Mason Freed Cr-Commit-Position: refs/heads/main@{#970008} --- .../blink/renderer/core/dom/document.cc | 3 +- .../pseudo-classes/active-disabled.html | 86 +++++++++++++++++++ ...elements-should-not-be-active-expected.txt | 10 --- ...control-elements-should-not-be-active.html | 36 -------- 4 files changed, 87 insertions(+), 48 deletions(-) create mode 100644 third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/active-disabled.html delete mode 100644 third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active-expected.txt delete mode 100644 third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active.html diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index f3d3f232721c6..690ffa99d0ef6 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc @@ -7283,8 +7283,7 @@ void Document::UpdateActiveState(bool is_active, SetActiveElement(nullptr); } else { Element* new_active_element = inner_element_in_document; - if (!old_active_element && new_active_element && - !new_active_element->IsDisabledFormControl() && is_active) { + if (!old_active_element && new_active_element && is_active) { // We are setting the :active chain and freezing it. If future moves // happen, they will need to reference this chain. for (Element* element = new_active_element; element; diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/active-disabled.html b/third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/active-disabled.html new file mode 100644 index 0000000000000..63dda59c011d4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/selectors/pseudo-classes/active-disabled.html @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + diff --git a/third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active-expected.txt b/third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active-expected.txt deleted file mode 100644 index 0118ffe503124..0000000000000 --- a/third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active-expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -Style :active should not be applied for disabled Form Control elements - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS background is "rgb(0, 255, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -Click Me! diff --git a/third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active.html b/third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active.html deleted file mode 100644 index 87b9e3f4f4a8f..0000000000000 --- a/third_party/blink/web_tests/fast/css/disabled-form-control-elements-should-not-be-active.html +++ /dev/null @@ -1,36 +0,0 @@ - - - -
- -
- -