Commit graph

12 commits

Author SHA1 Message Date
batu_hoang
0d02b61f72 Refactor send_touch_event
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-03 17:56:46 +08:00
batu_hoang
3d7ced5048 Add comment and rename epoch_not_synchronized
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-03 16:16:14 +08:00
batu_hoang
afa3f4bba2 Apply delay when epoch is mismatch for touch events
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-03 16:16:14 +08:00
batu_hoang
54d37638b4 Add flag for epoch mismatch
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-03 16:16:14 +08:00
batu_hoang
ddad26f6c8 Update hit test result return type
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-03 16:16:13 +08:00
batu_hoang
b5a3c975a9 Add retry for hit testing with expired epoch
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-03 16:16:13 +08:00
batu_hoang
f52fa9b672
Synchronize dispatch_actions in WebDriver (#36932)
Implement missing synchronization in `dispatch_actions` of `WebDriver`.
https://w3c.github.io/webdriver/#dispatching-actions

> The user agent event loop has spun enough times to process the DOM
events generated by the last invocation of the >[dispatch tick
actions](https://w3c.github.io/webdriver/#dfn-dispatch-tick-actions)
steps.

- Add a way for `ScriptThread` to notify `WebDriver` about the
completion of input commands.
- Add a `webdriver_id` field for `InputEvent`. `ScriptThread` uses it to
distinguish WebDriver events and sends notification.

Tests:
`./mach test-wpt --product servodriver -r
tests\wpt\tests\webdriver\tests\classic\element_click\events.py` pass if
`hit_testing` pass. Check
[issue](https://github.com/servo/servo/issues/36676#issuecomment-2882917136)

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-05-21 11:03:04 +00:00
Martin Robinson
c1a70f4eb2
compositor: Batch all pending scroll event updates into a single transaction (#36974)
When multiple WebViews are updating scroll events, instead of taking the
list of `WebView`s to avoid a double-borrow, batch scroll events into a
single transaction. This should make processing slightly more efficient
and avoids having to take the vector of WebViews.

Testing: No behavior change here and this aspect of WebView interaction
is untestable currently.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-05-16 18:26:59 +00:00
Euclid Ye
e4f62d5c16
Remove duplicate click event in simulate_mouse_click (#36957)
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

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-05-13 10:25:09 +00:00
Kenzie Raditya Tirtarahardja
eaf9224799
Implement wheel action in webdriver (#36744)
https://w3c.github.io/webdriver/#wheel-actions

Test:
`tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::{test_null_response_value,test_params_actions_origin_outside_viewport[element],test_params_actions_origin_outside_viewport[viewport]},
tests/wpt/tests/webdriver/tests/classic/perform_actions/perform.py`
Fixes: https://github.com/servo/servo/issues/36720

cc: @xiaochengh @longvatrong111 @yezhizhen

Signed-off-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
2025-05-07 08:41:34 +00:00
Martin Robinson
cbc363bedd
compositor: Tick animations for an entire WebView at once (#36662)
Previously, when processing animations, the compositor would sent a tick
message to each pipeline. This is an issue because now the
`ScriptThread` always processes rendering updates for all `Document`s in
order to ensure properly ordering. This change makes it so that tick
messages are sent for an entire WebView. This means that each
`ScriptThread` will always receive a single tick for every time that
animations are processed, no matter how many frames are animating. This
is the first step toward a refresh driver.

In addition, we discard the idea of ticking animation only for
animations and or only for request animation frame callbacks. The
`ScriptThread` can no longer make this distinction due to the
specification and the compositor shouldn't either.

This should not really change observable behavior, but should make Servo
more efficient when more than a single frame in a `ScriptThread` is
animting at once.

Testing: This is covered by existing WPT tests as it mainly just improve
animation efficiency in a particular case.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-04-24 19:03:14 +00:00
Martin Robinson
70f19c749f
compositing: Rename WebView to WebViewRenderer (#36574)
There is a `WebView` in libservo (new) and a `WebView` in compositing
(old). Nowadays, the "real" `WebView` is the one in the libservo. The
`WebView` in `compositing` is really about rendering the contents of a
`WebView` from libservo. In addition there is also a trait exposed by
the compositor called `RendererWebView` which is a way for the
compositor to talk to libservo without a circular dependency.

This changes does some renames to make things clearer and so that there
is One Less WebView™:

- `compositing::WebView` -> `compositing::WebViewRenderer` (this is the
  same kind of naming as `ServoRenderer`).
- `compositing::RendererWebView` -> `compositing::WebViewTrait`

Testing: This is just a couple renames so should be covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-04-21 08:47:39 +00:00
Renamed from components/compositing/webview.rs (Browse further)