Skip to content
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

Cherry-pick 5.0625 webdriver-related ladybird PRs #25389

Merged
merged 8 commits into from
Nov 14, 2024
Merged

Conversation

nico
Copy link
Contributor

@nico nico commented Nov 14, 2024

LadybirdBrowser/ladybird#676 7th commit
LadybirdBrowser/ladybird#1021
LadybirdBrowser/ladybird#1030
LadybirdBrowser/ladybird#1209
LadybirdBrowser/ladybird#1234
LadybirdBrowser/ladybird#1389


Not quite sure about if we want LadybirdBrowser/ladybird#676. At least while we're cherry-picking, it helps reduce conflicts, so I'll pick the ones that do help – in this case, the 7th commit. Maybe we'll actually want all of it. And if not, it's easy to undo once we no longer cherry-pick.

@nico nico requested a review from trflynn89 as a code owner November 14, 2024 20:22
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 14, 2024
(cherry picked from commit b20a1d0fcddb999de372a49d213bec01bda24c10)
tcl3 and others added 7 commits November 14, 2024 16:09
(cherry picked from commit fbff0ca6a88ba52ad8a1f7ad89705ef12570af66;
amended to change a
`page_load_timeout_fired || page_load_timeout_fired || ...` that gcc's
-Wlogical-op complainted about to `page_load_timeout_fired || ...`, see
also discussion on LadybirdBrowser/ladybird#1021)
(cherry picked from commit 1b2f35c3affc4b2779c13452c2b1ec38bbf144b9)
The timers added previously in SerenityOS#1021 had no effect, as they were never
started.

(cherry picked from commit 5b09430c5efeb839242fb9db30f777cc446957d9)
Previously, the conversion assumed that the supplied timeout was in
seconds rather than milliseconds.

(cherry picked from commit b688b5d9d4cfd8f781dd05d522d9533cd6796aca)
This change updates `ExecuteScript::execute_script()` and
`ExecuteScript::execute_script()` to bring their behavior in line with
each other and the current specification text.

Instances of the variable `timeout` have also been renamed to
`timeout_ms`, for clarity.

(cherry picked from commit 107549dc86eb0a02bb6468ccfa03475114474187)
Spinning the HTML event loop allows microtasks to run (i.e. Promise
completions).

(cherry picked from commit 6f31a19c5f0b7bcae89037ceb65c474b20482ca2)
We currently spin the platform event loop while awaiting scripts to
complete. This causes WebContent to hang if another component is also
spinning the event loop. The particular example that instigated this
patch was the navigable's navigation loop (which spins until the fetch
process is complete), triggered by a form submission to an iframe.

So instead of spinning, we now return immediately from the script
executors, after setting up listeners for either the script's promise to
be resolved or for a timeout. The HTTP request to WebDriver must finish
synchronously though, so now the WebDriver process spins its event loop
until WebContent signals that the script completed. This should be ok -
the WebDriver process isn't expected to be doing anything else in the
meantime.

Also, as a consequence of these changes, we now actually handle time
outs. We were previously creating the timeout timer, but not starting
it.

(cherry picked from commit c2cf65adac78912883996153fb608dafe389b6e0)
@nico nico merged commit 2740d7d into SerenityOS:master Nov 14, 2024
12 checks passed
@nico nico deleted the pr-1021 branch November 14, 2024 22:35
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 14, 2024
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.

4 participants