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

pointerout even if the pointer doesn't move? #457

Open
smaug---- opened this issue Sep 21, 2022 · 11 comments
Open

pointerout even if the pointer doesn't move? #457

smaug---- opened this issue Sep 21, 2022 · 11 comments
Assignees
Labels

Comments

@smaug----
Copy link
Contributor

This is from https://bugzilla.mozilla.org/show_bug.cgi?id=1529904
Testcase https://jsbin.com/pevofukono/2/edit?html,css,js,console,output
Chrome fires pointerout even though mouse doesn't move

I think the spec is quite clear "The pointing device is moved out..."
https://w3c.github.io/pointerevents/#dfn-pointerout

@patrickhlauke
Copy link
Member

Confirmed by @flackr that Safari behaves like Firefox

@smaug---- smaug---- added the wpt label Oct 26, 2022
@smaug---- smaug---- added needs-wpt Investigation whether the issue needs a wpt test has been done and wpt is missing and removed wpt labels Dec 21, 2022
@mustaqahmed
Copy link
Member

Copy-pasting my comment from the Interop sheet:

Testing challenge: very hard to write a non-flaky test. The pointerout has to be dispatched before next pointer event dispatch. This absence can't be asserted at pointerup because we need a follow-up event to assert the missing pointerout."

@smaug----
Copy link
Contributor Author

But we don't need a followup event, if we just check that pointerup doesn't occur before the next rAF.

This issue can be closed, but we need still a wpt.

@EdgarChen
Copy link

I am going to add a test in https://bugzilla.mozilla.org/show_bug.cgi?id=1529904.

@smaug---- smaug---- removed the needs-wpt Investigation whether the issue needs a wpt test has been done and wpt is missing label May 25, 2023
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 25, 2023
This is a test for w3c/pointerevents#457.

Differential Revision: https://phabricator.services.mozilla.com/D179045

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1529904
gecko-commit: 575a2c919e5c876e6937a9b7dd8db519d6224dd0
gecko-reviewers: smaug
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 25, 2023
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue May 27, 2023
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue May 31, 2023
…ter doesn't move; r=smaug

This is a test for w3c/pointerevents#457.

Differential Revision: https://phabricator.services.mozilla.com/D179045

UltraBlame original commit: 575a2c919e5c876e6937a9b7dd8db519d6224dd0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue May 31, 2023
…ter doesn't move; r=smaug

This is a test for w3c/pointerevents#457.

Differential Revision: https://phabricator.services.mozilla.com/D179045

UltraBlame original commit: 575a2c919e5c876e6937a9b7dd8db519d6224dd0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue May 31, 2023
…ter doesn't move; r=smaug

This is a test for w3c/pointerevents#457.

Differential Revision: https://phabricator.services.mozilla.com/D179045

UltraBlame original commit: 575a2c919e5c876e6937a9b7dd8db519d6224dd0
jgraham pushed a commit to web-platform-tests/wpt that referenced this issue Jun 29, 2023
This is a test for w3c/pointerevents#457.

Differential Revision: https://phabricator.services.mozilla.com/D179045

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1529904
gecko-commit: 575a2c919e5c876e6937a9b7dd8db519d6224dd0
gecko-reviewers: smaug
@egirard
Copy link

egirard commented May 13, 2024

The underlying specification states "The user agent MUST fire a pointer event named pointerout when [[...]] The user agent has detected a scenario to suppress a pointer event stream."

I think we can agree that the test as written should satisfy the clause "The user agent MUST suppress a pointer event stream when it detects that a pointer is unlikely to continue to produce events"

BUT this conflicts with the parent's specification: "it MUST not be fired until the pointing device has left the boundaries of the element and the boundaries of all of its descendants"

Perhaps we should add language to clarify this? Perhaps something like: "it MUST not be fired while the pointing device remains un-moved within the previous boundaries of the element and the boundaries of all of its descendants. Note that this boundary test should consider the position of elements at the time of the originating event."

@mustaqahmed
Copy link
Member

@egirard and I just discussed this and agreed the first line of 4.1.3.3 is the source of the confusion here: "a pointer is unlikely to continue to produce events" currently carries the implied meaning that "a pointing device is getting disconnected/isolated from the current web-content", and the spec doesn't say it explicitly.

In particular, for the popup condition there the device is not even stopping to produce events!

I will file a new issue to track this.

@mustaqahmed
Copy link
Member

I am reopening this because the conclusion here seems to contradict the related behavior in UIEvent spec!

UIEvents wants mouseover/out events w/o a movement so that hover effect is updated correctly after a layout change or scroll, see w3c/uievents#154. This contradicts the PointerEvent spec behavior and corresponding WPT we discussed here!

@mustaqahmed
Copy link
Member

Here are the related WPTs (with conflicting results!):

@smaug----
Copy link
Contributor Author

Need to think about this. Pointerevent is a pointerevent, not a mouse event, and I think so far we haven't dispatched "synthetic" pointermoves.
The tests don't conflict, they just show different behavior for mouse events and pointer events. There are quite a few cases when pointer events and mouse events work differently.

@masayuki-nakano

@mustaqahmed
Copy link
Member

https://w3c.github.io/uievents/#event-type-mouseover

... The tests don't conflict, they just show different behavior for mouse events and pointer events.

Thanks, that's correct: we are talking about two disjoint sets of events which have no 1:1 correspondence! Is it acceptable to decouple these two sets a bit further with the restriction "synthetic mousemove events are/maybe exposed, and synthetic pointermove events are never exposed"?

@masayuki-nakano
Copy link

Yeah, I don't think synthetic pointermove should be fired to dispatch pointer boundary events. As far as I've investigated, Blink/WebKit may have odd behavior for the synthetic mousemove events for mouse boundary events if the target is temporarily removed and reconnected. The approach of Pointer Events is much clearer for better compatibility.

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

No branches or pull requests

6 participants