Commit 5dafb3e
pointerevent_movementxy.html?mouse WPT is failing
https://bugs.webkit.org/show_bug.cgi?id=258780
rdar://111635046
Reviewed by Wenson Hsieh.
Currently, we are failing the pointerevent_movementxy.html?mouse WPT
variant with the error "FAIL mouse pointerevent attributes
assert_equals: movementX should be 0 for event other than pointermove.
expected 0 but got 20". We fail this assertion because events that are
not of the pointermove type have non-zero movementX/Y values.
We address said issue in this commit by:
- Making sure that any event which isn't of type (mouse/pointer/touch)move
does not have non-zero movementX/movementY fields.
- Hardening against accidentally assigning movementX/movementY fields
outside of initialization, by making said fields private.
- Adjusting the expected result for the now passing WPT.
This commit also introduces some additional state into the
WebCore::Event class, through which we can consult if the Event was
constructed using an EventInit dictionary. We need this information
because the attribute values assigned from the EventInit dictionary
receive priority over other rules dictating the Event attribute.
* LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_movementxy_mouse-expected.txt:
* Source/WebCore/dom/Event.cpp:
* Source/WebCore/dom/Event.h:
(WebCore::Event::isConstructedFromInitializer const):
* Source/WebCore/dom/MouseRelatedEvent.cpp:
(WebCore::isMoveEventType):
(WebCore::MouseRelatedEvent::init):
* Source/WebCore/dom/MouseRelatedEvent.h:
Canonical link: https://commits.webkit.org/265730@main1 parent 3342e7d commit 5dafb3e
File tree
5 files changed
+23
-5
lines changed- LayoutTests/imported/w3c/web-platform-tests/pointerevents
- Source/WebCore/dom
5 files changed
+23
-5
lines changedLines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
| 11 | + | |
14 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
| |||
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
79 | 92 | | |
80 | 93 | | |
81 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
0 commit comments