This change adds a `--use-lagom-networking` flag to the WebWorker
process. Qt networking is used if this flag isn't passed. The flag is
passed the UI launches the WebWorker process unless the Qt chrome is
being run with the `--enable-qt-networking` flag.
(cherry picked from commit 886714632759c1e2feeb636388975f0e3b515839;
amended Qt/main.cpp to resolve minor conflict due to serenity not having
LadybirdBrowser/ladybird#284LadybirdBrowser/ladybird#45, and
WebWorker/CMakeLists.txt due to serenity still having
`SERENITY_SOURCE_DIR` instead of `LADYBIRD_SOURCE_DIR` --
LadybirdBrowser/ladybird#17)
Using Qt networking when running web platform tests improves
performance significantly. The time to run the subset of tests we run
on CI drops from 21.9 seconds to 8.2 seconds on my machine.
(cherry picked from commit ff2123a949446b834e6c3b0be7ca4c994d71f3e1)
Fixes this error when trying to run `gh codespaces ssh`:
error getting ssh server details: failed to start SSH server:
Please check if an SSH server is installed in the container.
I originally believed that this could never receive a null URL and the
spec was inaccurate, but it seems like it can indeed.
I don't have a distilled test, but this makes logging in with GitHub
work on https://v0.dev/
(cherry picked from commit 1a4b0ded1f802fdcc3ef9b919b5749b086471fc2;
amended to also cherry-pick LadybirdBrowser/ladybird#2358)
(cherry picked from commit f98e28912a9c700e78f6e57eb497fd3eb3134661;
amended to not delete BeepInstruction.h, and to not insert a stray
newline after lstat)
(cherry picked from commit 229b64a4b723a391c21f247d72d78cd575ace6ff;
minorly amended to fix conflict in image.cpp due to serenity in the
meantime adding webp writing support, and due to changes in Android and
Vulkan-related files that serenity doesn't have)
This means that an `<input type=password>` will show the correct number
of *s in it when non-ASCII characters are entered.
We also don't need to perform text-transform on these as that doesn't
affect the output length, so I've moved it earlier.
(cherry picked from commit c747b1c6b56156b5797fad0d8d95164f415c8b25;
amended to slightly adjust some BlockContainer and PaintableWithLines
widths, since serenity does not use harfbuzz for text shaping)
Also include a header to say what shadow root each style sheet is in, so
we can distinguish between them.
(cherry picked from commit 1849eca50326c236e46e7fc619f928aa84cd760d)
We can currently crash on WebDriver session shutdown when we receive a
Delete Session command. This destroys the WebDriver client while we are
inside the client's socket's on_ready_to_read callback. This is not
allowed by AK::Function.
To avoid this, we now only read data from the socket in the callback. We
then defer handling the message to break out of the callback.
(cherry picked from commit 47af8c673381b1ffe15c85f711463a3fbeac165e)
Very similar to commit e5877cda61eb53cd9c1eebbfaf3c35d084b2973c.
By sending as much data as we can in a single write, we see a massive
performance improvement on WPT tests that hammer WebDriver with errors.
On my Linux machine, this reduces the runtime of:
/webdriver/tests/classic/perform_actions/invalid.py
from 45-60s down to 3-4s.
(cherry picked from commit 7a15e3ee5caa9332f3f6011cc21058e6ceab838c)
We must send a Cache-Control header, which then also requires that we
respond with an HTTP/1.1 response (the Pragma cache option is HTTP/1.0).
We should also send the Content-Type header using the same casing as is
written in the WebDriver spec (lowercase).
Both of these are explicitly tested by WPT.
(cherry picked from commit e436c31b97b5e25a6064013ae9deae0f979e95dc)
First, this isn't actually helpful, as we no longer store 32-bit values
in JsonValue. They are stored as 64-bit values anyways.
But more imporatantly, there was a bug here when trying to coerce an i64
to an i32. All negative values were cast to an i32, without checking if
the value is below NumericLimits<i32>::min.
(cherry picked from commit 7b3b608cafbed8049ac7a34104c66622c1445ffc)
When we check whether navigationParams is null, we should check if it is
`NullWithError`, since `NullWithError` is equivalent to `Empty`, but is
used for error messages.
(cherry picked from commit 219cb04865fc02bfc05d39f048dd2a778714b7e1)
Previously, tests would intermittently fail because the current session
wasn't yet aware of a newly created window handle.
Co-authored-by: Timothy Flynn <trflynn89@pm.me>
(cherry picked from commit 74983e6966cd847d0830cbdca173afbd01560a4d)
This fixes an issue where the text would look very small on macOS.
(cherry picked from commit 72f425391114556973f356885dc9d4a6aeff8787;
amended to cast device_pixels_per_css_pixel() to float to pacify
-Wdouble-promotion)
This exposes BaseAudioContext.listener, which is a container for
parameters related to the configuration of an actual "listener" in 3D
space.
(cherry picked from commit 2a98f2a12d5069a2189fa38b4a7e158d84ee03ec)
I had made a stab at implementing this to determine whether it could
assist in fixing an issue where scroll_to_the_fragment was not getting
called at the appropriate time. It did not fix that issue, and actually
ended up breaking one of our in tree tests. In the meantime, factor out
this method into a standalone function.
(cherry picked from commit 41f574155df89bb5122646a0978fa8821c35fc16)
Before, the new title element got appended instead of prepended, as
nullptr was passed as the "child" argument to the insert_before()
function.
This change makes two WPT tests pass in:
http://wpt.live/html/dom/documents/dom-tree-accessors/document.title-09.html
(cherry picked from commit 3ff613712132bd3d03f44f27986f7ca5aaea8eb5)
Now that the global object correctly sets the property, we don't need
to do it here.
(cherry picked from commit 711faa8280ac4147f68ed778ad67047428329c67)
DedicatedWorkerGlobalScope is an object with a Global extended
attribute, but does not define any named property getters. This needs to
be handled by setting the prototype chain to:
DedicatedWorkerGlobalScope
^ DedicatedWorkerGlobalScopePrototype
^ WorkerGlobalScopePrototype
(This is different from something like Window, where there is an
intermediate WindowProperties object for named properties.)
Previously, we treated the GlobalMixin object as if it was a simple
prototype object, accidentally setting DedicatedWorkerGlobalScope's
prototype to WorkerGlobalScopePrototype. This caused the expression
self instanceof DedicatedWorkerGlobalScope
to return false inside workers.
This makes us pass many more of the "/xhr/idlharness.any.worker" WPT
tests than before, rather than failing early.
(cherry picked from commit d5948709cd499ef0e7bfa3c24e8c03befed115fe)
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)
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)