Commit graph

70739 commits

Author SHA1 Message Date
Timothy Flynn
1aee1a050e LibJS: Use consistent naming for this value in Temporal prototypes
This is an editorial change in the Temporal proposal. See:
ed49b0b
2025-07-23 22:05:15 +02:00
Timothy Flynn
0c5c6a9944 LibJS: Use consistent wording around NewTarget in Temporal constructors
This is an editorial change in the Temporal proposal. See:
e454171
2025-07-23 22:05:15 +02:00
Luke Wilde
a2f3a5a6ce LibWeb: Send a beforeinput event for pasting
This allows us to paste text into Discord.
2025-07-23 22:04:45 +02:00
Andreas Kling
8d02f28cc2 LibWeb: Don't treat non-replaced sizes as 0 for min-content contrib
This behavior is part of the cyclic percentage contribution logic from
CSS-SIZING-3 which explicitly only applies to non-replaced boxes.

This fixes an issue on Discord where buttons in the settings UI were
cropped to a narrower width than intended.

Fixes #3572
2025-07-23 19:52:59 +02:00
aplefull
34f0ac15fd LibWeb: Resolve calculated time values in animations and transitions
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 lets us play animations and transitions when time values are
stored in the form of calculated values, such as `calc(1s + 500ms)`.
2025-07-23 15:21:23 +01:00
Luke Wilde
a2770bbcb7 LibWeb/WebSocket: Include the User-Agent header on connection
This makes the WebSockets on https://pro.kraken.com/app/trade/btc-usd
happier, but the page doesn't quite work yet.
2025-07-23 13:51:44 +01:00
Sam Atkins
943cc0e32a LibWeb/CSS: Implement "legacy value aliases" in generated code
This uses a `foo>bar` notation in the `valid-identifiers` field of
Properties.json, to say "replace `foo` with `bar`".

