Commit 9ed97a1
committed
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:
- 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@main1 parent fe83c2f commit 9ed97a1
22 files changed
Lines changed: 309 additions & 351 deletions
File tree
- LayoutTests
- fast
- css
- forms
- fieldset
- imported/w3c/web-platform-tests
- dom/events
- html/semantics
- disabled-elements
- selectors/pseudo-classes
- platform
- ios/fast/dom
- mac-wk1/imported/w3c/web-platform-tests/html/semantics/disabled-elements
- Source
- WTF/Scripts/Preferences
- WebCore
- dom
- html
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | | - | |
7 | | - | |
8 | 11 | | |
9 | | - | |
10 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | | - | |
22 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | | - | |
25 | | - | |
| 30 | + | |
26 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | | - | |
29 | | - | |
| |||
Lines changed: 1 addition & 93 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 2 | + | |
95 | 3 | | |
0 commit comments