Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection updates for parallel APIs ff125 #23013

Merged
merged 5 commits into from
May 28, 2024

Conversation

hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented May 6, 2024

FF126 adds Selection.getComposedRanges() in nightly, but it also adds some updates to existing APIs:

  • Selection.getComposedRanges()
    • can return multiple ranges, but only in firefox. Spec expects returning 1 range at the moment.
    • Added an URL to docs (still being written)
  • Selection.setBaseAndExtent() - this will now accept anchorNode and focusNode arguments that reside in different shadow trees, which will set the selection accordingly.
  • Selection.collapse() - can now accept a node in any tree, and will collapse the range to that Node.
  • extend() - This should work as-expected, even if the new focusNode is in a different shadow tree.

There are other features coming but that is what is in now (according to https://bugzilla.mozilla.org/show_bug.cgi?id=1867058#c31)

FYI another thing that I don't know how to capture in BCD. I don' think I will:

User selection via mouse, keyboard, etc. - The selection generated by this activity should be allowed to start and end anywhere in the document, including inside any open or closed shadow trees. The behavior should be equivalent to calls to setBaseAndExtent(), modulo canonicalization behavior.

Related work can be tracked in mdn/content#33180

@github-actions github-actions bot added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label May 6, 2024
@hamishwillee hamishwillee changed the title Selection updates ff125 Selection updates for parallel APIs ff125 May 6, 2024
api/Selection.json Outdated Show resolved Hide resolved
api/Selection.json Outdated Show resolved Hide resolved
api/Selection.json Outdated Show resolved Hide resolved
api/Selection.json Outdated Show resolved Hide resolved
},
"status": {
"experimental": true,
"standard_track": false,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, spec only requires returning one range.

@hamishwillee hamishwillee marked this pull request as ready for review May 6, 2024 23:15
@dipikabh
Copy link
Contributor

Hi @queengooborg, would it be possible for you to review this PR?

@queengooborg
Copy link
Collaborator

Hi @dipikabh, this is on my review queue already. No need to ping me after marking me for review. :)

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hamishwillee, looks reasonable to me. 👍

@Elchi3 Elchi3 merged commit 7962ae8 into mdn:main May 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants