script: Let wheel, keyboard- and pointerevents be composed when fired by the user agent#43799
Conversation
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
wheel, keypress and contextmenu events be composedwheel, keypress, contextmenu and pointerevents be composed
|
🔨 Triggering try run (#23800604802) for Linux (WPT) |
|
Test results for linux-wpt from try job (#23800604802): Flaky unexpected result (24)
Stable unexpected results that are known to be intermittent (17)
|
|
✨ Try run (#23800604802) succeeded. |
| // https://w3c.github.io/pointerevents/#dfn-attributes-and-default-actions | ||
| // For pointerenter and pointerleave events, the composed [DOM] attribute SHOULD be false; | ||
| // for all other pointer events in the table above, the attribute SHOULD be true. | ||
| let composed = !matches!(event_type, "pointerenter" | "pointerleave"); | ||
| pointer_event.upcast::<Event>().set_composed(composed); |
There was a problem hiding this comment.
Maybe this should happen in PointerEvent::new so that it is applied consistently?
There was a problem hiding this comment.
Only pointer events that are caused by a user action should be composed.
In other words, (new PointerEvent("pointerup").composed == false.
That's why the code needs to be here.
There was a problem hiding this comment.
Hmm actually the constructor does currently set the composed flag:
servo/components/script/dom/event/pointerevent.rs
Lines 194 to 195 in 11687b3
let's fix that...
There was a problem hiding this comment.
What we do for mouse events is have two constructors, one for system input events and one for synthetic events or constructed events.
There was a problem hiding this comment.
Hmm pointerevents are already (mostly) constructed in MouseEvent::to_pointer_event and MouseEvent::to_pointer_hover_event we can set the flags there.
|
I don't think I can write tests for the keyboard-related events because testdriver throws an error: |
wheel, keypress, contextmenu and pointerevents be composedwheel, keypress, contextmenu and pointerevents be composed when fired by the user agent
This should definitely be possible. In addition to the ones in WPT, we have a bunch of tests that trigger mouse and keyboard events via testdriver. These can be found in |
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
1f70f43 to
4ac5005
Compare
wheel, keypress, contextmenu and pointerevents be composed when fired by the user agentwheel, contextmenu, keyboard- and pointerevents be composed when fired by the user agent
wheel, contextmenu, keyboard- and pointerevents be composed when fired by the user agentwheel, keyboard- and pointerevents be composed when fired by the user agent
0c24714 to
ccbe63b
Compare
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#58879) with upstreamable changes. |
|
🔨 Triggering try run (#23806528431) for Linux (WPT) |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58879). |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#58879) title and body. |
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
ccbe63b to
38cd83b
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58879). |
|
Test results for linux-wpt from try job (#23806528431): Flaky unexpected result (36)
Stable unexpected results that are known to be intermittent (12)
Stable unexpected results (2)
|
|
|
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
| @@ -0,0 +1,3 @@ | |||
| [keyboardevent-composed.html] | |||
| [keydown event must be composed] | |||
| expected: FAIL | |||
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58879). |
Addtionally, this updates lots of outdated spec links for mouse-related things that have moved from the uievents spec to the pointerevents spec.
Testing: This change adds new tests
Part of #35997
Fixes #37772