-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Rework on webdriver wait for navigation complete #38234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d9b14fc
to
9744cb1
Compare
tests/wpt/meta/webdriver/tests/classic/get_element_css_value/user_prompts.py.ini
Outdated
Show resolved
Hide resolved
9744cb1
to
53bbfbf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking more about navigation to fragment, I'm not sure if waiting for dom events is the right approach. It feels like a hacky heuristic to me. And I'm not even sure if we should wait for those if events if the navigation triggers any.
At a lower level, in the current solution, we are adding tasks that are not dom manipulations to the dom manipulation task source. And it's hard to infer when exactly this will be complete.
Is there a more idiomatic solution where we can identify the completion of a navigation to fragment, and send the completion event from there?
d3cced3
to
1fd7cf1
Compare
0459399
to
e8e595d
Compare
Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
e8e595d
to
2a1eb39
Compare
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>
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
.webdriver
setsload status send
toembedder
,constelltation
andscript thread
to listen tonavigation events
.script thread
.constellation
, then waits for document readiness state.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