script: Add support for ShadowRoot.delegatesFocus and start implementing the focusing steps#43811
Merged
Merged
Conversation
simonwuelker
approved these changes
Mar 31, 2026
|
🔨 Triggering try run (#23817199076) for Linux (WPT) |
TimvdLippe
reviewed
Mar 31, 2026
|
|
||
| 'SVGElement': { | ||
| 'canGc': ['SetAutofocus', 'SetTabIndex'] | ||
| 'canGc': ['Focus', 'SetAutofocus', 'SetTabIndex'] |
Contributor
There was a problem hiding this comment.
Nit: make it cx so that we don't need to migrate afterwards
| /// | ||
| /// In addition to returning the focus delegate for this [`Element`], this method also returns | ||
| /// the [`FocusableAreaKind`] for efficiency reasons. | ||
| fn focus_delegate(&self) -> Option<(DomRoot<Element>, FocusableAreaKind)> { |
Contributor
There was a problem hiding this comment.
Since these are all newly implemented methods, can you move them into script/dom/element/focus.rs as per #43720 ?
Member
Author
There was a problem hiding this comment.
I'm happy to do this, but it may be the case that a subsequent refactor moves this to a FocusTarget struct.
|
Test results for linux-wpt from try job (#23817199076): Flaky unexpected result (29)
Stable unexpected results that are known to be intermittent (19)
Stable unexpected results (1)
|
|
|
…nting the focusing steps This change has two main interdependent parts: 1. It starts to align Servo's focus code with what is written in the HTML specification. This is going to be a gradual change, so there are still many parts that do not match the specification yet. Still, this adds the major pieces. 2. It adds initial support for the `ShadowRoot.delegatesFocus` property which controls how focusing a shadow DOM root can delegate focus to one of its children. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
e63b54f to
d7d2de5
Compare
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.
This change has two main interdependent parts:
HTML specification. This is going to be a gradual change, so there
are still many parts that do not match the specification yet. Still,
this adds the major pieces.
ShadowRoot.delegatesFocuspropertywhich controls how focusing a shadow DOM root can delegate focus to
one of its children.
Testing: This causes a few WPT tests to start passing.