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

The CSS Working Group just discussed `dispatching highlight events`.

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: dispatching highlight events<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/7513<br>
&lt;TabAtkins> dandclark: so pointer events with highlights, this is about making highlight pseudos interactive like for a spellchecker<br>
&lt;TabAtkins> dandclark: first q is how do we dispatch these events, what's the event order<br>
&lt;TabAtkins> dandclark: first i assume the highlight object is the right thing to receive the event, rather than the individual ranges<br>
&lt;TabAtkins> dandclark: If i have a bunch of ranges on a single highlight, i probably want to do the same thing for each<br>
&lt;TabAtkins> dandclark: seems silly to have to set an event listener on each range, especially as the highlight moves<br>
&lt;TabAtkins> dandclark: and when considering dispatches, need to consider there can be multiple types of highlights, and possibly overlapping<br>
&lt;TabAtkins> dandclark: like a find-on-page that emphasizes and scrolls, and also a spellcheck that underlines misspelled words and shows spelling suggestions<br>
&lt;TabAtkins> dandclark: might want one of those to eat the click, so spelling error can win over find-on-page<br>
&lt;TabAtkins> dandclark: so i can talk about a fe wapproaches<br>
&lt;TabAtkins> dandclark: in the issue, version A is each highlight gets its own event<br>
&lt;TabAtkins> dandclark: in descending priority order<br>
&lt;TabAtkins> dandclark: they can be cancelable, so the default is to advance to the next highlight, and you can preventDefault()<br>
&lt;TabAtkins> dandclark: suspicious to fire an arbitrary number of events for a single action tho<br>
&lt;TabAtkins> dandclark: approach B is a single event for the top priority highlight, define event path so it goes thru other highlights, then bubbles to dom tree<br>
&lt;TabAtkins> dandclark: this seems like pretty normal appraoch. but there's a web compat problem<br>
&lt;emilio> q+<br>
&lt;TabAtkins> dandclark: currently pointer events can only ever be an element<br>
&lt;TabAtkins> dandclark: but now suddenly they can have non-element targets<br>
&lt;TabAtkins> dandclark: so might break assumptions<br>
&lt;TabAtkins> dandclark: the Edge explainer suggests lying about the event target to get around this<br>
&lt;TabAtkins> dandclark: thinking abou tit more, think it's not the right approach<br>
&lt;TabAtkins> dandclark: Approach C is a combo. we dispatch two events, one for highlights, one for dom tree. highlight one propagates thru overlapping highlights. if it's not preventDefault'd by the end, we fire a new one on the dom tree<br>
&lt;TabAtkins> dandclark: that dual-event appraoch is where I lean now<br>
&lt;flackr> q+<br>
&lt;TabAtkins> q+<br>
&lt;astearns> ack emilio<br>
&lt;astearns> q+<br>
&lt;TabAtkins> emilio: rather than messing witht he dom events and retargeting, can we add an api to highlight that tells "is point X intersecting the highlight?"? seems like that would let you do what you want with regular dom events<br>
&lt;TabAtkins> emilio: you handle the pointer event and ask the highlights if the point overlaps, and just deal with normal dom event<br>
&lt;TabAtkins> emilio: Seems simpler but still gives all the use-cases<br>
&lt;TabAtkins> emilio: If you ahve two objects, handling pointer event on one or the other...<br>
&lt;TabAtkins> emilio: the normal element pointer event should still work even if you click on the highlight<br>
&lt;TabAtkins> emilio: seems simpler and less risky, and doesn't introduce new event model<br>
&lt;TabAtkins> emilio: and will work with touch events, etc<br>
&lt;TabAtkins> emilio: curious if it's been considered?<br>
&lt;dandclark> q+<br>
&lt;TabAtkins> TabAtkins: so assumption is you'd iterate thru all your highlights and check?<br>
&lt;TabAtkins> emilio: Yes. and they can check if it's been defaulted, you can deal with the order yourself, etc.<br>
&lt;TabAtkins> dandclark: this seems useful for- given i have a click with an offset, show me all the highlights under this location? or go thru each highlight in the registry and check?<br>
&lt;emilio> boolean intersects(long clientX, long clientY)<br>
&lt;bkardell_> emilio: that is on highlight?<br>
&lt;TabAtkins> dandclark: Can def see if there's a pointer even thandler on the body, and i get an event, could ask platform for all the highlights at this point<br>
&lt;TabAtkins> emilio: was thinking about method on the highlight object<br>
&lt;TabAtkins> emilio: so you iterate over the highlights i nthe order you want<br>
&lt;TabAtkins> emilio: but that should provide all the flexibility you'll ever need<br>
&lt;TabAtkins> emilio: If we want something more convenient, could put one on the highlight registry that gives back all of them<br>
&lt;TabAtkins> emilio: would just be sugar over a for loop<br>
&lt;TabAtkins> emilio: so could use if you want a central place to handle all the highlights<br>
&lt;TabAtkins> emilio: but might also want to deal with each highlight separately<br>
&lt;astearns> ack flackr<br>
&lt;TabAtkins> flackr: My point was partially overlapped with emilio, concerned about a special event befor ethe dom event<br>
&lt;TabAtkins> flackr: could consider the highlight to be the normal action, so if the normal event wasn't defaulted you dispatch to highlight<br>
&lt;TabAtkins> flackr: longer term, we want to support css pseudo targets, wondering if that helps so we can just target those<br>
&lt;TabAtkins> dandclark: the highlight pseudo is a pseudo object, it's a little special...<br>
&lt;TabAtkins> flackr: i think my main concern is whether those should be given the event first<br>
&lt;TabAtkins> flackr: I think visually the highlight is behind the text, so from dev pov the element should get first crack, and pseudo gets opportunity after<br>
&lt;astearns> ack dbaron<br>
&lt;astearns> ack astearns<br>
&lt;TabAtkins> q-<br>
&lt;TabAtkins> dbaron: i think it's worth trying to get event.stopPropagation vs preventDefault to behave as closely as possible to normal<br>
&lt;TabAtkins> dbaron: I think what dan was originally defining was to make pD act like SP<br>
&lt;TabAtkins> dbaron: Hope we can do something better even if the dom event spec needs to expose some extra concepts<br>
&lt;TabAtkins> dbaron: thoughts on emilio's proposal<br>
&lt;TabAtkins> dbaron: first is i'm a little concerned a bout an appraoch tha tforces you to add event listeners to the doc, for cases where impls want to make optimizations for passive listeners<br>
&lt;TabAtkins> dbaron: if it's an event type where registering a non-passive listener, and you need to register non-passive for the highlight, you have to take the perf penalty document-wide<br>
&lt;TabAtkins> dbaron: that seems undesirable<br>
&lt;emilio> q+<br>
&lt;TabAtkins> dbaron: so i think that's a reason you might want to have EL registration be on more specific targets<br>
&lt;TabAtkins> dandclark: I like the simplicity of emilio's idea.<br>
&lt;TabAtkins> dandclark: if we can find a way around the perf hit<br>
&lt;astearns> ack dandclark<br>
&lt;TabAtkins> emilio: the initial proposal was about clicks<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: don't think we can get much opt about passive vs non-passive event listeners<br>
&lt;TabAtkins> emilio: don't see how having highlights doesn't prevent you from losing optimizations<br>
&lt;TabAtkins> dbaron: what you said about the way to use the proposal is put an El on the document, and look up the point<br>
&lt;TabAtkins> dbaron: And that way of using it can be problematic<br>
&lt;TabAtkins> emilio: right, if you care about scroll and things that benefit from passive<br>
&lt;TabAtkins> emilio: But API doesn't let you use it for other event types<br>
&lt;TabAtkins> dbaron: I think when it's like "this is only for clicks *right now*", unsure we want to design around that<br>
&lt;TabAtkins> emilio: So API right now takes an x/y<br>
&lt;TabAtkins> emilio: Have clear text for mouse events to resolve that<br>
&lt;florian> q?<br>
&lt;TabAtkins> emilio: could let the method take an event object instead, so we can limit it to certain event types<br>
&lt;astearns> ack dbaron<br>
&lt;Zakim> dbaron, you wanted to comment on what inputs emilio's API needs<br>
&lt;TabAtkins> dbaron: ah yeah other point id' forgot. i think taking x/y doesn't handle [missed]<br>
&lt;TabAtkins> dbaron: you might click a piece of text with highlights that obscures another piece with highlights<br>
&lt;TabAtkins> dbaron: you're probably interested in the top element's highlihts, not the obscured one<br>
&lt;flackr> qq+<br>
&lt;TabAtkins> emilio: could define the api similar to getelementfrompoint where you do account for hit-testing<br>
&lt;TabAtkins> emilio: could define to only care about rects, like union the ranges<br>
&lt;florian> q+<br>
&lt;TabAtkins> emilio: or like elementFromPoint which cares about hit-testing and p-e:none/etc<br>
&lt;TabAtkins> emilio: Seems you could get that with just an x/y if you define it to do hit-testing<br>
&lt;TabAtkins> dbaron: yeah that sounds like it works<br>
&lt;florian> q-<br>
&lt;TabAtkins> emilio: So define it in terms of elementsFromPoint<br>
&lt;TabAtkins> emilio: If any of the elements intersect the highlight... something like that<br>
&lt;TabAtkins> emilio: specific semantics for intersecting highlights could be left to...<br>
&lt;astearns> q+<br>
&lt;TabAtkins> emilio: if both intersect the consumer can choose<br>
&lt;astearns> ack flackr<br>
&lt;Zakim> flackr, you wanted to react to dbaron<br>
&lt;TabAtkins> flackr: I think x/y works if you can get highlights on the targeted element<br>
&lt;TabAtkins> flackr: that'll account for hit-testing<br>
&lt;TabAtkins> flackr: but this is def going to be a perf issue, even if limited to mouse events<br>
&lt;TabAtkins> flackr: people might want to drag highlights, so they'll have pointerstart, and that means we have to delay scrolling<br>
&lt;TabAtkins> flackr: but if we fire on the highlight we can recognize it won't stop scrolling<br>
&lt;TabAtkins> emilio: but that would penalize other scenarios<br>
&lt;TabAtkins> emilio: not sure what the best way to do it is<br>
&lt;TabAtkins> emilio: needs real thought especially for pointerdown<br>
&lt;florian> q+<br>
&lt;TabAtkins> emilio: [missed due to truck outside]<br>
&lt;TabAtkins> emilio: there are use-cases for pointerdown<br>
&lt;TabAtkins> emilio: if we extend proposal, we'd dispatch to highlights, then to web content... we'd do it for every event type ayone would care about<br>
&lt;TabAtkins> flackr: highlight needs to be in the event target tree, but yeah currently tree is strictly ancestor tree so that would be a disconnect<br>
&lt;TabAtkins> astearns: q about emilio's proposal<br>
&lt;TabAtkins> astearns: you get coords, ask document fo rhighlights.<br>
&lt;TabAtkins> astearns: are we still able to have top priority highlight prevent other highlights from responding?<br>
&lt;TabAtkins> emilio: Yes, just check if the event was preventDefault'd and return rather than moving on to the next highlight<br>
&lt;dbaron> (do you mean stopPropagation or preventDefault for that case?)<br>
&lt;TabAtkins> (don't think it matters for the discussion)<br>
&lt;TabAtkins> astearns: So it's manual?<br>
&lt;TabAtkins> TabAtkins: Yes, all fully manually handled, they're not fired on the highlights by the browser stuff<br>
&lt;TabAtkins> fremy: So if you have multiple types of code doing highlights they don't know about each other<br>
&lt;TabAtkins> fremy: How can they work together/<br>
&lt;TabAtkins> emilio: Initial proposal was a bool on the highlight<br>
&lt;TabAtkins> emilio: If you need to be aware of one vs the other you need a central place to do it<br>
&lt;TabAtkins> TabAtkins: Right, given dan's initial use-cases (scroll and spellcheck) you *need* them to coordinate with each other anyway<br>
&lt;TabAtkins> emilio: with my proposal there's no change to event prop. you fire the same vents as with no highlights<br>
&lt;TabAtkins> emilio: Up to the website to either centralize their highlight handling, or have different listeners that handle them separately<br>
&lt;TabAtkins> fremy: but you can't decide which acts first<br>
&lt;TabAtkins> emilio: with a bool and two coords appraoch, that's right bc you have to handle the highlights<br>
&lt;dandclark> q+<br>
&lt;TabAtkins> emilio: But if we have the method on the highlight registry that returns highlights in order, you can check yourself if the one you're in charge of is first<br>
&lt;astearns> ack astearns<br>
&lt;TabAtkins> fremy: So if you're not, do you try again?<br>
&lt;TabAtkins> emilio: If you don't have event listeners in the right order you can have weirdness<br>
&lt;TabAtkins> fremy: But order isn't one order<br>
&lt;TabAtkins> fremy: Not sure there's one correct order<br>
&lt;TabAtkins> dbaron: i think emilio's proposal is that page author has to write their own event registraation system if they want to deal with multiple highlights<br>
&lt;TabAtkins> dbaron: we provide an api in the platform that says "here's the ordered list of highlights affected by this" and the author can process the list with their own reg system however they want<br>
&lt;TabAtkins> fremy: Yeah, just weird we don't provide that<br>
&lt;TabAtkins> fremy: you assume libraries will cooperate, not clear to me they will if they're different sources<br>
&lt;fantasai> +1 fremy<br>
&lt;TabAtkins> fremy: strange to assume that<br>
&lt;TabAtkins> emilio: my proposal is minimum that lets you build this<br>
&lt;GameMaker_> +1 fremy as well<br>
&lt;TabAtkins> emilio: but solving general case firing event listenres in an order that solves every use case, yeah it's a much more complicated problem<br>
&lt;TabAtkins> emilio: have to define which events do this, we start with click but have a million events<br>
&lt;dbaron> s/registraation/registration/<br>
&lt;TabAtkins> fremy: another option is we provide it. for each highlight, define which events you want to recieve, and we have an api that dispatches to them in a pseudo-event manner<br>
&lt;TabAtkins> fremy: So does preventDefault for you, etc<br>
&lt;TabAtkins> emilio: I'm not even sure there's a canon order you want to define events on<br>
&lt;TabAtkins> emilio: spellcheck error with a link inside<br>
&lt;TabAtkins> emilio: might seem reasonable to fire spellcheck first and link if not handled, but might be reasonable other way around<br>
&lt;TabAtkins> emilio: I think easiest is to make website choose<br>
&lt;TabAtkins> qq+<br>
&lt;TabAtkins> dandclark: advantage of having platform handle this, where we just propagate the event, is we already had an order of highlights<br>
&lt;TabAtkins> q-<br>
&lt;TabAtkins> dandclark: so think there is an advantage to use the existing order since things are built in already<br>
&lt;TabAtkins> emilio: there is reasons to do before, but also after<br>
&lt;TabAtkins> emilio: not clear to me why we should do them before or after in specific<br>
&lt;TabAtkins> fremy: i think this makes sense, let authors to do this<br>
&lt;TabAtkins> qq+<br>
&lt;TabAtkins> emilio: I think having an api that gives you ranges in order would be low level<br>
&lt;TabAtkins> emilio: if libraries say we can't use this because there's no good way to coordinate, then we can decide whether to fire events before or after<br>
&lt;bkardell_> q+<br>
&lt;TabAtkins> emilio: seems like an elegant way to handle the use-cases without making a call<br>
&lt;astearns> ack TabAtkins<br>
&lt;Zakim> TabAtkins, you wanted to react to astearns<br>
&lt;fantasai> TabAtkins: I think one detail of fremy's proposal is being missed, which is getting the list ordered is reasonable and authors handling on his own<br>
&lt;fantasai> TabAtkins: the problem is that you have to re-invent event dispatch, and hope other libraries can coordinate with you<br>
&lt;fantasai> TabAtkins: Given a list of highlights to displatch on, it fires events using normal event listener mchanics<br>
&lt;astearns> (isn’t this the first option?)<br>
&lt;fantasai> TabAtkins: handles preventDefault etc, as if part of the normal event dispatch order<br>
&lt;fantasai> TabAtkins: so don't have to re-invent<br>
&lt;fantasai> TabAtkins: doesn't require cross-library coordination of the events themselves<br>
&lt;fantasai> TabAtkins: e.g. fire highlight event, take a list of highlights, cranks through them in order as if part of eveent chain<br>
&lt;TabAtkins> emilio: so would be equivalen to making highlight even tlistener<br>
&lt;fantasai> emilio: it would be equivlanet to [..]<br>
&lt;TabAtkins> emilio: so basically it woud be a matter of writing that loop with the current event and dealing the pD/etc in that order<br>
&lt;fantasai> emilio: with api from before, give me a list of highlights, would be a matter of writing that loop with current event and dealing with event propagation and stuff manually<br>
&lt;fantasai> emilio: that seems reasoanble<br>
&lt;fantasai> emilio: page would be responsible at some point, to propagate [missed]<br>
&lt;bkardell_> q-<br>
&lt;fantasai> TabAtkins: on the hihglight registry, eyah<br>
&lt;fantasai> emilio: seems like eihter extension or replacement<br>
&lt;TabAtkins> s/[missed]/the highlight events/<br>
&lt;fantasai> emilio: still requires page's coordination<br>
&lt;fantasai> astearns: Tab described your first option from the issue?<br>
&lt;fantasai> dandclark: sounds similar, except instead of dispatching, need to register to dispatch<br>
&lt;fantasai> TabAtkins: Yes, page author still has to handle ordering and do what they need to do<br>
&lt;fantasai> TabAtkins: but otherwise platform handles events for you<br>
&lt;fantasai> dandclark: so if I have highlights on my page<br>
&lt;fantasai> TabAtkins: Ask the highlight registry are at this x,y, then call this with all of those<br>
&lt;fantasai> TabAtkins: in priority order<br>
&lt;fantasai> TabAtkins: if a highlight preventsDefault, then later things don't get the event<br>
&lt;fantasai> TabAtkins: which is what you want<br>
&lt;fantasai> TabAtkins: [missed]<br>
&lt;fantasai> dandclark: How do we know it's not happening twice?<br>
&lt;fantasai> dandclark: if my final page library says, okay, I need to trigger this ? and propagate the highlights<br>
&lt;fantasai> dandclark: [too fast]<br>
&lt;fantasai> dandclark: I have too different libraries<br>
&lt;fantasai> s/too/two/<br>
&lt;fantasai> TabAtkins: if you have 2 libraries both installing event handler on the element<br>
&lt;fantasai> TabAtkins: if not preventDefault, each one would run thorugh list, and you'd get repetitious behavior<br>
&lt;fantasai> florian: This approach both allows but also requires you to coordinate<br>
&lt;fantasai> florian: simple scenarios can coordinate by accident, but overall, if doing with multiple independent libraries<br>
&lt;fantasai> florian: need some kind of plan for interaction<br>
&lt;fantasai> florian: you need to think through it<br>
&lt;astearns> ack florian<br>
&lt;fantasai> florian: another thing I wanted to ask, unsure if decides,<br>
&lt;dandclark> q-<br>
&lt;fantasai> florian: all this discussion here, we're going to have a very similar discussion for every other type of pseudo<br>
&lt;fantasai> florian: e.g. ellipsis<br>
&lt;fantasai> florian: we shouldn't have 3-4 different solutions for each type of pseudo<br>
&lt;fantasai> florian: I think this approach works better, you're in charge of coordinating, coordinate to your heart's delight<br>
&lt;fantasai> florian: but it is a low-level approach, you *have to* coordinate<br>
&lt;fantasai> florian: For those who have thought about this, how do you generalize to other pseudos?<br>
&lt;fantasai> TabAtkins: Only concern I have is the actual invocation of your behavior, already have API for that called event listeners<br>
&lt;fantasai> TabAtkins: not using that sucks<br>
&lt;fantasai> TabAtkins: but if we recommend to authors to call dispatchEvent on your things, that's probably sufficient<br>
&lt;fantasai> TabAtkins: we have communication API ... but at least not inventing a new callback system<br>
&lt;fantasai> florian: can we do both? By default have a dispatcher that [..]<br>
&lt;fantasai> florian: and if you don't like that, do your own?<br>
&lt;fantasai> florian: If you don't say anything, we dispatch like this. I fyou don't like it, roll your own<br>
&lt;fantasai> fremy: If you want [missed]<br>
&lt;fantasai> fremy: we already have mech or that<br>
&lt;fantasai> emilio: but initial proposal fires at DOM<br>
&lt;fantasai> fremy: if you decide that you want to dispatch something, if it's imporant,, you can say it's ?? phase. We already have mechanism for it, this coordiation happens every day<br>
&lt;fantasai> fremy: we have ? phase, capturing, etc.<br>
&lt;fantasai> fremy: we already have these<br>
&lt;fantasai> fremy: it works<br>
&lt;fantasai> emilio: If the page hasn't called dispatchEvent on the registry<br>
&lt;fantasai> emilio: if we do ourselves, prevents page from doing it later<br>
&lt;fantasai> emilio: so only deault we could choose is after DOM dispatch<br>
&lt;fantasai> emilio: but might want to dispatch ???<br>
&lt;fantasai> emilio: so I think making highlight inherit from EventTarget makes sense<br>
&lt;fantasai> emilio: and propagating to highlight whenever page wants is reasonable<br>
&lt;fantasai> emilio: but how would that look like?<br>
&lt;fantasai> emilio: undefined ?? x,?<br>
&lt;fantasai> emilio: do for mouse events normally?<br>
&lt;fantasai> emilio: do the list thing?<br>
&lt;fantasai> TabAtkins: do the list thing manually<br>
&lt;fantasai> TabAtkins: you can check prevetnDefault by defaultPrevented<br>
&lt;fantasai> TabAtkins: we can put example code in the spec<br>
&lt;fantasai> emilio: So you don't want an API that does it for you?<br>
&lt;fantasai> TabAtkins: probably not<br>
&lt;fantasai> dandclark: If we have 2 libraries that are not coordinating, which one writes the for loop?<br>
&lt;fantasai> TabAtkins: You should check to see if default has been prevented<br>
&lt;fantasai> TabAtkins: if you're first, [...]<br>
&lt;fantasai> TabAtkins: or you can just stop propagation immediately<br>
&lt;fantasai> TabAtkins: event system can handle that<br>
&lt;fantasai> fremy: You may say that you don't want to prevetnt, but still click on the button<br>
&lt;fantasai> TabAtkins: Events should check themselves to see if prevented<br>
&lt;fantasai> fremy: if you preventDefault, the button won't click<br>
&lt;fantasai> emilio: That's the key of the issue, there's no good answer on whatever is the good ansewr<br>
&lt;fantasai> emilio: if you have a spelling eerror on a button, you might want a popup to suggest a fix<br>
&lt;fantasai> emilio: or you might want to click the button<br>
&lt;fantasai> emilio: It's not known which you want<br>
&lt;fantasai> fremy: I agree, but if every library makes its own for loop because it's necessary, then ??<br>
&lt;fantasai> emilio: we're not suggesting that<br>
&lt;fantasai> emilio: The library doesn't need to write the for loop. They add e.g. click event listener on its optject<br>
&lt;fantasai> emilio: something on the page writes the for loop once, and dispatches to all highlights<br>
&lt;fantasai> emilio: so no library needs to write the for loop<br>
&lt;fantasai> emilio: that's done once whenever page wants to handle that<br>
&lt;fantasai> fremy: If I use grammarly, grammarly needs to write the for loop or else it doesn't work<br>
&lt;fantasai> fremy: so they will write it because they need it<br>
&lt;fantasai> emilio: then they would only  handle ranges that they register<br>
&lt;fantasai> fremy: but it still does not solve issue of order<br>
&lt;fantasai> fremy: run the grammarly thing and no consideration that some other things on top of them<br>
&lt;fantasai> emilio: if preventDefaulted then ???<br>
&lt;fantasai> fremy: Sitll the same issue, it's not preventDefaulted if there's another highlight before it<br>
&lt;fantasai> fremy: you have multiple highlights. Grammarly wants to work. So they will need to add an event to handle fix. If they want to make for loop, they can only include grammarly stuff<br>
&lt;fantasai> fremy: but they might want to run grammarly code only if no highlight on top of them<br>
&lt;fantasai> emilio: if the page has dispatched the same event to the highlight already<br>
&lt;fantasai> emilio: like you would dispatch the mouse event from the platform<br>
&lt;fantasai> emilio: if another highlight provider did something, registered dom event in capturephase, and have preventDefaulted it, then grammarly can check that and bail out<br>
&lt;fantasai> emilio: this event has been handled before, we may not even need our for loop<br>
&lt;fantasai> fremy: I don't quite understand, it's not clear what are we doing<br>
&lt;fantasai> TabAtkins: There are various ways for event handler to check if I've been called with this before<br>
&lt;fantasai> TabAtkins: In most cases not required, all first-party content, and don't care much<br>
&lt;fantasai> TabAtkins: should be generally OK, and complex cases need compexity anyway<br>
&lt;fantasai> TabAtkins: you can say I only want to be dispatched once, and guarantee that on your own, by checking and immediatley returning if you get called a second time<br>
&lt;fantasai> fremy: ...<br>
&lt;fantasai> TabAtkins: normal event dispatch would not call the same event on the same element more than once<br>
&lt;fantasai> TabAtkins: but we're not using normal event dispatch<br>
&lt;fantasai> astearns: any other lingering questions, or take back to the issue to discuss the current state of this fourth way<br>
&lt;TabAtkins> (store the last event you saw dispatched to yourself, and check if the new one is the same as the last; if so return immediately)<br>
&lt;fantasai> dandclark: I agree with taking back to the issue, I'm also a bit lost<br>
&lt;TabAtkins> so you can avoid the "double-dispatch" entirely on your own without any 3rd party coordination<br>
&lt;fantasai> astearns: Emilio, can I ask you to write up the proposal with all the details so that Dan has something to digest more easily than the minutes?<br>
&lt;fantasai> dandclark: Does this still have the perf issue dbaron raised?<br>
&lt;fantasai> dandclark: [missed]<br>
&lt;fantasai> emilio: for clicks sure there's no perf issue<br>
&lt;fantasai> emilio: for things like pointerdown, if you want notPassive handling of pointerDown, it feels like a global event listener is maybe not ideal<br>
&lt;fantasai> emilio: this may be fixable another way<br>
&lt;fantasai> emilio: like, maybe we need another member of listenerOptions<br>
&lt;fantasai> emilio: I don't have an answer for that right now<br>
&lt;fantasai> flackr: Maybe the highlight could have a different touchAction?<br>
&lt;fantasai> flackr: normally we encourage ppl to use passive events and use touch Action to specifiy whether to ???<br>
&lt;fantasai> flackr: if we had a way to specify the touch Action on the highlights to not depend<br>
&lt;fantasai> emilio: yes, you might want to allow touch Action on highlight pseudos, make that behave properly<br>
&lt;fantasai> emilio: it's a very good idea<br>
&lt;emilio> s/touch Action/touch-action<br>
&lt;fantasai> astearns: Anything more on this issue?<br>
&lt;fantasai> dandclark: Yes, I think we're good<br>
&lt;fantasai> astearns: do we discuss next issue? or wait on the details of this one?<br>
&lt;fantasai> dandclark: I think we wait<br>
&lt;flackr> s/???/to scroll or not<br>
&lt;fantasai> dandclark: next one is about answering question of given dispatch, how to we determine which range was targetted. I suggested adding a new event type<br>
&lt;fantasai> astearns: so closing off current issue and going to next issue<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-1201588806 using your GitHub account


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

Received on Monday, 1 August 2022 18:58:16 UTC