Skip to content

Conversation

@canova
Copy link
Member

@canova canova commented Mar 27, 2025

This is something we came up while implementing it in Firefox.

We don't fire an orphan pointerup event at all when there is only a pointerup and no pointerdown. So this test was failing. This change adds a timeout mechanism for browsers like Firefox, so we can treat 'no pointerup entry' as a pass.

As a solution, we are sending a non-pointer related event right after the pointerup event, to make sure at least one event is being handled by the test so it doesn't timeout.

It fixes Bug 1956598.

@canova
Copy link
Member Author

canova commented Mar 27, 2025

Hey @mmocny, this PR changes the test to treat 'no pointerup event' as a pass, like we discussed. Could you take a look at it? (can't mark you as a reviewer here)

@mmocny
Copy link
Contributor

mmocny commented Mar 27, 2025

I equally dont love this but I think its the most sensible immediate solution.

Other options are to remove the WPT for this case, as arguably this Chrome behaviour might itself be against UIEvents/PointerEvents spec expectations -- but perhaps we can followup after exploring that.

Cheers.

@canova
Copy link
Member Author

canova commented Apr 3, 2025

Thanks for the review! Yes, let's explore other options after landing this.
Btw it looks like you're not part of the org for reviews. I don't remember how the process was for adding someone though.

@npm1, It looks like @mmocny is not part of the wpt org and this patch still needs a review. Could you take a look as well?

// timeout mechanism. If no events are fired in 2 seconds, treat 'no
// pointerup event' as a pass. 2 seconds is an arbitrary time we picked,
// consider changing if it's flaky.
new Promise(resolve => t.step_timeout(resolve, 2000))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a source of flakiness. Maybe add some other event that you know is going to be processed after or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's a great idea! It should work well with both of the browsers. I'm updating the PR in a bit.

@canova canova force-pushed the orphan-pointerup branch from 44eceea to 64c978f Compare April 8, 2025 12:17
@canova
Copy link
Member Author

canova commented Apr 8, 2025

@npm1 Thanks for the suggestion, I've updated the patch. I tested it with both Firefox and Chrome and both of them pass (with the correct condition). Could you take a look at it again?

@canova canova requested a review from npm1 April 8, 2025 12:19
await interactAndObserve('orphan-pointerup', document.getElementById('testButtonId'), observerPromise);
assert_equals(map.get('pointerup'), 0, 'Should have a trivial interactionId for orphan pointerup event.');

// This test passes when:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 'when either' to make it clearer

@canova canova force-pushed the orphan-pointerup branch from 64c978f to 7c00c3a Compare April 8, 2025 19:11
@canova
Copy link
Member Author

canova commented Apr 8, 2025

Hmm weird. CI is failing because of Firefox failures but it's from a test that I don't touch in this PR and it was already failing before.

@canova canova force-pushed the orphan-pointerup branch from 7c00c3a to c61f89a Compare April 8, 2025 19:59
This is something we came up while implementing it in Firefox.

We don't fire an orphan pointerup event at all when there is only a
pointerup and no pointerdown. So this test was failing. This change adds
a timeout mechanism for browsers like Firefox, so we can treat 'no
pointerup entry' as a pass.

As a solution, we are sending a non-pointer related event right after
the pointerup event, to make sure at least one event is being handled by
the test so it doesn't timeout.

It fixes [Bug 1956598](https://bugzilla.mozilla.org/show_bug.cgi?id=1956598).
@canova canova force-pushed the orphan-pointerup branch from c61f89a to 519947a Compare April 30, 2025 13:53
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 1, 2025
…ng tests r=sefeng

This patch was approved in web-platform-tests/wpt#51630.
But unfortunately I couldn't manage to land it there due to some intermittent
Firefox and Chrome test failures that are unrelated to the changes I was making.

Differential Revision: https://phabricator.services.mozilla.com/D247327
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 2, 2025
…ng tests r=sefeng

This patch was approved in web-platform-tests/wpt#51630.
But unfortunately I couldn't manage to land it there due to some intermittent
Firefox and Chrome test failures that are unrelated to the changes I was making.

Differential Revision: https://phabricator.services.mozilla.com/D247327
moz-wptsync-bot pushed a commit that referenced this pull request May 2, 2025
This patch was approved in #51630.
But unfortunately I couldn't manage to land it there due to some intermittent
Firefox and Chrome test failures that are unrelated to the changes I was making.

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1956598
gecko-commit: 77a4f757045738f11a562db9fdc6b420024ccc3e
gecko-reviewers: sefeng
moz-wptsync-bot pushed a commit that referenced this pull request May 2, 2025
This patch was approved in #51630.
But unfortunately I couldn't manage to land it there due to some intermittent
Firefox and Chrome test failures that are unrelated to the changes I was making.

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1956598
gecko-commit: 77a4f757045738f11a562db9fdc6b420024ccc3e
gecko-reviewers: sefeng
@canova
Copy link
Member Author

canova commented May 2, 2025

I directly landed it on mozilla-central and let it auto upstream instead because of the CI issues. Closing this.

@canova canova closed this May 2, 2025
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request May 3, 2025
…ng tests r=sefeng

This patch was approved in web-platform-tests/wpt#51630.
But unfortunately I couldn't manage to land it there due to some intermittent
Firefox and Chrome test failures that are unrelated to the changes I was making.

Differential Revision: https://phabricator.services.mozilla.com/D247327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants