Skip to content

Remove duplicate click event in simulate_mouse_click - #36957

Merged
mrobinson merged 1 commit into
servo:mainfrom
yezhizhen:fix-duplicate-touch-click
May 13, 2025
Merged

mrobinson merged 1 commit into
servo:mainfrom
yezhizhen:fix-duplicate-touch-click

Conversation

@yezhizhen

@yezhizhen yezhizhen commented May 11, 2025 •

Copy link
Copy Markdown
Member

After InputEvent::Touch processed by Script, it sends TouchEventProcessed back to Constellation, which goes through hit-test etc. and loops back to Script again. However, WebViewRenderer::simulate_mouse_click should not send MouseButtonAction::Click due to #36413

Testing: Manually tested by converting mouse to touch

cc @jdm @xiaochengh

@yezhizhen
yezhizhen requested a review from mrobinson as a code owner May 11, 2025 06:43

@yezhizhen yezhizhen left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also it concerns me that simulate_mouse_click goes through duplicate hit-test three times.
Should I rework WebViewRenderer::dispatch_input_event?

@mrobinson

Copy link
Copy Markdown
Member

Maybe the performance characteristics of simulate_mouse_click aren't so important right now unless they are used heavily somewhere. Eventually the hit test will move to script so we won't be able to eliminate them forever, unfortunately.

@yezhizhen

Copy link
Copy Markdown
Member Author

Eventually the hit test will move to script so we won't be able to eliminate them forever, unfortunately.

Thanks for letting me know! I am good with this PR then :)

@mrobinson
mrobinson added this pull request to the merge queue May 13, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 13, 2025
@mrobinson
mrobinson added this pull request to the merge queue May 13, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 13, 2025
@mrobinson
mrobinson added this pull request to the merge queue May 13, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 13, 2025
@mrobinson
mrobinson added this pull request to the merge queue May 13, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 13, 2025
@mrobinson
mrobinson added this pull request to the merge queue May 13, 2025
Merged via the queue into servo:main with commit e4f62d5 May 13, 2025
@yezhizhen
yezhizhen deleted the fix-duplicate-touch-click branch May 13, 2025 12:04
Shraman91 pushed a commit to Shraman91/servo that referenced this pull request Oct 6, 2026
…criptThread` (servo#48671)

Compatibility mouse events for a tap were synthesized by the paint
thread as new
input events after confirmed by script->constellation->embedder->paint, 
so they were processed on a later rendering tick than the touchend that
triggered them, making touch tests racy/flaky.
One particular serious case is, the hit-test for compat mouse events
happened when the layout state has already changed.

This simplifies API as well, by removing unused `render_api` in
`notify_input_event_handled` and point in `PendingClick`.
It also simplifies messaging: `simulate_mouse_click` is now removed from
paint, which was like
paint -> constellation -> script -> embedder -> paint, and repeated 3
times as we had duplicate hit-test 3 times!

Testing: `mouseevents-after-touchend.tentative.html` and
`/touch-events/hover-state-caused-by-compatibility-mouse-events.tentative.html`
has new passing and no longer intermittent.
WebDriver `perform_actions/pointer_touch.py` has 4 more new failures:
this is newly filed servo#48619 which has
always been there, but previously hidden.

Fixes:
servo#36957 (review),
performance related concern
Fixes: servo#40233, incorrect behaviour
### Intermittent ones
Fixes: servo#46497
Fixes: servo#42813
Fixes: servo#46781
Fixes: servo#46277
Fixes: servo#41175
Fixes: servo#44693

And probably some I'm not aware of yet.

---------

Signed-off-by: Euclid Ye <[email protected]>
hhhwsqhhh pushed a commit to hhhwsqhhh/servo that referenced this pull request Oct 12, 2026
…criptThread` (servo#48671)

Compatibility mouse events for a tap were synthesized by the paint
thread as new
input events after confirmed by script->constellation->embedder->paint, 
so they were processed on a later rendering tick than the touchend that
triggered them, making touch tests racy/flaky.
One particular serious case is, the hit-test for compat mouse events
happened when the layout state has already changed.

This simplifies API as well, by removing unused `render_api` in
`notify_input_event_handled` and point in `PendingClick`.
It also simplifies messaging: `simulate_mouse_click` is now removed from
paint, which was like
paint -> constellation -> script -> embedder -> paint, and repeated 3
times as we had duplicate hit-test 3 times!

Testing: `mouseevents-after-touchend.tentative.html` and
`/touch-events/hover-state-caused-by-compatibility-mouse-events.tentative.html`
has new passing and no longer intermittent.
WebDriver `perform_actions/pointer_touch.py` has 4 more new failures:
this is newly filed servo#48619 which has
always been there, but previously hidden.

Fixes:
servo#36957 (review),
performance related concern
Fixes: servo#40233, incorrect behaviour
### Intermittent ones
Fixes: servo#46497
Fixes: servo#42813
Fixes: servo#46781
Fixes: servo#46277
Fixes: servo#41175
Fixes: servo#44693

And probably some I'm not aware of yet.

---------

Signed-off-by: Euclid Ye <[email protected]>
aphrody-dev pushed a commit to aphrody-labs/browser that referenced this pull request Nov 16, 2026
…criptThread` (#48671)

Compatibility mouse events for a tap were synthesized by the paint
thread as new
input events after confirmed by script->constellation->embedder->paint, 
so they were processed on a later rendering tick than the touchend that
triggered them, making touch tests racy/flaky.
One particular serious case is, the hit-test for compat mouse events
happened when the layout state has already changed.

This simplifies API as well, by removing unused `render_api` in
`notify_input_event_handled` and point in `PendingClick`.
It also simplifies messaging: `simulate_mouse_click` is now removed from
paint, which was like
paint -> constellation -> script -> embedder -> paint, and repeated 3
times as we had duplicate hit-test 3 times!

Testing: `mouseevents-after-touchend.tentative.html` and
`/touch-events/hover-state-caused-by-compatibility-mouse-events.tentative.html`
has new passing and no longer intermittent.
WebDriver `perform_actions/pointer_touch.py` has 4 more new failures:
this is newly filed #48619 which has
always been there, but previously hidden.

Fixes:
servo/servo#36957 (review),
performance related concern
Fixes: #40233, incorrect behaviour
### Intermittent ones
Fixes: servo/servo#46497
Fixes: #42813
Fixes: servo/servo#46781
Fixes: servo/servo#46277
Fixes: #41175
Fixes: #44693

And probably some I'm not aware of yet.

---------

Signed-off-by: Euclid Ye <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants