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
- Section 2 — Allow a collection of ranges instead of "a single range"
- Section 3,
addRange() Step 2 — Remove the abort; define accumulation/merge semantics
- Section 3,
rangeCount — Allow values > 1
- Section 3,
getRangeAt() — Allow index > 0
Prior vendor interest
Request
Requesting discussion in the Web Editing WG to build consensus on removing this restriction.
Proposal
Remove the single-range restriction from the Selection API. Allow
addRange()to accumulate disjoint ranges,rangeCountto return values > 1, andgetRangeAt(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
addRange()Step 2 — Remove the abort; define accumulation/merge semanticsrangeCount— Allow values > 1getRangeAt()— Allow index > 0Prior vendor interest
Request
Requesting discussion in the Web Editing WG to build consensus on removing this restriction.