Intent to Prototype: highlightsFromPoint API

199 views
Skip to first unread message

Stephanie Zhang

unread,
Sep 13, 2024, 2:26:10 AM (7 days ago) Sep 13
to blin...@chromium.org
Contact emails
Explainer
Specification
Spec is in progress and being written.

Summary
The highlightsFromPoint API enables developers to interact with custom highlights by detecting which highlights exist at a specific point within a document. This interactivity is valuable for complex web features where multiple highlights may overlap or exist within shadow DOM. By providing precise point-based highlight detection, the API empowers developers to manage dynamic interactions with custom highlights more effectively, such as responding to user clicks or hover events on highlighted regions to trigger custom tooltips, context menus, or other interactive features.


Blink component
Motivation
Highlights visually differentiate specific ranges within a document, such as comments, search results, or spelling errors. As web features grow more complex, managing custom highlights becomes increasingly challenging, particularly when dealing with overlapping highlights or content within the shadow DOM. Developers need a way to interact with individual highlights at precise points within the document, enabling more efficient control of dynamic and interactive content with custom highlights. This allows for features like displaying custom tooltips, context menus, or other interactive elements based on accurate point-based highlight detection.


Initial public proposal
TAG review
To be filed once spec is written

TAG review status
Pending

Risks


Interoperability and Compatibility
The 'highlightsFromPoint' API is a new feature so there isn’t a compatibility risk. The interoperability risk is limited to the usual risk of limited adoption and/or inconsistent browser support for a new feature.


Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1068)

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/394)

Web developers: No signals

Other signals:

Ergonomics
None


Activation
None


Security
None


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
None


Is this feature fully tested by web-platform-tests?
Tests are in progress.


Flag name on chrome://flags
None

Finch feature name
HighlightsFromPoint

Requires code in //chrome?
False

Tracking bug
Estimated milestones
No milestones specified


Link to entry on the Chrome Platform Status
This intent message was generated by Chrome Platform Status.
 
 
Reply all
Reply to author
Forward
0 new messages