Commit graph

70961 commits

Author SHA1 Message Date
Tete17
a73c082f36 LibWeb: Implement is_html method for TrustedTypePolicyFactory
This is used to check the legitimacy of a TrustedHTML object.
2025-08-11 12:21:31 +01:00
Tete17
0a147aa9a1 LibWeb: Implement TrustedHTML class
The TrustedHTML interface represents a string that a developer can
confidently insert into an injection sink that will render it as HTML.

These objects are immutable wrappers around a string, constructed via a
TrustedTypePolicy’s createHTML method.
2025-08-11 12:21:31 +01:00
Tete17
68c55b0ef1 LibWeb: Implement getPropertyType for TrustedTypePolicyFactory
This allows authors to check if a Trusted Type is required for the given
Elements property.

This adds 28 more passing WPT tests :)
2025-08-11 12:21:31 +01:00
Sam Atkins
4bcfc4bacc LibWeb/HTML: Add cross-site ancestor flag to environment
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Corresponds to baec061a70
2025-08-11 11:08:04 +01:00
Sam Atkins
cfdc4bad7c LibWeb: Update more navigation code to spec
Partly corresponds to 80ebad5fbf

This is mostly to handle null source_documents, which is something that
needs more work elsewhere. The spec change above is about the deferred
fetch quota.
2025-08-11 11:08:04 +01:00
Sam Atkins
0e5fd11bdc LibWeb/HTML: Create navigation params for browser-UI navigations
Step 4 corresponds to 3b6a99b1d9

The rest is from some earlier spec change.
2025-08-11 11:08:04 +01:00
Sam Atkins
cf969abba7 LibWeb/HTML: Add missing "else" to create_navigation_params_by_fetching 2025-08-11 11:08:04 +01:00
Sam Atkins
0b998b8379 LibWeb: Update base URL change processing
Corresponds to 49f5cd381e
2025-08-11 11:08:04 +01:00
Sam Atkins
7c8c05ee82 LibWeb/Layout: Support visibility:collapse on table-row elements
When a table row (or its group) is set to collapse, the row takes up no
vertical space in the layout.

We have to account for this in multiple places, so I've cached whether a
row is collapsed in the TableGrid::Row.
2025-08-11 11:07:47 +01:00
Sam Atkins
3b97bdc7bf Tests: Import WPT tests for table rows with visibility:collapse
These mostly fail for now.
2025-08-11 11:07:47 +01:00
Sam Atkins
5f986b2c33 LibWeb/Painting: Paint ridge and groove border styles 2025-08-11 11:07:15 +01:00
Sam Atkins
5d4a4e44fe LibWeb/Painting: Paint border-style: double using two solid borders
Call paint_border() recursively, once for the outer line, and once for
the inner one. This is done in a lambda so that we can reuse it for a
couple of other line styles.

Border-radius behaviour doesn't match other browsers, and goes a bit
haywire in some cases. I've left some FIXMEs for someone who
understands the maths here better than I do. 😅

The LineStyle handling is moved to the start of the function, to avoid
unnecessary work.
2025-08-11 11:07:15 +01:00
Sam Atkins
c660df70b4 LibWeb/Painting: Note that inset and outset borders are implemented 2025-08-11 11:07:15 +01:00
Sam Atkins
7c2b8f6ee7 LibWeb/Painting: Move per-edge getter into BordersDataDevicePixels
Reduces some duplication.
2025-08-11 11:07:15 +01:00
Timothy Flynn
e2b245add1 LibJS: Handle out-of-range prefixed numbers in Token::double_value
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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 regressed in cd15b1a2c9.

