Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions features/composed-ranges.yml
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
10 changes: 10 additions & 0 deletions features/composed-ranges.yml.dist
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
38 changes: 0 additions & 38 deletions features/draft/spec/selection-api.yml

This file was deleted.

58 changes: 58 additions & 0 deletions features/selection-api.yml
Copy link
Contributor Author

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.

Copy link
Contributor

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 API here, and there's precedent for doing so.

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
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support: {}
baseline: high
baseline_low_date: 2017-03-07
baseline_high_date: 2019-09-07
support:
chrome: "11"
chrome_android: "18"
edge: "12"
firefox: "52"
firefox_android: "52"
safari: "5.1"
safari_ios: "5"
compat_features:
# baseline: high
# baseline_low_date: 2015-07-29
Expand All @@ -16,7 +25,6 @@ compat_features:
# firefox_android: "4"
# safari: "1"
# safari_ios: "1"
- api.Document
- api.Window.getSelection

# baseline: high
Expand Down Expand Up @@ -86,6 +94,7 @@ compat_features:
# safari_ios: "3.2"
- api.Document.getSelection

# ⬇️ Same status as overall feature ⬇️
# baseline: high
# baseline_low_date: 2017-03-07
# baseline_high_date: 2019-09-07
Expand Down Expand Up @@ -194,12 +203,6 @@ compat_features:
# safari_ios: "17"
- api.Selection.direction

# baseline: false
# support:
# safari: "17"
# safari_ios: "17"
- api.Selection.getComposedRanges

# baseline: false
# support:
# firefox: "92"
Expand Down
4 changes: 3 additions & 1 deletion features/selection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: ::selection
description: The `::selection` CSS pseudo-element selects text a user has highlighted.
spec: https://drafts.csswg.org/css-pseudo-4/#selectordef-selection
caniuse: css-selection
group: selectors
group:
- selectors
- selection
compat_features:
- css.selectors.selection
4 changes: 3 additions & 1 deletion features/text-decoration-selection.yml
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
1 change: 1 addition & 0 deletions groups/selection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: Selection