Event dispatching on disabled form controls - #13837
Conversation
|
EWS run on previous version of this PR (hash 59e6a8d) Details |
59e6a8d to
d657662
Compare
|
EWS run on previous version of this PR (hash d657662) Details |
d657662 to
ca3b0bd
Compare
|
EWS run on previous version of this PR (hash ca3b0bd) Details |
|
Thanks for doing this! The radar link in the commit message needs updating fwiw |
ca3b0bd to
b0b7667
Compare
|
EWS run on previous version of this PR (hash b0b7667) Details |
There was a problem hiding this comment.
Where in the spec does it say to do this?
There was a problem hiding this comment.
As far as I know it doesn't currently but this is Firefox behavior. This is also what Blink did more recently to align:
This is what's being discussed here (seemed to be the most popular behavior):
With us doing this too, all 3 engines should agree on this behavior now.
There was a problem hiding this comment.
I added this information to the commit log.
b0b7667 to
5ca3987
Compare
|
EWS run on current version of this PR (hash 5ca3987) Details |
https://bugs.webkit.org/show_bug.cgi?id=251246 rdar://104727624 Reviewed by Ryosuke Niwa. Start dispatching events on disabled form controls behind a runtime flag. This patch also makes "click", "mousedown", and "mouseup" events have their event paths never include any disabled form controls or ancestors of disabled form controls. This aligns with what Blink did in: - https://chromium-review.googlesource.com/c/chromium/src/+/3929060 And is being discussed at: - whatwg/html#5886 Also make it so that fieldset elements can no longer be disabled, as per: - https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute This gets us closer to the specification and Chrome & Firefox's behavior. This is part of Interop 2023. All new behavior is behind a runtime feature flag, currently off by default. * LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html: * LayoutTests/fast/forms/disabled-mousedown-event-expected.txt: * LayoutTests/fast/forms/disabled-mousedown-event.html: * LayoutTests/fast/forms/fieldset/fieldset-disabled-expected.txt: * LayoutTests/fast/forms/fieldset/fieldset-disabled.html: Resync these tests from Blink. * LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/fieldset-event-propagation.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/disabled.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/enabled.html: Resync these tests from WPT and rebaseline now that more checks are passing. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/event-propagate-disabled.tentative-expected.txt: Rebaseline now that more checks are passing. Note that some subtests are failing but I believe the test needs updating. These subtests are failing in Blink as well: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/third_party/blink/web_tests/external/wpt/html/semantics/disabled-elements/event-propagate-disabled.tentative.html.ini * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): * Source/WebCore/dom/EventContext.cpp: (WebCore::EventContext::handleLocalEvents const): * Source/WebCore/dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * Source/WebCore/dom/EventPath.cpp: (WebCore::EventPath::adjustForDisabledFormControl): * Source/WebCore/dom/EventPath.h: * Source/WebCore/html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::isDisabledFormControl const): * Source/WebCore/html/HTMLFieldSetElement.h: * Source/WebCore/html/HTMLFormControlElement.h: Canonical link: https://commits.webkit.org/264098@main
5ca3987 to
9ed97a1
Compare
|
Committed 264098@main (9ed97a1): https://commits.webkit.org/264098@main Reviewed commits have been landed. Closing PR #13837 and removing active labels. |
9ed97a1
5ca3987