mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
WebContent+WebDriver: Asynchronously wait for navigations to complete
Similar to commit c2cf65adac
, we should
avoid spinning the event loop from the WebContent-side of the WebDriver
connection. This can result in deadlocks if another component in LibWeb
also spins the event loop.
The AO to await navigations has two event loop spinners - waiting for
the navigation to complete and for the document to reach the target
readiness state. We now use NavigationObserver and DocumentObserver to
be notified when these conditions are met. And we use the same async IPC
mechanism as script execution to notify the WebDriver process when all
conditions are met (or timed out).
This commit is contained in:
parent
8598d4670d
commit
bf0bc62654
Notes:
github-actions[bot]
2024-10-26 09:26:47 +00:00
Author: https://github.com/trflynn89
Commit: bf0bc62654
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1967
11 changed files with 157 additions and 53 deletions
|
@ -389,6 +389,9 @@ void PageClient::page_did_request_media_context_menu(Web::CSSPixelPoint content_
|
|||
void PageClient::page_did_request_alert(String const& message)
|
||||
{
|
||||
client().async_did_request_alert(m_id, message);
|
||||
|
||||
if (m_webdriver)
|
||||
m_webdriver->page_did_open_dialog({});
|
||||
}
|
||||
|
||||
void PageClient::alert_closed()
|
||||
|
@ -399,6 +402,9 @@ void PageClient::alert_closed()
|
|||
void PageClient::page_did_request_confirm(String const& message)
|
||||
{
|
||||
client().async_did_request_confirm(m_id, message);
|
||||
|
||||
if (m_webdriver)
|
||||
m_webdriver->page_did_open_dialog({});
|
||||
}
|
||||
|
||||
void PageClient::confirm_closed(bool accepted)
|
||||
|
@ -409,6 +415,9 @@ void PageClient::confirm_closed(bool accepted)
|
|||
void PageClient::page_did_request_prompt(String const& message, String const& default_)
|
||||
{
|
||||
client().async_did_request_prompt(m_id, message, default_);
|
||||
|
||||
if (m_webdriver)
|
||||
m_webdriver->page_did_open_dialog({});
|
||||
}
|
||||
|
||||
void PageClient::page_did_request_set_prompt_text(String const& text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue