Repository navigation
script: Do not fire simulated click on spacebar/enter in non-state-changing elements - #43343
Merged
mrobinson merged 1 commit intoMar 17, 2026
Merged
Conversation
|
🔨 Triggering try run (#23186714044) for Linux (WPT) |
simonwuelker
approved these changes
Mar 17, 2026
| return false; | ||
| } | ||
|
|
||
| // Check whether this node is a state-changing element. Note that the specification doens't |
mrobinson
force-pushed
the
spacebar-and-enter-simulated-click
branch
from
March 17, 2026 09:40
defc780 to
66f3dce
Compare
mrobinson
enabled auto-merge
March 17, 2026 09:40
|
Test results for linux-wpt from try job (#23186714044): Flaky unexpected result (28)
Stable unexpected results that are known to be intermittent (16)
Stable unexpected results (2)
|
|
|
…hanging elements Servo has for years implemented a behavior where spacebar or enter click on a focused element will trigger a click. That behavior used to be unspecified, but now it is. The specification says that this should only happen on state-changing elements. This change makes this happen using activatable elements as a heuristic (as state-changing elements are not defined in the specification). In addition, the behavior is integrated into the default keyboard event handler code. Signed-off-by: Martin Robinson <[email protected]>
mrobinson
force-pushed
the
spacebar-and-enter-simulated-click
branch
from
March 17, 2026 09:57
66f3dce to
eee4796
Compare
mrobinson
enabled auto-merge
March 17, 2026 10:02
TimvdLippe
reviewed
Mar 17, 2026
| is_composing: Cell::new(false), | ||
| char_code: Cell::new(0), | ||
| key_code: Cell::new(0), | ||
| key: Default::default(), |
Contributor
There was a problem hiding this comment.
Question: can we use .. Default::default() here to initialize all remaining members of a struct with the default values? I could have sworn I saw this somewhere else, but now I am not sure whether that works or not.
Member
Author
There was a problem hiding this comment.
No, unfortunately you can only do that if the data structure implements Default itself. In this case it cannot because UIEvent does not implement it. I often wish there was Rust syntax that did what you suggest though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Servo has for years implemented a behavior where spacebar or enter click
on a focused element will trigger a click. That behavior used to be
unspecified, but now it is. The specification says that this should only
happen on state-changing elements. This change makes this happen using
activatable elements as a heuristic (as state-changing elements are not
defined in the specification). In addition, the behavior is integrated
into the default keyboard event handler code.
Testing: This change adds a Servo-specific test due to the ambiguities in the specification.
Fixes: #39028.