Title: [294475] trunk
- Revision
- 294475
- Author
- [email protected]
- Date
- 2022-05-19 04:37:11 -0700 (Thu, 19 May 2022)
Log Message
Make sure :active is removed on keyup for radios.
When the radio input is checked, we need to make sure that the active flag is
set to false on keyup in order to to prevent the radio from being stuck in the
active state.
This is an import of Chromium CL at
https://chromium-review.googlesource.com/c/chromium/src/+/2466297
https://bugs.webkit.org/show_bug.cgi?id=235530
Reviewed by Chris Dumez.
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/radio-double-activate-pseudo-expected.txt:
* Source/WebCore/html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeyupEvent):
Canonical link: https://commits.webkit.org/250734@main
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/radio-double-activate-pseudo-expected.txt (294474 => 294475)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/radio-double-activate-pseudo-expected.txt 2022-05-19 10:54:05 UTC (rev 294474)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/radio-double-activate-pseudo-expected.txt 2022-05-19 11:37:11 UTC (rev 294475)
@@ -1,4 +1,4 @@
-FAIL <input type=radio> shouldn't have the :active pseudo element after pressing the spacebar twice. assert_equals: If the radio doesn't have the :active pseudo selector, nothing else should either. expected null but got Element node <input type="radio" id="radioinput"></input>
+PASS <input type=radio> shouldn't have the :active pseudo element after pressing the spacebar twice.
Modified: trunk/Source/WebCore/html/RadioInputType.cpp (294474 => 294475)
--- trunk/Source/WebCore/html/RadioInputType.cpp 2022-05-19 10:54:05 UTC (rev 294474)
+++ trunk/Source/WebCore/html/RadioInputType.cpp 2022-05-19 11:37:11 UTC (rev 294475)
@@ -166,8 +166,12 @@
ASSERT(element());
// If an unselected radio is tabbed into (because the entire group has nothing
// checked, or because of some explicit .focus() call), then allow space to check it.
- if (element()->checked())
+ if (element()->checked()) {
+ // If we are going to skip DispatchSimulatedClick, then at least call setActive(false)
+ // to prevent the radio from being stuck in the active state.
+ element()->setActive(false);
return;
+ }
dispatchSimulatedClickIfActive(event);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes