Skip to content

Composed Selection (Selection APIs for Shadow DOM) #216

@hunterloftis

Description

@hunterloftis

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:

Specification

Tests

I can't find tests for the latest API definition; should write some --

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions