w3c / touch-events

https://w3c.github.io/touch-events/
26 stars 24 forks source link

'Retargeting steps' expose closed Shadow DOM to the outside world #92

Open smaug---- opened 6 years ago

smaug---- commented 6 years ago

This is similar to https://github.com/whatwg/dom/issues/525#issuecomment-340844680 None of the retargeting can happen during event propagation. I think this is both DOM and Touch event spec bug. 'Retargeting steps' need to happen when we create the event path.

@annevk, @hayatoito (Not sure if @rniwa can comment on this)

smaug---- commented 6 years ago

I'm not quite sure what blink does here. I think it does retargeting before event propagation, but it creates clones of Touch objects with different target, and not just retarget them. My interpretation could be wrong.

hayatoito commented 6 years ago

Yeah, this sounds a spec bug. Retargeting steps shouldn't happen while in event dispatching. It's too late. We might want to fix this, as we did in https://github.com/whatwg/dom/issues/525.

smaug---- commented 6 years ago

This should be probably fixed closer to the way relatedTarget is handled when creating the path. The spec has of course very slow implementation of relatedTarget retargeting algorithm since it does it for every single event target, but still, I guess same could be done for Touch.target and then implementations optimize that.

annevk commented 6 years ago

I'm happy to take PRs for faster algorithms if they do not end up being much more complicated. Clarity is still the number one concern.

It seems this issue affects UI Events too, but the algorithm there hasn't been written yet: https://github.com/w3c/uievents/issues/157?

Will you work on this @hayatoito or should I take a look? Perhaps also track this on the whatwg/dom repository to make it easier for folks to contribute (we don't have to mention the specific case of touch events as this is more general than that I think)?

hayatoito commented 6 years ago

I'm happy to take PRs for faster algorithms if they do not end up being much more complicated. Clarity is still the number one concern.

Yeah, I don't care the performance of algorithms described in the standard. Blink had already implemented may of themt in a different way, with an equivalent visible behavior.

Will you work on this @hayatoito or should I take a look?

I don't care who will work on this. I would be happy if @annevk or @smaug---- could work on this. If you couldn't and this is urgent, I might work on this in a few weeks.

smaug---- commented 6 years ago

Need to also figure out what happens to targetTouches, since the number of objects in that list may change while crossing shadow boundary.

patrickhlauke commented 1 year ago

@smaug---- i know this is ancient now, but as I just touched this (hah) for the first time in forever for https://github.com/w3c/touch-events/pull/135 I'm wondering if this came to any kind of conclusion?