[webkit-changes] [WebKit/WebKit] 9ed97a: Event dispatching on disabled form controls

Chris Dumez noreply at github.com
Mon May 15 20:33:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ed97a1ca58c955072d9cc1d1de82d4ab62e6dfb
      https://github.com/WebKit/WebKit/commit/9ed97a1ca58c955072d9cc1d1de82d4ab62e6dfb
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html
    M LayoutTests/fast/forms/disabled-mousedown-event-expected.txt
    M LayoutTests/fast/forms/disabled-mousedown-event.html
    M LayoutTests/fast/forms/fieldset/fieldset-disabled-expected.txt
    M LayoutTests/fast/forms/fieldset/fieldset-disabled.html
    M LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/event-propagate-disabled.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/disabled-elements/fieldset-event-propagation.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/disabled.html
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/enabled.html
    M LayoutTests/platform/ios/fast/dom/focus-dialog-blur-input-type-change-crash-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/disabled-elements/event-propagate-disabled.tentative-expected.txt
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/EventContext.cpp
    M Source/WebCore/dom/EventDispatcher.cpp
    M Source/WebCore/dom/EventPath.cpp
    M Source/WebCore/dom/EventPath.h
    M Source/WebCore/html/HTMLFieldSetElement.cpp
    M Source/WebCore/html/HTMLFieldSetElement.h
    M Source/WebCore/html/HTMLFormControlElement.h

  Log Message:
  -----------
  Event dispatching on disabled form controls
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:
- https://github.com/whatwg/html/issues/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




More information about the webkit-changes mailing list