Skip to content

Remove single range restriction for selection interface apis #358

@sambandaru

Description

@sambandaru

Proposal

Remove the single-range restriction from the Selection API. Allow addRange() to accumulate disjoint ranges, rangeCount to return values > 1, and getRangeAt(index) to accept index > 0. The API was designed for multiple ranges; this reverses the 2011 restriction. Chromium is pursuing implementation.

Explainer: MicrosoftEdge/MSEdgeExplainers — Multi-Range Selection (PR)
Canonical issue: #41 (open since Jan 2015)
Chromium feature request: issues.chromium.org/504686717
Webkit open bug: webkit.org/b/186465

Spec changes required

  1. Section 2 — Allow a collection of ranges instead of "a single range"
  2. Section 3, addRange() Step 2 — Remove the abort; define accumulation/merge semantics
  3. Section 3, rangeCount — Allow values > 1
  4. Section 3, getRangeAt() — Allow index > 0

Prior vendor interest

Request

Requesting discussion in the Web Editing WG to build consensus on removing this restriction.

Metadata

Metadata

Assignees

Labels

Agenda+Queue this item for discussion at the next WG meeting

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions