Commit graph

3469 commits

Author SHA1 Message Date
Sam Atkins
de6df6f403 LibWeb/CSS: Parse and use CSS URL request modifiers 2025-05-03 23:22:40 +01:00
Sam Atkins
a1fb34d7f2 LibWeb/CSS: Alphabetize Enums.json 2025-05-03 23:22:40 +01:00
Shannon Booth
e476d21ed0 LibJS: Add and use PrimitiveString::length_in_utf16_code_units
I was investigating an optimization in this area, and while it
didn't seem to have a noticable improvement, it still seems
useful to apply this change.
2025-05-03 16:18:47 +02:00
Sam Atkins
560317b3d0 LibWeb/CSS: Update spec comment in calc() simplification algorithm
This was corrected in 8bcf3ada9e
2025-05-03 14:54:33 +01:00
Sam Atkins
1cb1526178 LibWeb/CSS: Remove document-URL hack from create_a_style_sheet()
We no longer need this, because we don't complete URLs during parsing,
and the location is set elsewhere when needed.
2025-05-03 12:01:43 +01:00
Sam Atkins
bc1d323ba0 LibWeb/CSS: Remove URL parameter to the CSS Parser
We no longer complete any URLs during parsing.
2025-05-03 12:01:43 +01:00
Sam Atkins
9e2e796f2d LibWeb/CSS: Use CSS::URL for font-fetching
ParsedFontFace and FontLoader now both keep track of which
CSSStyleSheet (if any) was the source of the font-face, so the URLs can
be completed correctly.
2025-05-03 12:01:43 +01:00
Sam Atkins
14fb567a0f LibWeb/CSS: Stop overwriting style sheet location after construction 2025-05-03 12:01:43 +01:00
Sam Atkins
981ede900a LibWeb/DOM: Create style element style sheets with document's base URL
This is the simplest fix I could find that resolves a buggy interaction
between this and the CSS fetch algorithms, which also doesn't regress
anything. (As far as I can tell.)
2025-05-03 12:01:43 +01:00
Sam Atkins
7a4854732a LibWeb/CSS: Make CSS::URL formattable 2025-05-03 12:01:43 +01:00
Sam Atkins
efad6e96aa LibWeb/CSS: Set CSSFontFaceDescriptors' parent rule 2025-05-03 12:01:43 +01:00
Sam Atkins
ffc01626f7 LibWeb/CSS: Load fonts using fetch
Convert FontLoader to use fetch_a_style_resource(). ResourceLoader used
to keep its downloaded data around for us, but fetch doesn't, so we use
Gfx::Typeface::try_load_from_temporary_memory() so that the font has a
permanent copy of that data.
2025-05-03 12:01:43 +01:00
Sam Atkins
f76f8dcce1 LibWeb/CSS: Return the FetchController from fetch_a_style_resource() 2025-05-03 12:01:43 +01:00
Sam Atkins
6b762331df LibGfx: Rename WOFF[2]::try_load_from_externally_owned_memory()
Typeface::try_load_from_externally_owned_memory() relies on that
external owner keeping the memory around. However, neither WOFF nor
WOFF2 do so - they both create separate ByteBuffers to hold the TTF
data. So, rename them to make it clearer that they don't have any
requirements on the byte owner.
2025-05-03 12:01:43 +01:00
Tim Ledbetter
23009779e1 LibWeb: Interpolate font-style values correctly
These are interpolated by computed value, except a value of `normal` is
treated as `oblique 0deg`.
2025-05-03 12:05:22 +02:00
Tim Ledbetter
c0f9b11070 LibWeb: Parse oblique font-style with an angle value 2025-05-03 12:05:22 +02:00
Timothy Flynn
ea77092100 LibWeb: Begin implementing SharedWorker
Some checks are pending
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Shared workers are essentially just workers that may be accessed from
scripts within the same origin. There are plenty of FIXMEs here (mostly
building on existing worker FIXMEs that are already in place), but this
lets us run the shared worker variants of WPT tests.
2025-05-02 17:48:02 -04:00
Timothy Flynn
469d5ccc4b LibWeb: Add FIXME about Worker's constructor's scriptURL parameter
TrustedScriptURL is its own interface that we haven't implemented yet.
2025-05-02 17:48:02 -04:00
Timothy Flynn
56f047119c LibWeb: Alphabetically sort LibWeb sources
I sorted this list when added shared worker sources, and this is the
fallout.
2025-05-02 17:48:02 -04:00
Timothy Flynn
912009f6b3 LibWeb: Implement navigator.clipboard.read 2025-05-02 17:46:16 -04:00
Timothy Flynn
a4e9a27343 LibWeb: Implement navigator.clipboard.write 2025-05-02 17:46:16 -04:00
Timothy Flynn
a1985e57e7 LibWeb: Implement navigator.clipboard.readText 2025-05-02 17:46:16 -04:00
Timothy Flynn
61c0f67c8c LibWeb+LibWebVew+WebContent+UI: Add IPC to retrieve the system clipboard
We currently have a single IPC to set clipboard data. We will also need
an IPC to retrieve that data from the UI. This defines system clipboard
data in LibWeb to handle this transfer, and adds the IPC to provide it.
2025-05-02 17:46:16 -04:00
Timothy Flynn
5fb5066e89 LibWeb: Initialize plain boolean in ClipboardItem::Representation 2025-05-02 17:46:16 -04:00
Timothy Flynn
4a9ed67e9d LibWeb: Do not store clipboard items in an unprotected vector 2025-05-02 17:46:16 -04:00
Bastiaan van der Plaat
832bb978f5 LibWeb: Reject CSS values with unprocessed tokens / extra semicolons 2025-05-02 11:10:02 +01:00
Bastiaan van der Plaat
b99f4872d1 LibWeb: Allow transform calculated length properties 2025-05-02 11:10:02 +01:00
Tim Ledbetter
542c3cbe51 LibWeb: Implement the transition-behavior CSS property
This specifies whether transitions should be started for transitions
whose animation behavior is discrete.
2025-05-02 11:07:19 +01:00
Jelle Raaijmakers
e57e38dafc LibWeb: Use as_if<T> in TreeNode methods
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Using `as<T>` calls into `as_if<T>`, so let's just immediately use
that for the "node of type" iterators. No functional changes.
2025-05-02 11:02:20 +02:00
Jelle Raaijmakers
295b78f7d3 LibWeb: Do not rely on the layout tree for collapsed line breaks
The editing command that relies the most on this, `insertLinebreak`,
did not perform a layout update after inserting a `<br>` which caused
this algorithm to always return false. But instead of actually building
the layout tree needlessly, we can check the DOM tree instead.
2025-05-01 15:44:26 +03:00
Psychpsyo
82387e2127 LibWeb: Avoid changing button border color on disable/hover 2025-04-30 20:13:14 +01:00
Tim Ledbetter
c72d5943e6 LibWeb: Support interpolating translate values 2025-04-30 19:36:56 +02:00
Tim Ledbetter
27baaa13e9 LibWeb: Support parsing and serializing 3D translate values 2025-04-30 19:36:56 +02:00
Tim Ledbetter
d804f1311c LibWeb: Don't serialize scale z value if it is 1 2025-04-30 19:36:56 +02:00
Sam Atkins
094c2bbc89 LibWeb/SVG: Remove remaining user of of old try_resolve_url_to() 2025-04-30 17:38:38 +01:00
Sam Atkins
326933cd93 LibWeb/CSS: Use CSS::URL for <url> and <paint> types 2025-04-30 17:38:38 +01:00
Sam Atkins
d301510ab2 Everywhere: Correct "FIMXE" typo 2025-04-30 17:38:38 +01:00
Andrew Kaster
edfaa76c90 LibWeb: Exit the current process when event loop quits during spin_until
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This is a LibWeb special. We keep running into cases where we end up
with one or more Platform or event loop spin_until() calls on the stack
after the event loop has been cancelled and the WebContent process has
been asked to exit.

To prevent too much nonsense from exiting processes early from affecting
our other, more well-behaved processes, put this special logic in the
critical path of such Web-specific event loop spins.
2025-04-30 11:12:23 -04:00
Andrew Kaster
b4f34ee860 LibWeb: Remove unnecessary VERIFY from EventLoopPlugin's deferred_invoke 2025-04-30 11:12:23 -04:00
Timothy Flynn
0cd5e99066 LibWeb: Use the correct target realm to tee a stream
We currently store Web::Fetch::Infrastructure::Response objects in the
HTTP cache. They are associated with their original realm, but when we
use a cached response, we clone it into the target realm. For example,
two <iframe> objects loading the same HTML will be in different realms.

When we clone the response, we must use the target realm throughout the
entire cloning process. We neglected to do this for the cloned response
body stream, which is cloned via teeing. The result was the the stream
for the "cloned" response was created in the original realm, causing
issues down the line when reading from that stream tried to handle read
promises on behalf of the original realm. There are protections in place
to prevent this from happening, and the cached response read would never
complete.
2025-04-30 09:30:15 -04:00
Timothy Flynn
6cc5ac8f82 LibWeb: Remove unused VM from ReadLoopReadRequest 2025-04-30 09:30:15 -04:00
Gingeh
004d1305c8 LibWeb: Don't accidentally create a layout node for display: none 2025-04-30 11:26:18 +01:00
Andrew Kaster
e5465ff8e5 LibWeb: Crash less when the main thread exits while trying to render
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Attach a 'job' to the main thread event loop, trusting that the event
loop implementation will cancel it when asked to quit. This is something
that our Unix implementation does, but isn't strictly part of the
contract of EventLoopImplementation.
2025-04-29 09:51:22 -06:00
stelar7
81d7f27c73 LibWeb/IDB: Fix record checking using the wrong key comparison 2025-04-29 17:06:17 +02:00
stelar7
c81c17c0fb LibWeb/IDB: Implement IDBObjectStore::get 2025-04-29 17:06:17 +02:00
stelar7
18a008d073 LibWeb/IDB: Implement retrieve_a_value_from_an_object_store 2025-04-29 17:06:17 +02:00
stelar7
d5cf2cee41 LibWeb/IDB: Implement IDBObjectStore::count 2025-04-29 17:06:17 +02:00
stelar7
694375d3ac LibWeb/IDB: Implement count_the_records_in_a_range 2025-04-29 17:06:17 +02:00
stelar7
64d251b36c LibWeb/IDB: Implement convert_a_value_to_a_key_range 2025-04-29 17:06:17 +02:00
Jelle Raaijmakers
6176b05ca5 LibWeb: Align editing whitespace canonicalization with other browsers
The spec calls for a couple of very specific whitespace padding
techniques whenever we canonicalize whitespace during the execution of
editing commands, but it seems that other browsers have a simpler
strategy - let's adopt theirs!
2025-04-29 15:30:34 +02:00