The motivation here is to avoid calling `parse_css_value_for_property()`
inside the per-property switch in `parse_css_value()`. Eventually we'll
need to be able to call that switch from
`parse_css_value_for_properties()` so that shorthands can make use of
any bespoke parsing code to parse their longhands.
2025-07-23 12:50:42 +01:00
Tim Ledbetter
062862f315 LibWeb/CSS: Add -webkit-filter as a legacy alias
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-07-23 09:32:39 +02:00
Glenn Skrzypczak
6e6507c8c5 LibWeb/HTML: Sanitize email input with multiple attribute
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (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 implements the missing part of the value sanitization algorithm
for email inputs with the multiple attribute.
2025-07-22 23:02:33 +01:00
Timothy Flynn
04fe0c6aec LibJS: Create match indices based on code unit length
In Unicode mode, we were mixing code units (start_index) with code point
length (end_index).
2025-07-22 23:11:19 +02:00
Timothy Flynn
772479b334 LibJS: Fix typo in GetMatchIndexPair definition 2025-07-22 23:11:19 +02:00
ayeteadoe
77d9508618 LibWeb/CSS: Fix implicit narrowing cast in interpolate_rotate
The changes introduced in 484a09d6a2
broke the Windows LibWeb build, so this fixes that
2025-07-22 13:21:17 -06:00
Timothy Flynn
6ddbb70051 AK: Remove constexpr specifier from Utf16View::bytes()
The Span constructor used here uses reinterpret_cast under the hood, so
it and Utf16View::bytes() cannot be constexpr.
2025-07-22 13:33:51 -04:00
Jelle Raaijmakers
9bf250c8d1 LibLine: Correctly handle consumed code points in Editor
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
We should not compare code point offsets to byte offsets, but compare
the consumed code points to the input's length expressed in code points
instead.

Relates to #5547.
2025-07-22 18:49:14 +02:00
Jelle Raaijmakers
526615bc10 LibWeb: Stub Navigator.getGamepads() 2025-07-22 11:55:29 -04:00
Jelle Raaijmakers
cdb736bea5 LibWeb: Remove WrappingReference from IDLGenerators
We have no cases where WrappingReferences::No does not result in the
right wrapper expression, so let's remove the enum.
2025-07-22 11:55:29 -04:00
ayeteadoe
2e2484257d LibJS: Enable EXPLICIT_SYMBOL_EXPORT and annotate minimum symbol set 2025-07-22 11:51:29 -04:00
ayeteadoe
539a675802 LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT
This reverts commit c14173f651. We
should only annotate the minimum number of symbols that external
consumers actually use, so I am starting from scratch to do that
2025-07-22 11:51:29 -04:00
Timothy Flynn
42b41431eb AK+LibJS: Enforce limits in Utf16View offset computations
RegExp was the only caller relying on being able to provide an offset
larger than the string length. So let's do a pre-check in RegExp and
then enforce that the offsets we receive in Utf16View are valid.
2025-07-22 17:17:33 +02:00
Timothy Flynn
ad7ac679fd AK: Compute Utf16View::code_point_offset_of correctly
There were a couple of issues here, including the following computation
could actually overflow to NumericLimits<size_t>::max():

    code_unit_offset -= it.length_in_code_units();
2025-07-22 17:17:33 +02:00
Timothy Flynn
f595e47c1f AK: Add unit tests for Utf16View::code_unit_offset_of 2025-07-22 17:17:33 +02:00
Timothy Flynn
0bbb725bcd AK: Mark a couple of methods in Utf16View.h as constexpr 2025-07-22 17:17:33 +02:00
Jelle Raaijmakers
265e278275 AK: Allow indexing at length in Utf8View::byte_offset_of()
And do the same for Utf8View::code_point_offset_of(). Some of these
`VERIFY`s of the view's length were introduced recently, but they caused
the parsing of named capture groups in RegexParser to crash in some
situations.

Instead, allow indexing at the view's length: the byte offset of code
point `length()` is known, even though that code point does not exist in
the view. Similarly, we know the code point offset at byte offset
`byte_length()`. Beyond those offsets, we still crash.

Fixes 13 failures in test262's `language/literals/regexp/named-groups`.
2025-07-22 09:10:32 -04:00
Jelle Raaijmakers
3db7d802db LibRegex: Early return in Parser::try_skip()
No functional changes.
2025-07-22 09:10:32 -04:00
Jelle Raaijmakers
a6dfc6cdff LibWeb: Resolve NavigatorBeacon FIXME regarding the partial interface 2025-07-22 13:07:06 +01:00
Jelle Raaijmakers
529ab9d88a Meta: Allow partial interface when formatting IDL files 2025-07-22 13:07:06 +01:00
Jelle Raaijmakers
1da304f7b7 LibIDL: Support partial interfaces
Partial interfaces have the same name as the interface they extend, and
can appear in any order. In practice, we import the partial interfaces
into the main interface's IDL.
2025-07-22 13:07:06 +01:00
Luke Wilde
9c5dff5be0 RequestServer+LibWebSocket: Drain underlying socket and resulting frames
`curl_easy_recv` must be called in a loop until it returns EAGAIN,
because it may cache data, but only activate the read notifier once.

Additionally, the data received can contain multiple WebSocket frames
and only activate the notifier once, so we have to keep reading frames
until there isn't enough data.

We also have to do this immediately after connecting a WebSocket,
since the server may immediately send data when the WebSocket opens
and before we create the read notifier.

This makes Discord login faster and more reliable, and makes Discord
activities start loading.
2025-07-22 13:55:45 +02:00
Tim Ledbetter
484a09d6a2 LibWeb: Support interpolating rotate values 2025-07-22 11:09:45 +01:00
Tim Ledbetter
cf33dec6d6 LibWeb: Extract SLERP algorithm into its own method
No functional changes.
2025-07-22 11:09:45 +01:00
norbiros
ab574deb93 Tests: Import some css/css-properties-values-api WPT tests
Casual import of 4 WPT tests related to `CSS.registerProperty`
2025-07-22 10:57:54 +01:00
norbiros
90c0decd95 LibWeb/CSS: Add CSS.registerProperty JS method
This adds an *almost* complete implementation of `CSS.registerProperty`
method enabling further progress on the `@property` feature.
2025-07-22 10:57:54 +01:00
Andreas Kling
038d8ade50 LibWeb: Always parse calc() inside CSS color functions consistently
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
Before this change, calc() would resolve to different types depending on
the nearest containing value context. This meant that rgb(calc(), ...)
by itself worked correctly due to fallbacks, but rgb(calc(), ...) inside
e.g a linear-gradient would create a calc() value that resolves to a
length, which subsequently got rejected by the color value parser.

Fixing this makes various little gradients show up on Discord.
2025-07-22 08:47:22 +01:00
Jelle Raaijmakers
5d19aacce7 LibJS: Do not directly append RegExp pattern code points during parse
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
There apparently is a bit of a disconnect between the spec asking us to
construct the pattern using code points and LibRegex not being able to
swallow those. Whenever we had multi-byte code points in the pattern and
tried to match that in unicode mode, we would fail.

Change the parser to encode all non-ASCII code units. Fixes 2 test262
cases in `language/literals/regexp`.
2025-07-22 01:23:52 +02:00
Jelle Raaijmakers
7f6b70fafb LibRegex: Use code unit length in Matcher<Parser>::match()
We were calling into `view.length()`, which potentially returned the
code _point_ length for Utf16Views. Make sure we use the code unit
length instead, since we're only indexing into code units.
2025-07-22 01:23:52 +02:00
Jelle Raaijmakers
930ac9898f LibRegex: Simplify ternary condition in RegexByteCode
No functional changes.
2025-07-22 01:23:52 +02:00
Tim Ledbetter
92f85d180e LibWeb: Serialize empty ImageBitmap data as null 2025-07-21 19:19:50 -04:00
Tim Ledbetter
854d48f973 LibWeb: Use correct angle type when serializing hue-rotate filter values
At some point `hue-rotate` was changed to use `AngleOrCalculated`
rather than `Angle`, but `Angle` was still being used in a `visit`,
which otherwise defaulted to zero. This caused all `hue-rotate` angles
to serialize to zero.
2025-07-22 00:53:10 +02:00
Tim Ledbetter
d38fac7518 LibWeb/SVG: Ignore view boxes with negative width or height 2025-07-22 00:52:24 +02:00
Tim Ledbetter
a990de65e4 LibWeb: Implement SVGViewElement
This identifies a particular region of an SVG image, which can then be
linked to by an SVG fragment identifier.
2025-07-22 00:52:24 +02:00
Timothy Flynn
81fc8ab8cc LibRegex: Rename a couple of RegexStringView methods for clarity
`operator[]` -> `code_point_at`
`code_unit_at` -> `unicode_aware_code_point_at`

`unicode_aware_code_point_at` returns either a code point or a code unit
depending on the Unicode flag.
2025-07-21 23:44:18 +02:00
Timothy Flynn
2dfcc4c307 LibRegex: Compare code units (not code points) in non-Unicode char range 2025-07-21 23:44:18 +02:00
Andreas Kling
e749be2295 LibWeb: Only cascade relevant CSS properties for logical alias context
We only need the cascaded values for writing-mode and direction when
resolving the logical alias context, so we can skip all other
properties.
2025-07-21 20:37:17 +01:00
Luke Wilde
8210a7b3e3 LibWeb: Resolve FontFaceSet::load promise with all loaded FontFaces
Some checks failed
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
Build Dev Container Image / build (push) Has been cancelled
The resulting array is required on https://www.canva.com/
2025-07-21 16:29:55 +01:00
dmaivel
52a23dc02e AK+LibWeb/CSS: Add lower-greek counter style 2025-07-21 15:18:17 +01:00
Sam Atkins
938f27bbe3 LibWeb/CSS: Update UA styling for view-transition pseudo-elements
And also indent the file consistently.

Corresponds to 3d13816af7
2025-07-21 15:29:31 +02:00
Timothy Flynn
8600c5149b LibCrypto: Allow moving SignedBigInteger / UnsignedBigInteger
We defined copy operations but not move operations, so every existing
move() resulted in a copy.
2025-07-21 15:17:53 +02:00
Timothy Flynn
cd73c70ad6 LibCrypto: Copy the cached hash in SignedBigInteger / UnsignedBigInteger
The hash computation for big integers is pretty expensive, so if we have
a cached hash when copying a big int, let's also copy the hash.
2025-07-21 15:17:53 +02:00
Luke Wilde
0faf96fa1b Meta/curl: Update to 8.15.0
This includes the patch for issue 17917, so we can remove our custom
patch :^)
2025-07-21 15:09:35 +02:00
Aliaksandr Kalenik
4319e6b80e LibWeb: Don't put unlayered rules into into empty "service" layer
Fixes bug when `build_matching_rule_set()` mistakenly included all
unlayered rules twice. This was caused by mistakenly including all
unlayered rules into `""` named "service" layer, because we couldn't
tell if FlyString = `""` means no layer or layer named `""`.
2025-07-21 12:33:35 +01:00