From 178e2731b184cc444a17f68bae7471c174669a81 Mon Sep 17 00:00:00 2001 From: Patrick Brosset Date: Wed, 2 Oct 2024 11:38:19 +0200 Subject: [PATCH 1/3] New Selection API features --- features/draft/spec/selection-api.yml | 38 ------------ features/selection-api-shadow.yml | 6 ++ features/selection-api-shadow.yml.dist | 10 ++++ features/selection-api.yml | 58 +++++++++++++++++++ .../{draft/spec => }/selection-api.yml.dist | 21 ++++--- features/selection.yml | 4 +- features/text-decoration-selection.yml | 4 +- groups/selection.yml | 1 + 8 files changed, 93 insertions(+), 49 deletions(-) delete mode 100644 features/draft/spec/selection-api.yml create mode 100644 features/selection-api-shadow.yml create mode 100644 features/selection-api-shadow.yml.dist create mode 100644 features/selection-api.yml rename features/{draft/spec => }/selection-api.yml.dist (94%) create mode 100644 groups/selection.yml diff --git a/features/draft/spec/selection-api.yml b/features/draft/spec/selection-api.yml deleted file mode 100644 index 49bbc4a8699..00000000000 --- a/features/draft/spec/selection-api.yml +++ /dev/null @@ -1,38 +0,0 @@ -draft_date: 2024-09-09 -name: Selection API -description: TODO -spec: https://w3c.github.io/selection-api/ -compat_features: - - api.Document - - api.Document.getSelection - - api.Document.selectionchange_event - - api.HTMLInputElement.selectionchange_event - - api.HTMLTextAreaElement.selectionchange_event - - api.Node.selectstart_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.direction - - api.Selection.empty - - api.Selection.extend - - api.Selection.focusNode - - api.Selection.focusOffset - - api.Selection.getComposedRanges - - api.Selection.getRangeAt - - api.Selection.isCollapsed - - api.Selection.modify - - api.Selection.rangeCount - - api.Selection.removeAllRanges - - api.Selection.removeRange - - api.Selection.selectAllChildren - - api.Selection.setBaseAndExtent - - api.Selection.setPosition - - api.Selection.toString - - api.Selection.type - - api.Window.getSelection diff --git a/features/selection-api-shadow.yml b/features/selection-api-shadow.yml new file mode 100644 index 00000000000..5af1c6860b6 --- /dev/null +++ b/features/selection-api-shadow.yml @@ -0,0 +1,6 @@ +name: Selections across shadow tree boundaries +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 +compat_features: + - api.Selection.getComposedRanges diff --git a/features/selection-api-shadow.yml.dist b/features/selection-api-shadow.yml.dist new file mode 100644 index 00000000000..5815ab023a1 --- /dev/null +++ b/features/selection-api-shadow.yml.dist @@ -0,0 +1,10 @@ +# Generated from: selection-api-shadow.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 diff --git a/features/selection-api.yml b/features/selection-api.yml new file mode 100644 index 00000000000..0ca9f360884 --- /dev/null +++ b/features/selection-api.yml @@ -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 and