-
Notifications
You must be signed in to change notification settings - Fork 33
Composed Selection (Selection APIs for Shadow DOM) #216
Copy link
Copy link
Closed
Labels
focus-area-proposalFocus Area ProposalFocus Area Proposal
Description
Description
The Shadow Selection API enables both querying and setting the document-wide selection across shadow boundaries. Currently, all browsers demonstrate divergent behavior when using the existing getSelection() API on a composed tree.
The API includes a single new API (getComposedSelection()) and backwards-compatible changes to a number of APIs (like setBaseAndExtent().
There is consensus on the shape of the API, but no spec or implementations.
Rationale
Selection does not work across or within shadow roots. This makes fully-featured rich-text editors impossible to implement with web components. Some of the web's most popular editors have issues that are blocked on this functionality:
- [Shadow DOM] Allow selection from target encapsulated by a shadow root tinymce/tinymce#4737 (comment)
- Support text selection when editor is in a shadow root ckeditor/ckeditor5#7846 (comment)
- Add shadow dom support slab/quill#1805
Specification
- https://github.com/mfreed7/shadow-dom-selection/blob/main/README.md
- Selection APIs for Shadow DOM WICG/webcomponents#79
Tests
I can't find tests for the latest API definition; should write some --
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
focus-area-proposalFocus Area ProposalFocus Area Proposal