15:57:26 RRSAgent has joined #pointerevents 15:57:30 logging to https://www.w3.org/2023/11/22-pointerevents-irc 15:57:44 Meeting: PEWG 15:57:47 Chair: Patrick H. Lauke 15:57:59 Agenda: https://www.w3.org/events/meetings/6246bc85-4dae-43a8-a50c-9bc5a0829585/20231122T110000/ 15:58:08 Scribe: Patrick H. Lauke 15:58:20 ScribeNick: Patrick_H_Lauke 15:58:22 present+ 16:00:24 present+ smaug 16:01:21 flackr has joined #pointerevents 16:01:40 present+ flackr 16:01:50 present+ mustaq 16:03:05 TOPIC: Explain how a removed DOM node should be handled for boundary events https://github.com/w3c/pointerevents/pull/491 16:04:21 [group agrees this is good to merge for now] 16:05:03 Rob: i think mustaq has already landed tests for the simple cases 16:05:40 Rob: have some concerns about this assuming the same event chain / path for all event types 16:06:03 Rob: "get the parent" algorithm in DOM spec, which can vary by event type 16:06:29 Rob: we might want to say we use that algo for an event with type pointermove, and standardise on that 16:06:48 Rob: it's weird that by spec you can have different chain depending on event type 16:07:33 Mustaq: missing tests relate to slot ... 16:07:52 https://github.com/w3c/pointerevents/issues/477 16:08:24 Mustaq: ...and shadow dom boundaries 16:09:26 TOPIC: Clarify mousedown event target if the preceding pointerdown event listener removes the target https://github.com/w3c/pointerevents/issues/492 16:11:38 Rob: tricky part here is when you have a pointer event and compat mouse event dispatched. when PE removes target, does it affect the mouse compat target 16:11:46 Olli: and what happens if you modify DOM even more 16:12:44 Rob: i'm in favour to having it behave similar to tracking what pointer is over - goes to the parent. think there's a lot of pages which ... things like React replace large chunks of inner elements, but want to still fire to ancestor... 16:12:51 Patrick: event delegation... 16:13:03 Olli: tricky part is click, because that's not dispatched by any implementation 16:13:24 Rob: could be accident because we remove the down event, and as result doesn't fire click 16:13:34 Olli: unfortunate because a dev might expect a click 16:13:44 Rob: sounds like we may need to do some measurement for this 16:13:53 Mustaq: i already added WPTs for this 16:14:02 Mustaq: do we have click there? I forgot... 16:14:17 Rob: think test wasn't adding a click listener, so we weren't testing for that 16:14:17 https://wpt.fyi/results/pointerevents?label=master&label=experimental&aligned&q=interleaved.tentative.html 16:14:41 Rob: we probably need to add some metrics to see how often we're going to be dispatching click for something removed in the pointerdown 16:15:10 Mustaq: neither firefox nor chrome fire? 16:15:24 Rob: firefox, chrome, safari - none of them do 16:15:50 Rob: we could say that if the down element is removed, the click isn't dispatched - if it's too late for us to change this 16:16:07 Rob: but could be better outcome if we COULD dispatch click 16:16:19 Mustaq: we can't measure compat impact without trying... 16:16:53 Rob: not necessarily, can measure how often we currently DON'T fire a click because the down element was removed. can further determine what the target of the click would be, and check if ancestor has a click handler 16:17:13 Mustaq: ... we can get some estimate 16:17:28 Rob: we can at least get an estimate, but can't tell if it would break things 16:17:43 Olli: what happens if you don't REMOVE the target, but just move it to another place in the DOM 16:18:01 Rob: good point, think we might still dispatch click, and we need to test 16:18:13 Olli: target would be the same though yes 16:18:40 Rob: if there's already incompatibility with moved elements...there's an argument to fix this for both removed and moved 16:18:59 Mustaq: the test ... we check for click, but not sure what outcome is 16:19:19 Rob: why don't i fork this bin and modify it to check for moved target 16:20:07 Moved case https://jsfiddle.net/flackr/grv2956n/5/ 16:22:03 [group tests, and finding different results depending on browser, platform ... inconsistencies] 16:22:18 I am seeing Chrome + Forefox firing click on Linux. 16:22:51 Apparently Chrome on Mac doesn't?! 16:27:32 Patrick: do we need to do something in our spec, or is this covered elsewhere? 16:28:12 Rob: probably need to call out the mouse compat events, and that it fires to parent. click event is tricky 16:31:03 Rob: might be functionally same whether we say it goes to ancestor of pointerdown/pointerup or of the mouse compat ones (?) 16:31:23 Olli: feels scary potentially firing click where before it didn't, but seems sensible 16:31:43 Rob: but at least it's a click to the ancestor/higher up, not the elements that have been modified 16:33:19 Patrick: how easy/hard would it be to patch our spec for this? realistic to say for next meeting? 16:33:23 Rob: we'll need data 16:33:38 Patrick: so do we want to delay v3 until this is resolved? or punt this to future? 16:34:06 Rob: i'd be ok leaning to: if target removed from DOM since the down event, before the up event, we don't fire click 16:34:29 Rob: in terms of something less likely to break things. but it will be a change, as in the moved case we do see clicks 16:34:38 Mustaq: move not so different from removed 16:34:47 Rob: moving is remove then add 16:34:59 Olli: it's question of at which point you check ancestor 16:35:55 Rob: if we're worried about compat of clicks being fired where they weren't being fired before, then my suggestion is the above (if target removed since down but before up, don't fire click) 16:36:57 Mustaq: in chrome we remember node ... 16:37:15 Olli: i need to check implementation. we have callback for case where it's removed from DOM and it's definitely called... 16:37:42 Rob: those are two reasonable options. third option: on removal, we implicitly track nearest thing in the chain that still IS in the DOM 16:38:06 Rob: because with moving, you could end up firing click to something that didn't originally track the down event, which might be weird 16:38:21 Olli: guess we need to check the click target 16:39:35 Mustaq: tricky also if you have capturing on top ... capture on down, then remove the node ... who gets lostpointercapture 16:40:10 Mustaq: ah no, it never gets resolved 16:40:42 Olli: i assume you track target on stack somewhere, and then dispatch 16:41:17 Rob: time delay. question is if we want to keep hold of a reference ... 16:42:44 Olli: presumably, at high level, on pointerdown you check target, and then immediately/in the same task also fire mousedown, without even checking again right away 16:43:17 Rob: whether we keep track of that target until we see the up event... chrome does, based on test results, but we need to define this 16:47:30 [further testing] 16:48:13 Rob: tracking element that we dispatched the down to is more useful, as it supports the reordering case i linked the bug for. maybe we can try to resolve on that 16:48:41 Olli: that works for moving, and for removals... there's a possible web compat issue we need to figure out though 16:48:53 Rob: need to also work out where in spec this needs to be clarified 16:49:30 Mustaq: don't think PE spec doesn't define click target, just points to UI Events spec... 16:49:52 Rob: think the behaviour that Firefox has might already be implied. nothing in spec says forget about down target if node is removed 16:50:08 Mustaq: UI Event spec doesn't mention anything of that i think 16:50:57 Rob: through that, you hold on to the element of the down event, and use that to check ancestor. if node removed, it won't have an ancestor... 16:51:15 Rob: ... at the time of up ... 16:51:41 Mustaq: spec doesn't say about the time of up though, so i could interpret it as at the time of down 16:52:00 Rob: where does spec say that? 16:52:11 Mustaq: "nearest common inclusive ancestor" 16:52:23 Mustaq: can have multiple interpretations... 16:52:31 Rob: we don't want to remember entire ancestor chain 16:52:40 Mustaq: agree, spec is very handwavy 16:53:24 Rob: we could add a few words here like: when the mouseup event is dispatched, compute the common ancestor of the down target and the up target in the current state of the DOM, or something to that effect 16:53:43 Mustaq: need to agree on behaviour... 16:54:24 Rob: UI Events spec also seems to say we *shouldn't* fire click... oh, doesn't say anything about not firing the event, just not to the same target (?) 16:55:22 Olli: ...spec hints at behaviour that FX has, but it's not very precise... 16:55:34 Rob: all for standardising on this behaviour and then checking WPT 16:58:44 [further discussion] 16:59:05 Rob: it does feel a bit weird, but then we define arguably weird behaviours for other situations 16:59:49 Olli: there's also still the question about mousedown on removal 17:00:06 Rob: feels like such an edge case ... 17:00:38 Mustaq: think PE defines that the compat events should go to ancestor? 17:01:15 "the original target's nearest ancestor node" as per PE spec... 17:02:42 Olli: we might need to define that click only fires if pointerdown and pointerup are still in DOM 17:03:05 Rob: prefer looking at it as the ancestor of pointerdown and poitnerup is the same... 17:03:30 ACTION: Rob to try and write something up in the issue, continue discussion next time 17:04:10 rrsagent, set logs world-visible 17:04:16 rrsagent, generate minutes 17:04:17 I have made the request to generate https://www.w3.org/2023/11/22-pointerevents-minutes.html Patrick_H_Lauke 18:47:54 Patrick_H_Lauke has left #pointerevents 18:47:59 Patrick_H_Lauke has joined #pointerevents 18:48:08 RRSAgent, bye 18:48:08 I see 1 open action item saved in https://www.w3.org/2023/11/22-pointerevents-actions.rdf : 18:48:08 ACTION: Rob to try and write something up in the issue, continue discussion next time [1] 18:48:08 recorded in https://www.w3.org/2023/11/22-pointerevents-irc#T17-03-30