Commit graph

70961 commits

Author SHA1 Message Date
Timothy Flynn
173bb67004 LibJS+LibUnicode: Port Intl.RelativeTimeFormat to UTF-16 strings 2025-07-24 10:39:52 +02:00
Timothy Flynn
abcb2d42bc LibUnicode: Port Intl.PluralRules to UTF-16 strings 2025-07-24 10:39:52 +02:00
Timothy Flynn
6fe0e13474 LibJS+LibUnicode: Port Intl.DurationFormat to UTF-16 strings 2025-07-24 10:39:52 +02:00
Timothy Flynn
e637e148d4 LibJS+LibUnicode: Port Intl.NumberFormat to UTF-16 strings 2025-07-24 10:39:52 +02:00
Timothy Flynn
db2148b44a LibJS+LibUnicode: Port Intl.ListFormat to UTF-16 strings 2025-07-24 10:39:52 +02:00
Timothy Flynn
7d80aabbdb LibJS+LibUnicode: Port Intl.DisplayNames to UTF-16 strings 2025-07-24 10:39:52 +02:00
Timothy Flynn
ee01f857d1 LibJS+LibUnicode: Port Intl.DateTimeFormat to UTF-16 strings 2025-07-24 10:39:52 +02:00
Timothy Flynn
b2f053e783 LibJS+LibUnicode: Port Intl.Collator to UTF-16 strings 2025-07-24 10:39:52 +02:00
Andrew Kaster
09c031fa96 CI: Add nightly flatpak workflow
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
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (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
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 will build both aarch64 and x86_64 flatpaks nightly. The test jobs
I did with the default GitHub runners took ~1h30m for aarch64 and
~2h30m for x86_64, but this will hopefully improve over time as the
cache is built up. And be better time-wise on the blacksmith runners.

Disk space is a large concern with these flatpak builds. A naive script
on my local machine showed that we needed a max of 10.3 GiB of free
space for the x86_64 build, with clang as the compiler. For some reason,
building with default gcc 14 uses more disk space than that, bumping
up against the default 14 GiB free space limit guaranteed by GitHub for
their default runners.
2025-07-23 16:27:49 -06:00
Andrew Kaster
358a24b461 CI: Give Windows CI workflow a unique name
This should ™️ make it easier to identify the workflow in the
GitHub Actions UI pane on the website.
2025-07-23 16:27:49 -06:00
Aliaksandr Kalenik
c8b574e9b4 LibWeb: Remove animations from timeline in Element::removed_from()
`AnimationTimeline` visits pointers of all registered animations, so if
element is removed from DOM tree but its animations remain registered in
timeline, then `Animation` and owner `Element` will be kept alive until
`AnimationTimeline` is destroyed.
2025-07-23 17:50:01 -04:00
Andrew Kaster
85baf71d48 Meta: Use clang to build ladybird module in flatpak 2025-07-23 15:12:00 -06:00
Jan Koudijs
0c89b2e690 Meta: Add offline build for ANGLE flatpak module
At the same time, build with gcc instead of bundled clang.

Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
2025-07-23 15:12:00 -06:00
Andrew Kaster
7d458103a8 Meta: Move skia and angle flatpak build scripts to their own directories 2025-07-23 15:12:00 -06:00
Andrew Kaster
35f65b8dab Meta: Bump version of gn flatpak source module to rev 2255 2025-07-23 15:12:00 -06:00
Andrew Kaster
738c81877c Meta: Move build of gn module in flatpak build before angle 2025-07-23 15:12:00 -06:00
Andrew Kaster
08221c2534 Meta: Skip build directories when building Ladybird module in flatpak
flatpak-builder doesn't respect .gitignore when creating its local build
directory, so we need to explicitly skip potentially large ignored
directories to avoid bloating the flatpak build directory during builds.
2025-07-23 15:12:00 -06:00
Timothy Flynn
b3d52a8238 LibJS: Compute offsetBehaviour in ToTemporalZonedDateTime after parsing
This is an editorial change in the Temporal proposal. See:
4b83ba3
2025-07-23 22:05:15 +02:00
Timothy Flynn
e95f225362 LibJS: Correctly disallow certain calendar-based Temporal strings
This is an editorial change in the Temporal proposal. See:
d83241f
2025-07-23 22:05:15 +02:00
Timothy Flynn
3f75cf270a LibJS: Move ambiguous Temporal time string handling to a separate parser
This is an editorial change in the Temporal proposal. See:
fa3d0b9
2025-07-23 22:05:15 +02:00
Timothy Flynn
7ca3598221 LibJS: Add new spec comments to ISO 8601 early-error handlers
This is an editorial change in the Temporal proposal. See:
f8489fb
2025-07-23 22:05:15 +02:00
Timothy Flynn
3b3ff6f057 LibJS: Split up the GetTemporalUnitValuedOption AO
This is an editorial change in the Temporal proposal. See:
fcdb47e
ef04774
2070032
adf50d4
40eaeb7
aab7bee
a10d38d
06ce375
2025-07-23 22:05:15 +02:00
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