-
Notifications
You must be signed in to change notification settings - Fork 3.2k
OpaqueRange Interface #11478
Copy link
Copy link
Open
Labels
addition/proposalNew features or enhancementsNew features or enhancementsagenda+To be discussed at a triage meetingTo be discussed at a triage meetingstage: 2IterationIteration
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementsagenda+To be discussed at a triage meetingTo be discussed at a triage meetingstage: 2IterationIteration
Type
Fields
Give feedbackNo fields configured for issues without a type.
What problem are you trying to solve?
The current
Rangeinterface methods do not support retrieving or creating Range objects that represent thevalue(rather than the element itself) of<textarea>and<input>elements.What solutions exist today?
Currently, if web authors wish to use range-based operations with
<textarea>or<input>elements, they must find workarounds, which often involve cloning these elements and their styles into<div>s, which is both difficult to maintain and may impact the web application's performance.How would you solve it?
The proposed interface provides a way of creating a
OpaqueRange—a specialized type ofRangeobject—that represents part or all of thevalueof<textarea>and<input>elements, enabling range-based operations such as getting bounding rects and setting custom highlights, while limiting access to the standard Range API to enforce encapsulation.Anything else?
This proposal is only scoped to textarea/input element. For other elements, the regular Range interface can already be used for range-based operations.
Link to the explainer for this proposal: OpaqueRange