If a prefixed number is out-of-range of a u64, stroul would previously
fall back to ULONG_MAX. This patch restores that behavior.
2025-08-10 13:35:37 +02:00
Aliaksandr Kalenik
652a457f52 LibWeb: Fix grid layout for replaced items with percentage max-width
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
CSS grid specification states that for grid items with a replaced
element and a percentage preferred size or maximum size, the percentage
should be resolved against 0 during content-based minimum size
calculation. This makes sense, as it prevents replaced items from
overshooting their grid track while intrinsic track sizes are
calculated, and allows later track size resolution steps to scale
replaced items to fit their grid track.
2025-08-10 11:07:02 +02:00
Timothy Flynn
57b5df21c7 LibWeb: Select the entire input when double clicking password fields
This matches the behavior of other browsers, and hides any indication
of word boundaries in the password.
2025-08-10 11:05:49 +02:00
Timothy Flynn
ded337cfec LibWebView: Gracefully handle RequestServer death
This works exactly the same as ImageDecoder death handling.
2025-08-10 11:02:50 +02:00
Timothy Flynn
b1b218596f LibWeb+WebContent: Add IPC to re-establish RequestServer connections 2025-08-10 11:02:50 +02:00
Timothy Flynn
6f4be4791a LibRequests: Add hooks to handle RequestServer death 2025-08-10 11:02:50 +02:00
Timothy Flynn
e421c233a6 LibWebView: Ignore ImageDecoder death during process shutdown 2025-08-10 11:02:50 +02:00
Timothy Flynn
58f5fe7d79 RequestServer: Add an IPC method to reconnect N request clients
Similar to the same IPC on ImageDecoder, this just avoids IPC churn.
2025-08-10 11:02:50 +02:00
ayeteadoe
78a08bac82 LibWasm: Fix Windows build
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
2025-08-09 16:41:37 -06:00
Tim Ledbetter
b15c4cccbf LibWeb: Ignore non-element nodes when evaluating filters
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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 prevents an unknown filter debug message would be printed for
comments.
2025-08-08 23:54:17 +01:00
Idan Horowitz
81e3afd1fd LibWeb+LibWebView: Implement emitting CookieChangeEvents
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
2025-08-08 13:09:58 -04:00
Idan Horowitz
a72a0b3c2d LibWeb+LibWebView: Move RFC6265 helpers to LibWeb
This will make them usable by LibWeb's CookieStore code as well.
2025-08-08 13:09:58 -04:00
Idan Horowitz
93692242b9 AK: Implement take_all_matching(predicate) API in HashMap 2025-08-08 13:09:58 -04:00
Idan Horowitz
5097e72174 AK: Implement take_all_matching(predicate) API in HashTable 2025-08-08 13:09:58 -04:00
Idan Horowitz
70efa8c1c5 LibWeb: Implement CookieChangeEvent 2025-08-08 13:09:58 -04:00
Idan Horowitz
185f8f7d56 LibWeb: Implement CookieStore::delete(options) 2025-08-08 13:09:58 -04:00
Idan Horowitz
d62fea0340 LibWeb: Implement CookieStore::delete(name) 2025-08-08 13:09:58 -04:00
Idan Horowitz
f724f542ed LibWeb: Implement CookieStore::set(options) 2025-08-08 13:09:58 -04:00
Idan Horowitz
1f37130703 LibWeb: Implement CookieStore::set(name, value) 2025-08-08 13:09:58 -04:00
Idan Horowitz
1328754fb0 LibWeb: Implement CookieStore::getAll(options) 2025-08-08 13:09:58 -04:00
Idan Horowitz
972e4e2cfc LibWeb: Implement CookieStore::get(options) 2025-08-08 13:09:58 -04:00
Idan Horowitz
536158878d LibWeb: Implement CookieStore::getAll(name) 2025-08-08 13:09:58 -04:00
Idan Horowitz
5545d38d7a LibWeb: Implement CookieStore::get(name) 2025-08-08 13:09:58 -04:00
Idan Horowitz
dc1b7b1925 IDLGenerators: Support generating dictionary to value converter helpers
This is useful when returning dictionaries as a Promise.
2025-08-08 13:09:58 -04:00
Idan Horowitz
d6c2893663 LibWeb: Add initial CookieStore support 2025-08-08 13:09:58 -04:00
Timothy Flynn
4a8c70b3a5 LibWeb: Parse CSS/image URLs using DOMURL::parse
DOMURL::parse handles blob URLs.
2025-08-08 17:47:51 +01:00
Timothy Flynn
9e474a4eb0 LibWeb: Add missing includes to SharedResourceRequest
Missing Cell.h and Ptr.h were causing a bunch of clangd errors. Also
remove unused includes while we're here.
2025-08-08 17:47:51 +01:00
Aliaksandr Kalenik
4b3a87eb14 LibJS: Add fast path for Array.prototype.shift
Makes `MicroBench/array-prototype-shift.js` 100x faster on my machine.

Progress on https://github.com/LadybirdBrowser/ladybird/issues/5725
2025-08-08 18:10:14 +02:00
Sam Atkins
7c29db6ab0 Meta: Exclude crash and screenshot tests from newline-at-eof requirement 2025-08-08 15:59:24 +01:00
Luke Wilde
4d34095b0a LibWeb/Wasm: Return Hash{Map,Table} caches by const reference
When loading Infiltrating the Airship in Ruffle, the copying of these
hash maps/tables were at least 10% of the runtime. This disappears when
returning them by const reference.
2025-08-08 16:30:37 +02:00
Sam Atkins
5bd3bc309e LibWeb/CSS: Rename color style value types
The typed-om classes will be separate.
2025-08-08 15:19:03 +01:00
Sam Atkins
6cad3f1921 LibWeb/CSS: Rename CSSColorValue -> ColorStyleValue
The typed-om class will be a separate thing.
2025-08-08 15:19:03 +01:00
Sam Atkins
99bce9a94d LibWeb/CSS: Replace CSSUnitValue with DimensionStyleValue
CSSUnitValue is a typed-om type which we will implement separately in
the future. However, it still seems useful to give our dimension values
a base class. (Maybe they could be templated in the future?) So instead
of deleting it entirely, rename it to DimensionStyleValue and make its
API match our style better.
2025-08-08 15:19:03 +01:00
Sam Atkins
7157d19f56 LibWeb/CSS: Separate IntegerSV and NumberSV from CSSUnitValue
This inheritance exists for typed-om classes, but StyleValues aren't
typed-om.

Somehow this makes our z-index interpolation slightly more correct. 🎉
2025-08-08 15:19:03 +01:00
Sam Atkins
51a657ca47 LibWeb/CSS: Delete CSSNumericValue
This will need to be re-added later as a proper typed-om type, but right
now it's useless.
2025-08-08 15:19:03 +01:00
Sam Atkins
4e92ab52e3 LibWeb/CSS: Rename CSSKeywordValue -> KeywordStyleValue
The typed-om CSSKeywordValue will need to be a separate class.
2025-08-08 15:19:03 +01:00