Re: [csswg-drafts] [css-highlight-api] Approaches for dispatching highlight pointer events (#7513)

The CSS Working Group just discussed `Approaches for dispatching highlight pointer events`, and agreed to the following:

* `RESOLVED: Add the highlightFromPoint() API to CSS.highlights or DocumentOrShadowRoot`

<details><summary>The full IRC log of that discussion</summary>
&lt;heycam> Topic: Approaches for dispatching highlight pointer events<br>
&lt;heycam> dandclark: problem we're trying to solve is making custom highlights interactives<br>
&lt;heycam> ... for scenarios like custom spell check, annotation popups over words<br>
&lt;heycam> ... a few months ago I came to the WG with a proposal for adding eventing for highlights<br>
&lt;heycam> ... when tehre's a pointer event, a highlight, we get a first crack at it<br>
&lt;heycam> ... dispatch events at highlights in priority order<br>
&lt;heycam> ... if none preventDefault() it, we give it to the normal DOM element<br>
&lt;florian> github: https://github.com/w3c/csswg-drafts/issues/7513<br>
&lt;heycam> ... goal here would be to allow non-coordinating highlight libraries to do reasonable things<br>
&lt;Rossen_> q?<br>
&lt;heycam> ... if you have say a spell check library, and a annotation library running, stopping propagation of an event would avoid two popups at once<br>
&lt;heycam> ... normal event propagation would allow this coordination without the 2 librariers knowing about each other<br>
&lt;heycam> ... however this is somewhat complicated, there was a simpler competing proposal<br>
&lt;heycam> ... providing "highlightsFromPoint", put a click event on the body, when there's a click pass the coordinates into this function<br>
&lt;heycam> ... some discussion for coming up with schemes where the events could then be dispatched in a manual way to highlights<br>
&lt;heycam> ... discussed in the issue, not a great way for non-coordinated libraries to coordinate an event loop<br>
&lt;heycam> ... that said, I think it's maybe worth pursuing this as a MVP API<br>
&lt;heycam> ... seems like a useful addition to the platform<br>
&lt;heycam> ... if in practice there turns out to be issues with non-coordinating highlight libraries working together, we then go back to pursue highlighting events in addition to that<br>
&lt;heycam> ... CSS.highlights.highlightFromPoint()<br>
&lt;heycam> ... some issues with shadow DOM<br>
&lt;TabAtkins> Seems useful to me. The coordination issue still needs to be addressed, but I don't think that blocks this as a useful ability. I like the API discussed.<br>
&lt;heycam> ... first let's get some feedback from the group. is this worth it as an initial step?<br>
&lt;Rossen_> q?<br>
&lt;flackr> +1 MVP of highlights from points seems useful even if we add events<br>
&lt;heycam> TabAtkins: seems useful to me. agree the coordination issue needs to be resolved, but that shouldn't block this useful primitive<br>
&lt;heycam> ... if this blocks general abilities, I still think it's worthwhile<br>
&lt;heycam> ... I like the API shape in the proposal<br>
&lt;TabAtkins> s/this blocks/this unblocks/<br>
&lt;heycam> olli: I agree this is probably good enough for now<br>
&lt;heycam> ... might need to think about shadow DOM for now, but we can tweak the proposal for that<br>
&lt;Rossen_> q?<br>
&lt;heycam> s/olli/smaug/<br>
&lt;heycam> dandclark: seem to have agreement on adding this<br>
&lt;heycam> ... would be good to dig into the shadow DOM issue<br>
&lt;heycam> ... does it go on DocumentOrShadowRoot?<br>
&lt;heycam> Rossen: let's resolve on adding the API, if we still have time at the end of this slot, we can come back to this issue<br>
&lt;dbaron> (My initial reaction is that DocumentOrShadowRoot is a good location because then it lives next to elementFromPoint, which it is similar to.)<br>
&lt;heycam> RESOLVED: Add the highlightFromPoint() API to CSS.highlights or DocumentOrShadowRoot<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7513#issuecomment-1248320696 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 15 September 2022 16:17:41 UTC