Contact emails
Explainer
Specification
None
Summary
Implements retrieval of selection bounds within <textarea> and <input> elements of type text, email, number, password, search, tel, or url. The bounding rectangle is the caret rectangle if the selection is collapsed. If there is no selection in the <textarea>
or <input>, it will return an empty rectangle.
Blink component
Motivation
While getBoundingClientRect() can already be used to obtain selection bounds in content-editable <div> elements, no equivalent exists for standard form input elements. As a result, developers must resort to workarounds involving <div> elements to simulate input
behavior, which is both inefficient and unnecessarily complex. This is due to the fact that, unlike <textarea> and <input>, the <div> element isn’t designed for user input—it lacks built-in accessibility, native form behavior, and requires additional JavaScript
to simulate basic input functionality. By contrast, getSelectionBoundingClientRect() provides a simpler and more intuitive solution for web developers. It allows them to work directly with standard form elements without needing to reimplement input behavior
or manage accessibility concerns manually. This makes it a more robust and developer-friendly alternative for handling selection bounds in web applications.
Initial public proposal
TAG review
None
TAG review status
Pending
Risks
Interoperability and Compatibility
WebView application risks
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
Debuggability
No specific DevTools changes required.
Not currently tested, but tests will be added as part of feature development.
Flag name on about://flags
None
Finch feature name
Pending
Non-finch justification
A flag will be added as part of feature development.
Requires code in //chrome?
False
Tracking bug
Estimated milestones
No milestones specified
Link to entry on the Chrome Platform Status