Repository navigation
script: Add support for selections that span shadow roots - #47895
Merged
Merged
Conversation
|
🔨 Triggering try run (#34210412483) for Linux (WPT) |
|
|
Allow selections to span shadow root boundaries when possible, based on the tentative specification changes that define this behavior. The general characteristics of this change: - Boundary comparison is done by projecting the two boundaries into the same root and then comparing them, trying to consider deeper nodes as later ones. - When updating from live range changes, collapse the selection if it would reverse the direction and also properly dissassociate selections when the live range root changes. - Remove checks for whether boundary nodes are in a document tree (not in a shadow root) as other browsers aren't doing this and it causes tentative tests to fail. There's an open specification bug about this. - Remove temporary same root checks that prevented cross-boundary selections. Signed-off-by: Martin Robinson <[email protected]>
mrobinson
force-pushed
the
selection-across-shadow-roots
branch
from
September 8, 2026 10:56
3aca1b6 to
d971b74
Compare
Member
Author
|
Looks like there are a good number of new passes in other places as well. |
|
🔨 Triggering try run (#34218107507) for Linux (WPT) |
|
✨ Try run (#34218107507) succeeded. |
SimonSapin
approved these changes
Sep 9, 2026
RichardTjokroutomo
pushed a commit
to RichardTjokroutomo/servo
that referenced
this pull request
Oct 6, 2026
Allow selections to span shadow root boundaries when possible, based on the tentative specification changes that define this behavior. The general characteristics of this change: - Boundary comparison is done by projecting the two boundaries into the same root and then comparing them, trying to consider deeper nodes as later ones. - When updating from live range changes, collapse the selection if it would reverse the direction and also properly dissassociate selections when the live range root changes. - Remove checks for whether boundary nodes are in a document tree (not in a shadow root) as other browsers aren't doing this and it causes tentative tests to fail. There's an open specification bug about this. - Remove temporary same root checks that prevented cross-boundary selections. Testing: This gets a number of WPT tests and subtests passing. Fixes: servo#47117. Signed-off-by: Martin Robinson <[email protected]>
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.
Allow selections to span shadow root boundaries when possible, based on
the tentative specification changes that define this behavior. The
general characteristics of this change:
same root and then comparing them, trying to consider deeper nodes as
later ones.
would reverse the direction and also properly dissassociate selections
when the live range root changes.
a shadow root) as other browsers aren't doing this and it causes
tentative tests to fail. There's an open specification bug about this.
selections.
Testing: This gets a number of WPT tests and subtests passing.
Fixes: #47117.