Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit release of pointer capture on DOM removal doesn't match touch-events #486

Closed
flackr opened this issue Oct 11, 2023 · 3 comments
Closed

Comments

@flackr
Copy link
Contributor

flackr commented Oct 11, 2023

We trigger implicit release of pointer capture when an element is no longer connected to the DOM:

When the pointer capture target override is no longer connected [DOM], the pending pointer capture target override and pointer capture target override nodes SHOULD be cleared and also a PointerEvent named lostpointercapture corresponding to the captured pointer SHOULD be fired at the document.

It was my understanding that implicit pointer capture was meant to mimic the behavior of touch events. However with touch events we do continue to fire touch events at the implicitly captured removed node: demo.

@smaug----
Copy link
Contributor

I don't think anything defines what the behavior should be for touch events though.
Tested on Android and Chrome fires some pointermoves (that 'some' part is really confusing) and then stops firing them but keeps firing touchmoves. Firefox just fires the initial event and stops there.
I wonder what Safari does.

@flackr
Copy link
Contributor Author

flackr commented Oct 11, 2023

I've updated the test to also listen for events on the ancestor elements of the removed target. This allowed my to verify that after the removal chrome and safari fire pointer events at the current hit test target. Further, the implicit capture is gone so the target can change as the touch moves over other elements.

Tested on Android and Chrome fires some pointermoves (that 'some' part is really confusing) and then stops firing them

Strange in my testing there were no pointermoves fired to the removed target. Pointermove is only fired at the parent.

but keeps firing touchmoves. Firefox just fires the initial event and stops there. I wonder what Safari does.

I tested Safari and found it to be consistent with Chrome.

@smaug----
Copy link
Contributor

I retested:
I see different behavior on Chrome/Android depending on the device.
On both devices pointerdown has target "target".
But on one device pointermove targets after that are "container", and other other one pointermove targets are "target".
Chrome on both devices is 117.0.5938.153. The one which has "container" as the target, as Android 13, the other one has Android 12.

But I can't seem to reproduce anymore the pointermoves stop firing but not touchmoves, though the demo page also changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants