Commit graph

70739 commits

Author SHA1 Message Date
Sam Atkins
3b7aa736e7 LibWeb/CSS: Use ErrorReporter for media query parsing 2025-08-04 10:50:09 +01:00
Sam Atkins
1a599ceb98 LibWeb/CSS: Reject @font-face and margin rules that have a prelude
I couldn't find any WPT coverage for this, so here's a homemade test.
2025-08-04 10:50:09 +01:00
Sam Atkins
e072ddfebd LibWeb/CSS: Use ErrorReporter for rule-parsing errors
Unfortunately we already have an InvalidRuleError type defined in the
CSS Parser, so it has to be qualified here, at least for now.
2025-08-04 10:50:09 +01:00
Sam Atkins
0bd83dd996 LibWeb/CSS: Use ErrorReporter for "rule X not allowed in Y" errors
QualifiedRule::for_each_as_declaration_list() now takes a rule_name, so
that the error message can actually be useful - we only know what a
qualified rule is by context.
2025-08-04 10:50:09 +01:00
Sam Atkins
d6cfd56ae6 LibWeb/CSS: Use ErrorReporter for selector parsing errors
Also removed the error reporting from parse_a_n_plus_b_pattern() as its
caller already reports that error.
2025-08-04 10:50:09 +01:00
Sam Atkins
2a2a1986cc LibWeb/CSS: Add dump_string() method to TokenStream
This is to support error reporting. It's not the most elegant way of
getting the source CSS, but it works.
2025-08-04 10:50:09 +01:00
Sam Atkins
012f4735a7 LibWeb/CSS: Introduce structured reporting for CSS errors
Instead of random dbgln_if(CSS_PARSER_DEBUG) messages, this lets us
report what kind of error it was. Repeated errors are combined instead
of spamming the console.

Ideally this would also record where the error occurred, but not yet.
2025-08-04 10:50:09 +01:00
Sam Atkins
b7a108d7cb LibWeb/CSS: Remove unused ParseError::InternalError 2025-08-04 10:50:09 +01:00
Sam Atkins
d55626dc32 LibWeb/CSS: Remove debug logging I left in by accident 2025-08-04 10:50:09 +01:00
Sam Atkins
d86bcc795d LibWeb/CSS: Remove duplicate error reporting for invalid descriptors
parse_descriptor_value() already logs this.
2025-08-04 10:50:09 +01:00
devgianlu
b068dd732d LibWeb/Crypto: Remove RSA-PSS key import FIXMEs after spec fix 2025-08-04 10:40:53 +02:00
devgianlu
667de49a6c LibWeb/Crypto: Remove clang-format style issues FIXMEs
These FIXMEs don't mean much. If you try to inline it, you'll see it's
broken. PR review will catch it.
2025-08-04 10:40:53 +02:00
devgianlu
d71b66239b LibWeb/Crypto: Remove support applicable specification TODOs
We have a bunch of TODO/FIXME about supporting applicable specifications
for algorithms that are not mentioned in the spec. There is no plan to
have any, there is nothing to do as of now.
2025-08-04 10:40:53 +02:00
devgianlu
6281175e86 LibWeb/Crypto: Use builtin base64 encoding/decoding padding options 2025-08-04 10:40:53 +02:00
Callum Law
8a4e9f571f LibWeb: Respect letter-spacing for last glyph of each chunk
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
Previously we would omit the letter spacing for the end glyph of each
chunk in a misguided attempt to conform to the spec's instruction that
we "really should not append letter spacing to the right or trailing
edge of a line", this behaviour can be removed entirely as other
browsers (Firefox, Chrome) don't implement it either.
2025-08-03 22:23:34 +02:00
Tim Ledbetter
1d9e4a6f62 LibWeb: Parse anchor() function for inset properties 2025-08-03 22:09:31 +02:00
Idan Horowitz
ba6b82464c LibWeb: Add initial support for SVGImageElement in createImageBitmap 2025-08-03 21:47:48 +02:00
Idan Horowitz
bb6855c849 LibWeb: Add a getter for the default image bitmap of SVGImageElement
The default image bitmap is the first frame for animated bitmaps, and
the only frame for non-animated bitmaps.
2025-08-03 21:47:48 +02:00
Idan Horowitz
3b8ccf4d77 LibWeb: Add initial support for HTMLImageElement in createImageBitmap 2025-08-03 21:47:48 +02:00
Idan Horowitz
cc0496284b LibWeb: Add a getter for the default image bitmap of HTMLImageElement
The default image bitmap is the first frame for animated bitmaps, and
the only frame for non-animated bitmaps.
2025-08-03 21:47:48 +02:00
Idan Horowitz
9b11e0051c LibWeb: Support ImageBitmapOptions's resize{Width,Height} fields 2025-08-03 21:47:48 +02:00
Michael Manganiello
7fed49ea5c LibWeb: Fix local storage type in Window::local_storage()
The storage type was being incorrectly set to Session instead of Local,
apparently because of copying the implementation from
`Window::session_storage()`.

Bug introduced in commit 2066ed2318
2025-08-03 19:23:09 +02:00
Tim Ledbetter
3e8ede5dc4 LibWeb: Remove HTMLImageElement::src()
This is no longer used.
2025-08-03 17:33:06 +02:00
Tim Ledbetter
4a1740f299 LibWeb: Ensure image context menu uses the correct image source
Previously, the value of the `src` tag would always be used as the
image source URL when requesting an image context menu, which may not
be correct if an image uses a `srcset` or has a parent picture tag.
2025-08-03 17:33:06 +02:00
Emmanuel Ferdman
d821af1f24 Base: Stop relying on const-ness not being enforced by LibJS
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-03 05:37:34 -07:00
devgianlu
4e6da3b14a LibWeb/Crypto: Avoid double copies when create CryptoKeys 2025-08-03 04:52:35 -07:00
devgianlu
b4deae6abf LibWeb/Crypto: Add JWK alg attribute to Ed{448,25519} keys
Spec PR: https://github.com/WICG/webcrypto-secure-curves/pull/34
2025-08-03 04:52:35 -07:00
devgianlu
3a8984b255 LibWeb/Crypto: Add raw key length checks to {Ed,X}{448,25519} key import
Following the spec update we finally can add these checks.

Spec PR: https://github.com/WICG/webcrypto-secure-curves/pull/35
2025-08-03 04:52:35 -07:00
Aliaksandr Kalenik
41e3ddb7fa LibGfx+LibWeb: Remove aa_translation from StrokePath and FillPath
`aa_translation` is something we inherited from times when
AntiAliasingPainter was a thing. This change replaces it by applying
offset directly to path.
2025-08-03 10:42:33 +02:00
Aliaksandr Kalenik
a41d586117 LibWeb: Merge FillPathUsingPaintStyle and FillPathUsingColor
Use `Variant<PaintStyle, Gfx::Color>` in new `FillPath` instead of
duplicating two almost identical display list items.
2025-08-03 10:42:33 +02:00
Aliaksandr Kalenik
5c11a541d3 LibWeb: Merge StrokePathUsingPaintStyle and StrokePathUsingColor
Use `Variant<PaintStyle, Gfx::Color>` in new `StrokePath` instead of
duplicating two almost identical display list items.
2025-08-03 10:42:33 +02:00
Aliaksandr Kalenik
e41c85ec47 LibWeb: Replace DrawTriangleWave with StrokePathUsingColor
There's no need to have separate display list item for drawing triangle
wave when we could simply use StrokePathUsingColor. By switching to
StrokePathUsingColor we could also reduce painting because it supports
filtering out by bounding box.
2025-08-03 10:42:33 +02:00
Glenn Skrzypczak
3dd8b3230e LibWeb/HTML: Only include direction if dirname applies
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
Label PRs with merge conflicts / auto-labeler (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
Push notes / build (push) Waiting to run
This commit changes form data to only include the direction of auto
directionality form associated elements.
2025-08-02 18:27:35 +01:00
Glenn Skrzypczak
c5fc4a5ac2 Meta: Download resources referenced in action attributes of forms
Resources referenced in the action attribute of forms now also get
downloaded by the WPT import script.
2025-08-02 18:27:35 +01:00
Timothy Flynn
50fed1d65c LibWeb+LibWebView+WebContent+UI: Port the document title to UTF-16 2025-08-02 10:10:14 -07:00
Timothy Flynn
13ed6aba71 AK+LibIPC: Implement an encoder/decoder for UTF-16 strings 2025-08-02 10:10:14 -07:00
Tim Ledbetter
e36df5ea0a LibWeb: Serialize background-size auto correctly
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
When `background-size` is `auto` in both axes, the `auto` value is no
longer repeated.
2025-08-02 08:51:23 +02:00
Tim Ledbetter
c4ceec9296 LibWeb: Avoid unnecessary copies of background size values 2025-08-02 08:51:23 +02:00
Michael Manganiello
e7654c2e08 LibWeb: Fix off-by-one offset error in NodeIterator forward traversal
Some checks are pending
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
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
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
As `node->parent()` was being called before comparing `node` with
`stay_within`, the code was incorrectly allowing traversal to the
parent node even when it should not have.

This change ensures that the parent is only checked after
confirming that the current node is not the `stay_within` node.

All `dom/traversal/NodeIterator.html` WPT tests get fixed after this
change.
2025-08-02 07:38:27 +02:00
Tim Ledbetter
f2682bb544 LibWeb: Use correct animation type for border-spacing
Some checks are pending
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
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
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 follows the `css-tables` specification rather than the older CSS2
specification.
2025-08-01 15:18:17 +02:00
Tim Ledbetter
4c91b42dd2 LibWeb: Use shortest serialization for repeated style list values 2025-08-01 15:18:17 +02:00
Chase Knowlden
6b4e00bc39 LibCrypto: Implement Ed25519 Small Order Points 2025-08-01 14:31:44 +02:00
Jelle Raaijmakers
af8b256832 LibWeb: Avoid floats for BFC/FFC/GFCs with a definite width
Applicable FCs with an indefinite width simply shrink in their available
space as long as floats are intruding, but as soon as we have a definite
width we must push the box down until it it has enough space again.

Fixes #4136.
2025-08-01 14:26:12 +02:00
Jelle Raaijmakers
d27395cf1f LibWeb: Add spec links and text for BFC/FFC/GFC float intrusion behavior
No functional changes.
2025-08-01 14:26:12 +02:00
Jelle Raaijmakers
6c14e740f1 LibWeb: Remove tentative and contradictory BFC wrapping test
This tests is trying to see if we're taking into account the full margin
box width (75px - 50px) when determining whether there is enough space
to fit the BFC box. No major browser passes this test, and other tests
such as `css/CSS2/floats/new-fc-beside-float-with-margin.html` seem to
require that we ignore those margins.
2025-08-01 14:26:12 +02:00
Jelle Raaijmakers
525f609c9b LibWeb: Reuse display list command nesting level change for verification
No functional changes.
2025-08-01 14:20:51 +02:00
Jelle Raaijmakers
f28b7064ee LibWeb: Add indentation to display list dumps
Output display list dumps with an indentation level to show balanced
commands. It makes it much easier to see what is happening between e.g.
PushStackingContext and PopStackingContext, or SaveLayer and Restore.
2025-08-01 14:20:51 +02:00
Aliaksandr Kalenik
ffa6813b61 LibWeb: Delete unused DisplayListRecorder::display_list() 2025-08-01 13:00:41 +02:00
Aliaksandr Kalenik
5eef78bcd8 LibWeb: Remove params suffix from paint_{inner}outer_box_shadow 2025-08-01 13:00:41 +02:00
Aliaksandr Kalenik
b1c5026b81 LibWeb: Rename painter to recorder in DisplayListRecorderStateSaver 2025-08-01 05:25:56 -04:00