This is only used for CSS style sheets. One case wants it as a String,
and the others don't care, but will in future also want to have the
source as a String.
(cherry picked from commit 8cbc2116162764479edeec78e4b2b7c41447b643;
amended to fix conflicts in two cmake files, due to serenity
still having more code_generators, and still buildling
OutOfProcessWebView.cpp. Also kept embed_as_string_view because
it's used by stringify_gml. Did this by giving embed_as_string.py
a --type= argument that defaults to string but can also be set
to string-view.)
The spec text had changed for the value of `<link>`'s location, so I've
updated that.
(cherry picked from commit 4e18fce3a586651894844c7ef0a06c774ce9eb2c)
This only iterates style sheets that are in use, so make this clear by
renaming it to `for_each_active_css_style_sheet()`.
(cherry picked from commit c29f4f69ef9a16bd63a4bf133618120068e96bf3)
This makes `<select>` elements also work outside of Tab content, for
example in the Inspector.
Co-authored-by: Tim Flynn <trflynn89@serenityos.org>
(cherry picked from commit 421fb6309f6d5ea13676c5788a3d8294631a403b;
amended to resolve conflict due to us not yet having
LadybirdBrowser/ladybird#910, so this will cause extra conflicts
when finally cherry-picking that. But that PR will need lots of
conflict resolving anyways.)
This wasn't visible, until I tried adding a top toolbar to a tab area,
which made it look silly.
(cherry picked from commit ced7b6de5e7b6fbe2b2739158d0116339901b4c3)
This is a follow up to GH-1111 to reflect the new signatures that these
functions have.
(cherry picked from commit b0fc8b67d64089587552effbe3b994cdb5967ce5)
Returns one Utf8View at a time, using a callback function to identify
code points to split on.
(cherry picked from commit 3f10a5701d9634e47111203b837283bdfc2d8b18)
Before this change, a StringView with a character-data pointer would
never compare as equal to one with a null pointer, even if they were
both length 0. This could happen for example if one is
default-initialized, and the other is created as a substring.
(cherry picked from commit ec5101a1d3cc7bc9068fa4863e16aa482536929a)
Previously it was only pushing the module context for the call to
capture the module execution context. This is incorrect, as the capture
occurs upon function construction. This resulted in it capturing the
execution context that execute_module was called from, instead of the
newly created module_context.
f87041bf3a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp (L92)
This can be demonstrated with the following setup:
index.html:
```html
<script>
var foo = 1;
</script>
<script type="module">
import {test} from "./scriptA.mjs";
</script>
```
scriptA.mjs:
```js
function foo() {
return {a: "b"};
}
export let test = await foo();
```
Before this fix, this would throw:
```
[TypeError] 1 is not a function (evaluated from 'foo')
at module code with top-level await
at module code with top-level await
at <unknown>
at <unknown>
```
Fixes#2245.
(cherry picked from commit 6319dedbcd4d6e448b4cc2615e62eba5ac576887)
Fixes a bug when https://wpt.live/css/CSS2/positioning/abspos-001.xht
saved as file fails because we incorrectly recognized its MIME type
as HTML, leading to incorrect self-closing tag handling and thus
incorrect rendering.
(cherry picked from commit 71eded0471f0c4f200ffa74094e2c3809d9a1090)
This forwards all drag-and-drop events from the UI to the WebContent
process. If the page accepts the events, the UI does not handle them.
Otherwise, we will open the dropped files as file:// URLs.
(cherry picked from commit 4833ba06eaef20053f85343a13c0307394d67ded)
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)