Skip to content

Implement wheel action in webdriver - #36744

Merged
xiaochengh merged 1 commit into
servo:mainfrom
PotatoCP:wb-action-wheel
May 7, 2025
Merged

xiaochengh merged 1 commit into
servo:mainfrom
PotatoCP:wb-action-wheel

Conversation

@PotatoCP

@PotatoCP PotatoCP commented Apr 29, 2025 •

Copy link
Copy Markdown
Contributor

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: #36720

cc: @xiaochengh @longvatrong111 @yezhizhen

@PotatoCP
PotatoCP requested a review from mrobinson as a code owner April 29, 2025 07:42
@PotatoCP
PotatoCP force-pushed the wb-action-wheel branch 3 times, most recently from ab620af to c31999d Compare April 29, 2025 08:53

@xiaochengh xiaochengh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good in general % some coding style comments

Comment thread components/webdriver_server/actions.rs Resolved
Comment thread components/webdriver_server/actions.rs Resolved
Comment thread components/webdriver_server/actions.rs Resolved
Comment thread components/webdriver_server/actions.rs Resolved
Comment thread components/webdriver_server/actions.rs Resolved
@PotatoCP
PotatoCP force-pushed the wb-action-wheel branch 3 times, most recently from 4fef5f5 to 9bed754 Compare April 30, 2025 06:49
xiaochengh
xiaochengh previously approved these changes Apr 30, 2025
@xiaochengh
xiaochengh enabled auto-merge April 30, 2025 07:41
auto-merge was automatically disabled April 30, 2025 08:42

Head branch was pushed to by a user without write access

@PotatoCP

PotatoCP commented Apr 30, 2025 •

Copy link
Copy Markdown
Contributor Author

Hi @xiaochengh, can you re-enable the auto merge. Previously the DCO checks stuck for some reason, and I had to repush.

@PotatoCP
PotatoCP force-pushed the wb-action-wheel branch from 197dd74 to fe218e5 Compare May 2, 2025 01:43
@PotatoCP

PotatoCP commented May 2, 2025

Copy link
Copy Markdown
Contributor Author

Rebase again to resolve conflict

@PotatoCP

PotatoCP commented May 2, 2025

Copy link
Copy Markdown
Contributor Author

I just discussed with @d-desiatkin, and it seems that I miss the logic to actually fire the scroll event and make the webview scroll (Big whoops). I initially thought that document.handle_wheel_event already fire this event, which is wrong.

Now, I will try to push a scroll event to pending_scroll_zoom_events in webview_renderer and marked this as draft for now.

@PotatoCP
PotatoCP marked this pull request as draft May 2, 2025 07:06
@PotatoCP
PotatoCP force-pushed the wb-action-wheel branch 3 times, most recently from a3b1b86 to 44a49c4 Compare May 6, 2025 05:49
@PotatoCP
PotatoCP marked this pull request as ready for review May 6, 2025 05:51
@PotatoCP

PotatoCP commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

Should be ready for review again now. I implemented on_webdriver_wheel_action to push to pending_scroll_zoom_events. This function is called in the compositor

@xiaochengh
xiaochengh dismissed their stale review May 6, 2025 10:36

Reverted due to updates.

Comment thread components/compositing/compositor.rs Resolved
@xiaochengh

Copy link
Copy Markdown
Contributor

I just discussed with @d-desiatkin, and it seems that I miss the logic to actually fire the scroll event and make the webview scroll (Big whoops). I initially thought that document.handle_wheel_event already fire this event, which is wrong.

Now, I will try to push a scroll event to pending_scroll_zoom_events in webview_renderer and marked this as draft for now.

Hmm, this might be the downside of working without verifying on CI.

Even though we don't have WebDriver on CI yet, could you run WPT locally, list the affected tests in the PR description and verify if it's working as intended? And also add tests if the existing tests are not adequate. Thanks!

@PotatoCP

PotatoCP commented May 7, 2025 •

Copy link
Copy Markdown
Contributor Author

I just discussed with @d-desiatkin, and it seems that I miss the logic to actually fire the scroll event and make the webview scroll (Big whoops). I initially thought that document.handle_wheel_event already fire this event, which is wrong.
Now, I will try to push a scroll event to pending_scroll_zoom_events in webview_renderer and marked this as draft for now.

Hmm, this might be the downside of working without verifying on CI.

Even though we don't have WebDriver on CI yet, could you run WPT locally, list the affected tests in the PR description and verify if it's working as intended? And also add tests if the existing tests are not adequate. Thanks!

For tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py we do got unexpected pass

web-platform-test
~~~~~~~~~~~~~~~~~
Ran 14 checks (13 subtests, 1 tests)
Expected results: 11
Unexpected results: 3
  subtest: 3 (3 pass)
More detailed ``` 0:03.74 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_null_response_value 0:05.30 INFO STDOUT: PASSED 0:05.84 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_no_top_browsing_context 0:06.64 INFO STDOUT: FAILED 0:07.18 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_no_browsing_context 0:08.06 INFO STDOUT: FAILED 0:08.35 pid:2959583 Full command: /home/k84401373/servo_fork/servo/target/debug/servo --webdriver=58473 --hard-fail --ignore-certificate-errors --headless pid:2959583 [2025-05-07T01:29:04Z ERROR script::dom::bindings::error] Error at :0:0 uncaught exception: g.xJ@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:326:26 0:08.35 pid:2959583 AcF@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:2109:32 0:08.35 pid:2959583 mjR@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:2106:158 0:08.35 pid:2959583 g.GU@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:2105:25 0:08.35 pid:2959583 $zm@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:2704:70 0:08.35 pid:2959583 g.A.initialize@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:8957:1102 0:08.35 pid:2959583 eoC@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:3759:78 0:08.35 pid:2959583 g.Wc@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:3767:23 0:08.35 pid:2959583 wC@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:7072:137 0:08.35 pid:2959583 dFp@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:7071:122 0:08.35 pid:2959583 g.mi@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:7040:340 0:08.35 pid:2959583 g.mi.create@https://www.youtube.com/s/player/342e8dde/player_ias.vflset/en_US/base.js:13174:209 0:08.35 pid:2959583 DU/a.U@https://www.youtube.com/s/player/342e8dde/www-embed-player-pc.vflset/www-embed-player-pc.js:3331:469 0:08.35 pid:2959583 DU@https://www.youtube.com/s/player/342e8dde/www-embed-player-pc.vflset/www-embed-player-pc.js:3333:12 0:08.35 pid:2959583 k.loadNewVideoConfig@https://www.youtube.com/s/player/342e8dde/www-embed-player-pc.vflset/www-embed-player-pc.js:3326:177 0:08.35 pid:2959583 AU/this.oa<@https://www.youtube.com/s/player/342e8dde/www-embed-player-pc.vflset/www-embed-player-pc.js:3324:421 0:08.35 pid:2959583 0:08.61 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_params_actions_origin_outside_viewport[element] 0:09.25 INFO STDOUT: PASSED 0:09.80 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_params_actions_origin_outside_viewport[viewport] 0:10.48 INFO STDOUT: PASSED 0:11.02 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_not_scrollable 0:11.77 INFO STDOUT: FAILED 0:12.30 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_scrollable_overflow 0:13.04 INFO STDOUT: FAILED 0:13.58 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_iframe 0:14.36 INFO STDOUT: FAILED 0:14.90 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_shadow_tree[outer-open] 0:15.76 INFO STDOUT: FAILED 0:16.30 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_shadow_tree[outer-closed] 0:17.12 INFO STDOUT: FAILED 0:17.66 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_shadow_tree[inner-open] 0:18.50 INFO STDOUT: FAILED 0:19.04 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_shadow_tree[inner-closed] 0:19.86 INFO STDOUT: FAILED 0:20.40 INFO STDOUT: tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py::test_scroll_with_key_pressed 0:21.18 INFO STDOUT: FAILED ```

I am also hoping we can solve some subtest in tests/wpt/tests/infrastructure/testdriver/actions/wheelScroll.html. However there is a problem in servodriver that make testharness return js unknown error, so for now we get error (#36890).

@PotatoCP
PotatoCP force-pushed the wb-action-wheel branch from 44a49c4 to b749e7e Compare May 7, 2025 02:23
@PotatoCP
PotatoCP force-pushed the wb-action-wheel branch from b749e7e to 708e9b4 Compare May 7, 2025 03:55
@PotatoCP

PotatoCP commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

@xiaochengh xiaochengh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks for updating the test results.

Is it good for merging now?

@PotatoCP

PotatoCP commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

LGTM. Thanks for updating the test results.

Is it good for merging now?

From me should be good

@xiaochengh
xiaochengh added this pull request to the merge queue May 7, 2025
Merged via the queue into servo:main with commit eaf9224 May 7, 2025
github-merge-queue Bot pushed a commit that referenced this pull request May 13, 2025
- Wheel scroll action can get coordinates relative to an element origin
([previously](#36744) only
implemented for viewport).
- Extract the element coordinate into a function

Testing: Partially
`tests/wpt/tests/infrastructure/testdriver/actions/wheelScroll.html`,
but we still have synchronization problem. You can try to add sleep in
the test to see OK result.

cc: @xiaochengh @longvatrong111 @yezhizhen

Signed-off-by: PotatoCP <[email protected]>
Co-authored-by: PotatoCP <[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.

Missing implementation of wheel action in webdriver

2 participants