Rework on webdriver wait for navigation complete (#38234)

For current implementation, when a command may trigger a navigation,
webdriver only waits for document readiness state.
However, not all navigations make change in document.
This PR handles more cases for waiting for a navigation, and apply to
`element_click`.

- Before sending a command which may trigger a navigation, `webdriver`
sets `load status send` to `embedder`, `constelltation` and `script
thread` to listen to `navigation events`.
- Webdriver check if there is a navigation with `script thread`.
- If the navigation is loading a new url, webdriver checks if the
request is approved with `constellation`, then waits for document
readiness state.
- If the navigation is a hashchange, webdriver waits untill all new
generated dom events have been processed.

Testing: 
`tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py`
`tests/wpt/tests/webdriver/tests/classic/element_click/user_prompts.py`
https://github.com/longvatrong111/servo/actions/runs/16488690749

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
This commit is contained in:
batu_hoang 2025-07-30 15:24:07 +08:00 committed by GitHub
parent 8b3e7b1c6a
commit 37ac4ffeb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 188 additions and 125 deletions

View file

@ -1,13 +1,4 @@
[navigate.py]
[test_numbers_link]
expected: FAIL
[test_multi_line_link]
expected: FAIL
[test_navigation_retains_input_state]
expected: FAIL
[test_link_hash]
expected: FAIL
@ -17,23 +8,8 @@
[test_link_from_toplevel_context_with_target[_parent\]]
expected: FAIL
[test_link_from_nested_context_with_target[\]]
expected: FAIL
[test_link_from_nested_context_with_target[_blank\]]
expected: FAIL
[test_link_from_nested_context_with_target[_parent\]]
expected: FAIL
[test_link_from_nested_context_with_target[_self\]]
expected: FAIL
[test_link_from_nested_context_with_target[_top\]]
expected: FAIL
[test_link_cross_origin]
expected: FAIL
[test_link_closes_window]
expected: FAIL

View file

@ -1,18 +0,0 @@
[user_prompts.py]
[test_accept[beforeunload-None\]]
expected: FAIL
[test_accept_and_notify[beforeunload-None\]]
expected: FAIL
[test_dismiss[beforeunload-None\]]
expected: FAIL
[test_dismiss_and_notify[beforeunload-None\]]
expected: FAIL
[test_ignore[beforeunload\]]
expected: FAIL
[test_default[beforeunload-None\]]
expected: FAIL