-
Notifications
You must be signed in to change notification settings - Fork 199
New Selection API features #1888
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
178e273
New Selection API features
captainbrosset a8c849b
Merge branch 'main' into ranges
captainbrosset de00248
Update features/selection-api.yml
captainbrosset 75ba3e5
Merge branch 'main' of github.com:web-platform-dx/web-features into r…
captainbrosset 44ee023
Merge branch 'ranges' of github.com:web-platform-dx/web-features into…
captainbrosset 5023dfa
Rename composedRanges API
captainbrosset File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| name: Selection composed ranges | ||
| description: The `window.getSelection().getComposedRanges()` method returns ranges that represent the current user selection, even if the selection spans across shadow tree boundaries. | ||
| spec: https://w3c.github.io/selection-api/#dom-selection-getcomposedranges | ||
| group: | ||
| - selection | ||
| - web-components | ||
| compat_features: | ||
| - api.Selection.getComposedRanges |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Generated from: composed-ranges.yml | ||
| # Do not edit this file by hand. Edit the source file instead! | ||
|
|
||
| status: | ||
| baseline: false | ||
| support: | ||
| safari: "17" | ||
| safari_ios: "17" | ||
| compat_features: | ||
| - api.Selection.getComposedRanges |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Selection | ||
| description: The Selection API controls and modifies user text selections within the page. | ||
| spec: https://w3c.github.io/selection-api/ | ||
| caniuse: selection-api | ||
| group: selection | ||
| status: | ||
| compute_from: | ||
| # This makes it roughly match caniuse data. | ||
| - api.Window.getSelection | ||
| - api.Document.selectionchange_event | ||
| compat_features: | ||
| - api.Document.getSelection | ||
| - api.Document.selectionchange_event | ||
| - api.Selection | ||
| - api.Selection.addRange | ||
| - api.Selection.anchorNode | ||
| - api.Selection.anchorOffset | ||
| - api.Selection.collapse | ||
| - api.Selection.collapseToEnd | ||
| - api.Selection.collapseToStart | ||
| - api.Selection.containsNode | ||
| - api.Selection.deleteFromDocument | ||
| - api.Selection.empty | ||
| - api.Selection.extend | ||
| - api.Selection.focusNode | ||
| - api.Selection.focusOffset | ||
| - api.Selection.getRangeAt | ||
| - api.Selection.isCollapsed | ||
| - api.Selection.rangeCount | ||
| - api.Selection.removeAllRanges | ||
| - api.Selection.selectAllChildren | ||
| - api.Selection.setBaseAndExtent | ||
| - api.Selection.setPosition | ||
| - api.Selection.toString | ||
| - api.Selection.type | ||
| - api.Window.getSelection | ||
|
|
||
| # The selectionchange events on <input> and <textarea> are not really needed. | ||
| # The event is fired on document too and this is what developers use. | ||
| - api.HTMLInputElement.selectionchange_event | ||
| - api.HTMLTextAreaElement.selectionchange_event | ||
|
|
||
| # The node.selectstart event is not supported on Safari iOS. | ||
| # Unclear if developers need it because selectionchange is supported. | ||
| - api.Node.selectstart_event | ||
|
|
||
| # Direction is supported only on Firefox and Safari. | ||
| # Maybe split into a separate feature. | ||
| - api.Selection.direction | ||
|
|
||
| # Modify seems like a nice-to-have, you can do the same thing with other methods. | ||
| # Edge only added support for this in 79, even though the rest of the API was | ||
| # supported much earlier. And Firefox doesn't support all modify commands. | ||
| - api.Selection.modify | ||
|
|
||
| # removeRange is baseline low because it was only added in Safari 17. | ||
| # Maybe split into a separate feature. | ||
| - api.Selection.removeRange |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| name: text-decoration in ::selection | ||
| description: The `text-decoration` CSS property in a `::selection` rule sets the underline and other text decoration styles on the text a user has highlighted. | ||
| spec: https://drafts.csswg.org/css-pseudo-4/#highlight-styling | ||
| group: selectors | ||
| group: | ||
| - selectors | ||
| - selection | ||
| compat_features: | ||
| - css.selectors.selection.text-decoration |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| name: Selection |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't name this just selection.yml, because that's already taken by the ::selection pseudo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matches both the spec title and the Caniuse key, so seems fine to me to keep
APIhere, and there's precedent for doing so.