Closed Bug 1903870 Opened 1 year ago Closed 3 months ago

Ship shadow dom selection

Categories

(Core :: DOM: Core & HTML, task, P2)

task

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
relnote-firefox --- 142+
firefox142 --- fixed

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.

Blocks: 1903871
Keywords: dev-doc-needed
Blocks: 1925931
User Story: (updated)

Sean, what's blocking this from shipping?

Flags: needinfo?(sefeng)
Depends on: 1965846
Depends on: 1965847
Depends on: 1932150
Flags: needinfo?(sefeng)

I added the two remaining bugs for this, they are relatively simple.

User Story: (updated)
Priority: P3 → P2
Blocks: 1963586
No longer blocks: 1963586
See Also: → 1963586

Hsin-Yi - is there an schedule for the remaining bugs blocking this? (It blocks a relatively large siteline webcompat bug 1925931). Thanks!

Flags: needinfo?(htsai)

(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. :)

Flags: needinfo?(htsai)
Depends on: 1972095
Depends on: 1972096
No longer depends on: 1972096
See Also: → 1972096
Assignee: nobody → sefeng
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch

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

relnote-firefox: --- → ?

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.

User Story: (updated)

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 methods setBaseAndExtent(), 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?

Flags: needinfo?(sean)
QA Whiteboard: [qa-triage-done-c143/b142]

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.

Flags: needinfo?(sean)

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).

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: