Ship shadow dom selection
Categories
(Core :: DOM: Core & HTML, task, P2)
Tracking
()
People
(Reporter: sefeng211, Assigned: sefeng211)
References
(Blocks 2 open bugs, Regressed 1 open bug)
Details
(Keywords: dev-doc-complete, webcompat:platform-bug)
User Story
platform-scheduled:2025-09-30 web-feature: composed-ranges
Attachments
(1 file)
This feature is behind dom.shadowdom.selection_across_boundary.enabled
, and eventually we'd like to ship this.
Updated•10 months ago
|
Updated•9 months ago
|
Assignee | ||
Comment 2•5 months ago
|
||
I added the two remaining bugs for this, they are relatively simple.
Updated•5 months ago
|
Updated•5 months ago
|
Comment 3•5 months ago
|
||
Hsin-Yi - is there an schedule for the remaining bugs blocking this? (It blocks a relatively large siteline webcompat bug 1925931). Thanks!
Comment 4•5 months ago
|
||
(In reply to Randell Jesup [:jesup] (needinfo me) from comment #3)
Hsin-Yi - is there an schedule for the remaining bugs blocking this? (It blocks a relatively large siteline webcompat bug 1925931). Thanks!
Hey, here are two remaining blockers: Bug 1965846 and Bug 1965847, which are referenced in this bug. The former is currently under review. In the meantime, we are working to have patches for Bug 1965847 up for review this month. Given the upcoming PTOs, we anticipate the review process may extend into Q3. The current 'platform-scheduled' info in the user story remains accurate, though we should be able to land this ahead of that timeline. Hope it helps. :)
Assignee | ||
Comment 5•3 months ago
|
||
Updated•3 months ago
|
Comment 7•3 months ago
|
||
bugherder |
Assignee | ||
Comment 8•3 months ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]:
The developer facing API, selection.getComposedRanges is now shipped
[Affects Firefox for Android]:
Yes
[Suggested wording]:
selection.getComposedRanges is now shipped
[Links (documentation, blog post, etc)]:
https://developer.mozilla.org/en-US/docs/Web/API/Selection/getComposedRanges
Comment 9•3 months ago
|
||
Added to the 142 nightly release notes
The Selection.getComposedRanges() API is now available, allowing developers to accurately get selected text ranges across shadow DOM boundaries.
Updated•3 months ago
|
Comment 10•3 months ago
•
|
||
FF142 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/40475
@Sean When we looked at this initially the scope of the changes was:
Selection.getComposedRanges()
method added allowing getting range across shadow DOM ranges. ALSO returns multiple ranges, though not something indicated by spec.- The
Selection
methodssetBaseAndExtent()
,collapse()
,.extend()
, have also been modified to accept nodes inside a shadow root.
Did anything else happen that needs to be documented or recorded in this?
Updated•3 months ago
|
Assignee | ||
Comment 11•3 months ago
|
||
Selection.getComposedRanges() method added allowing getting range across shadow DOM ranges. ALSO returns multiple ranges, though not something indicated by spec.
Just to nitpick that it should be getting static ranges that across shadow boundaries, if the correct shadow roots are given
, but yeah it's mostly correct :)
The Selection methods setBaseAndExtent(), collapse(), .extend(), have also been modified to accept nodes inside a shadow root.
Yeah, this is correct. I just checked the corresponding MDN pages, it currently says only Firefox Nightly
has these, but I think Webkit/Blink support them as well. (We better should do some testing to double check).
Also, specifically for collapse
, I think it should be able to collapse to a shadow dom node even without shadow dom selection, though I don't think it matters much given we are shipping this.
I can't think of anything else.
Comment 12•3 months ago
|
||
Thanks Sean. I understand the nitpick, but I don't think this clarification is required in the release note - which is essentially to highlight the existence of the feature, not its detailed use. Is there a particular wpt test that we can use to verify support in Chrome of this feature (note, the underlying compat data says 142 now for these methods - it is shown on MDN as preview because that is the current preview release).
Assignee | ||
Comment 13•3 months ago
|
||
so this one uses setBaseAndExtent
and it's passing in Chrome. This one tests collapse
and extend
. So I think we should do the same for Chrome/Safari.
Updated•1 month ago
|
Description
•