Intent to Prototype: Custom highlight API pointer events

121 weergaven
Naar het eerste ongelezen bericht

Luis Sanchez Padilla

ongelezen,
15 jul 2022, 18:48:3115-07-2022
aan blink-dev, dan...@microsoft.com, Luis Sanchez Padilla
Contact emails

dan...@microsoft.comlusa...@microsoft.com

Explainer

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/highlight/events-explainer.md

Specification

Spec text pending. IDL is in the explainer here, subject to change:

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/highlight/events-explainer.md#proposal

Summary

Adds pointer event handling to the Custom Highlight API. The Custom Highlight API (see https://chromestatus.com/feature/5436441440026624) provides a way for web developers to style the text of arbitrary ranges. Adding pointer event handling to these highlighted ranges will make them interactive, unlocking features such as a custom spellcheck that shows suggestions when a highlighted spelling error is hovered or clicked.

Blink component

Blink>CSS

Motivation

The Custom Highlight API (see https://chromestatus.com/feature/5436441440026624) provides a way for web developers to style the text of arbitrary ranges. Adding pointer event handling to these highlighted ranges will make them interactive, unlocking features such as a custom spellcheck that shows suggestions when a highlighted spelling error is hovered or clicked.

Initial public proposal

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/highlight/events-explainer.md
https://github.com/w3c/csswg-drafts/issues/7447

TAG review

Pending

TAG review status

Pending

Risks

There should not be a compat risk with the existing Highlight API, since this is purely additive. If no event listeners are added to Highlights, they will continue working as they do now.

We do have to be careful about changing PointerEvent behavior; for example, PointerEvents currently only have Nodes as their target, so allowing Highlights to be PointerEvent targets could break the expectations of current code. We will need to be mindful of these risks while progressing the design of the feature.

Developers can feature-test by checking for the existence of window.HighlightPointerEvent.

Interoperability and Compatibility

Gecko: No signal
WebKit: No signal
Web developers: No signals
Other signals:

WebView application risks

None

Debuggablity

We’ll ensure that HighlightPointerEvents are exposed in DevTools’ Event Listeners pane.

Is this feature fully tested by web-platform-tests?

No, we'll add WPTs as we prototype the feature and will keep them updated as the spec develops.

Flag name

HighlightPointerEvents

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1344319

Estimated milestones

No milestones specified

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5080976544235520

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten