73730 Commits

Author SHA1 Message Date
Callum Law
acc8b90549 LibWeb: Improve gradient position serialization
Some checks failed
CI / Linux, arm64, Sanitizer, Clang (push) Has been cancelled
CI / macOS, arm64, Sanitizer, Clang (push) Has been cancelled
CI / Linux, x86_64, All_Debug, Clang (push) Has been cancelled
CI / Linux, x86_64, Fuzzers, Clang (push) Has been cancelled
CI / Linux, x86_64, Sanitizer, GNU (push) Has been cancelled
CI / Linux, x86_64, Sanitizer, Clang (push) Has been cancelled
CI / Windows, x86_64, Windows_Sanitizer_CI, ClangCL (push) Has been cancelled
Build Dev Container Image / build (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Run test262 and test-wasm / run_and_update_results (push) Has been cancelled
Lint Code / lint (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Push notes / build (push) Has been cancelled
Nightly Lagom / Linux, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / Linux, arm64, Sanitizer, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Distribution, GNU (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Windows, x86_64, Windows_Sanitizer_CI, ClangCL (push) Has been cancelled
Nightly Lagom / Flatpak aarch64 (push) Has been cancelled
Nightly Lagom / Flatpak x86_64 (push) Has been cancelled
Nightly Android / CI (macos-14, Android) (push) Has been cancelled
Close stale PRs / stale (push) Has been cancelled
`EdgeStyleValues` which consist of an offset of a `calc()`s which
resolves to 50% should be considered "centered" for
`SerializationMode::ResolvedValue` for the purpose of omitting the
position value from gradient serialization.
2026-01-02 11:43:10 +01:00
Callum Law
6964593377 LibWeb: Add absolutized method to EdgeStyleValue
Fixes #7192.

We absolutize `EdgeStyleValue` to always be relative to the top/left
edge which allows for some simplification.
2026-01-02 11:43:10 +01:00
Callum Law
727058dfcd LibWeb: Add absolutized method to PositionStyleValue
This is a non-functional change for now since it's descendent
`EdgeStyleValue`s don't yet have their corresponding `absolutized`
method
2026-01-02 11:43:10 +01:00
Callum Law
e6ddb7db9e LibWeb: Store EdgeStyleValue sub-values directly
As well as being required to implement absolutization this also means we
now bypass a limitation with `LengthPercentage` where we would always
use `SerializationMode::Normal` for the constituent lengths which gains
us some WPT passes
2026-01-02 11:43:10 +01:00
Callum Law
6d12c94800 LibWeb: Simplify parsing of background-position-{x,y} 2026-01-02 11:43:10 +01:00
Callum Law
9c93fdbd9a Tests: Import some WPT background position parsing tests 2026-01-02 11:43:10 +01:00
Gingeh
789ab3cc57 LibWeb: Declare namespace prefixes in parse_xml_fragment 2026-01-02 11:09:19 +01:00
Undefine
7f42cf3a0e LibGfx: Switch Vulkan image sharing mode to VK_SHARING_MODE_EXCLUSIVE
The validation layers complain if it's set to concurrent and we have
only one queue.
2026-01-02 10:23:46 +01:00
Undefine
d71e5f676f LibGfx: Remove incorrect Vulkan queue family index from image creation
This does not seem to impact functionality and gets rid of a validation
layer warning.
2026-01-02 10:23:46 +01:00
Undefine
988f631cdf LibGfx: Request the VK_EXT_external_memory_dma_buf Vulkan extensions
Otherwise the validation layers complain that this is required when
using VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT as an image
handle.
2026-01-02 10:23:46 +01:00
Undefine
8601430f5b LibGfx: Request the VK_KHR_image_format_list Vulkan extensions
Otherwise the validation layers complain that it's required by
`VK_EXT_image_drm_format_modifier`.
2026-01-02 10:23:46 +01:00
InvalidUsernameException
375020d8ce LibWeb: Do not attempt to access elements of empty list
This recovers 750+ WPT subtests that were lost when
https://github.com/web-platform-tests/wpt/pull/56913 was merged and
added new testcases, two of which exposed this crash.

I have added my own testcase instead of importing the affected WPT tests
since they are large and complex, which makes it hard to understand
where the problem is coming from based on them alone. Also this is only
a crash test (i.e. not a different kind) because the tested scenario
doesn't actually behave correctly yet for seemingly unrelated reasons.
2026-01-02 10:14:07 +01:00
R-Goc
c8b30f5bb8 Meta: Remove incorrect warning suppresion on win32
This warning being suppressed hid an issue which led to undefined
behavior.
2026-01-01 12:23:15 +01:00
R-Goc
15cb3e872e LibWeb: Use static cast to cast from base class
It is not guaranteed that inherited classes have the same address as the
base of the derived class. In that case a reinterpret cast leads to
undefined behavior. This occured on msvc ABI. See:
https://godbolt.org/z/jGeEW3c48

Co-authored-by: ayeteadoe <ayeteadoe@gmail.com>
2026-01-01 12:23:15 +01:00
Lorenz A
953b33d273 Tests/LibWeb: Do not wait so long to cancel previous playEffect 2025-12-31 18:25:22 +01:00
Zaggy1024
fb2d9e3c85 LibCore: Only wake the event loop in deferred_invoke from other threads
For some reason, writing to the wake fd from the same thread in
deferred_invoke was causing a deadlock. However, we don't actually need
to wake from the same thread, since the event loop is not waiting and
will therefore process the deferred_invoke on the next iteration.

This issue was introduced in 3742138cc3.
The deadlock could be reproduced consistently by increasing
LOCAL_STORAGE_QUOTA in StorageJar.cpp to a large value like 50 MiB.
2025-12-31 10:41:51 +01:00
Zaggy1024
87c3053370 LibCore: Allow checking for a ThreadEventQueue without creating one 2025-12-31 10:41:51 +01:00
Arran Ireland
bd82dfa048 AK+LibURL: Use AK::IPv4/6 in Host
This resolves two FIXME comments.
2025-12-31 10:24:56 +01:00
Sam Kravitz
bef8423f0f AK: Rename CaseInsensitiveStringTraits
To CaseInsensitiveASCIIStringTraits. This change indicates that these
traits are about ASCII-only insensitivity.
2025-12-31 10:24:42 +01:00
Shannon Booth
865b2b88b0 LibWeb/HTML: Fix Origin.from(value) for Window objects
I had completely managed to forget about the special case of Window
where a WindowProxy is what is received over IDL. This was caught
by the origin-from-window WPT test, but unfortunately this cannot
be imported as it relies on a web server running and other
surroundsing WPT infrastructure.
2025-12-30 18:50:05 +01:00
Jelle Raaijmakers
45ab134de9 CI: Use self-hosted macOS runners for nightly builds
These have been broken for a while now. Add the `self-hosted` tag so we
at least use the same runners we already use for PR checks.
2025-12-30 17:10:16 +01:00
Tete17
460244c5a8 LibWeb: Add encap & decap WPT tests
For now only the most basic test pass but it is a beginning.
2025-12-30 14:16:35 +01:00
Tete17
1e6b5a6f81 LibWeb: Set the extractable and usages fields of the generated key
This was a spec bug updated in
https://github.com/WICG/webcrypto-modern-algos/pull/39
2025-12-30 14:16:35 +01:00
Tete17
bbf70e320f LibWeb: Allow symmetric algorithms to be imported with RawSecret
This new format is equivalent to the old Raw.
2025-12-30 14:16:35 +01:00
Tete17
a414819dd6 LibWeb: Support the importing of ml-kem keys in spki format 2025-12-30 14:16:35 +01:00
Tete17
6350b063ab LibWeb: Implement encapsulation for ML-KEM algorithms 2025-12-30 14:16:35 +01:00
Tete17
013cf34d1b LibWeb: Implement key generation for ML-KEM algorithms 2025-12-30 14:16:35 +01:00
Tete17
336929c5a3 LibWeb: Add TemporaryExecutionContext to encapsulate/decapsulate methods
Some operations like retrieving the algorithm name require it.
2025-12-30 14:16:35 +01:00
Tete17
26a9551db2 LibWeb: Correctly transform EncapsulatedKey into an ECMAScript object
The spec prefers camel case, but we internally use snake case.
2025-12-30 14:16:35 +01:00
Tete17
ec67f0ae8d LibWeb: Change return type of encapsulate for AlgorithmMethods
The standard ask to turn EncapsulatedBits into an ECMAScript Object
which means it must initially live in the host stack.
2025-12-30 14:16:35 +01:00
Tete17
63c99f3703 LibWeb: Correctly check the usage of the encapsulation key 2025-12-30 14:16:35 +01:00
Tete17
18cf5db272 LibCrypto: Support the parsing of certs and keys for ml-kem keys 2025-12-30 14:16:35 +01:00
Tete17
5348e97f87 LibCrypto: Implement encapsulation for ML-KEM algorithms 2025-12-30 14:16:35 +01:00
Tete17
92fdc97d98 LibCrypto: Implement key generation for ML-KEM algorithms 2025-12-30 14:16:35 +01:00
Tete17
cabcf3ed66 LibCrypto: Add wrapper to EVP_PKEY_get_octet_string_param 2025-12-30 14:16:35 +01:00
Shannon Booth
89dbdd3411 LibURL: Add domain concept to URL::Origin to fix same-origin-domain
The same-origin domain check always returned true if only the scheme
matched. This was because of missing steps to check for the origin's
domain, which didn't exist. Add this concept to URL::Origin, even
though we do not use it at this stage in document.domain setter.

Co-Authored-By: Luke Wilde <luke@ladybird.org>
2025-12-30 13:02:10 +01:00
Gingeh
04b4cd9e00 LibWeb: Treat near-zero aspect-ratios as degenerate 2025-12-30 12:45:31 +01:00
Shannon Booth
f9a996650b LibWeb/HTML: Implement the Origin interface
See: https://github.com/whatwg/html/commit/68909b2
2025-12-30 12:40:27 +01:00
Shannon Booth
2c11e03582 LibURL: Return a proper registrable domain if it's missing in the PSL
Instead of '*', which is a nonsensical value. Similar to what we do
for determining the public suffix, if no match could be made via the
PSL algorithm, then take everything after the second dot as
the registrable domain.

This prevents us from considering e.g. b.b.example and
a.example as the same site.
2025-12-30 12:40:27 +01:00
Shannon Booth
5eac5a94cf LibJS: Implement an as_if<T> helper for JS::Value
This is to make it much easier when trying to pull out an object
of a specific type from a JS::Value, instead of needing to do the
repetitive checking that it is an object, getting that object,
checking that object is of a specific type, then casting to that
type.
2025-12-30 12:40:27 +01:00
Gingeh
5c0e707f01 LibWeb: Don't crash when rounded background image is too large 2025-12-30 12:26:55 +01:00
Zaggy1024
744abc0c18 Tests: Use some tasks when testing PlaybackStream
This doesn't help to reproduce the potential UAF in the previous
commit, but it doesn't hurt to include this nonetheless.
2025-12-29 19:58:22 -06:00
Zaggy1024
732661bce1 LibMedia: Avoid a UAF on PlaybackStreamPulseAudio in task handlers
There's no guarantee that the PlaybackStream will always live as long
as the control thread, but we don't actually need the PlaybackStream in
any of the tasks.

This is an attempt to fix a null deref in test-web, but the issue is
very rare, so it is unconfirmed. The call to InternalState->exit()
should most likely prevent such a UAF, but it's not correct to hold
a weak reference to the PlaybackStream anyway.

Since the UAF happens either rarely or not at all due to the mutexes
involved, testing this doesn't appear to be possible.
2025-12-29 19:58:22 -06:00
R-Goc
1f3e20cebf LibMedia: Add a WASAPI playback stream for Windows
Implement PlaybackStream using WASAPI. The design is similar to
PlaybackStreamAudioUnit in that it uses a task queue. A high priority
thread is used to render the stream. All the stream controls save for
the exit being requested which happens on destruction of the stream are
managed by the render thread.

Due to the design of the windows audio mixer the audio we receive must
be resampled to match the sample rate of the mixer. We use a float based
interleaved PCM stream which matches both our existing code and the
audio mixer which internally usues floats.

Having to use a mutex around a queue for the task queue is suboptimal,
in a future PR a MPSC queue could be added to AK and used instead.
2025-12-29 18:02:02 -06:00
R-Goc
8e8c2cd461 AK: Print code when formatting windows errors
This commit prints the error code associated with an error message for
easier lookup.
2025-12-29 18:02:02 -06:00
Jonathan Gamble
f6f4d7f497 LibWeb: Move <input> handle_return_key logic to HTMLInputElement 2025-12-29 19:59:42 +01:00
Jonathan Gamble
e39f73f978 LibWeb: Fix tofu in textarea newlines on MacOS
Do not insert the codepoint from the platform event. Always insert 10
2025-12-29 19:59:42 +01:00
Shannon Booth
2a8b83a568 LibWeb/WebIDL: Upgrade QuotaExceededError to its own interface
See https://github.com/whatwg/webidl/commit/48eba6d
2025-12-29 17:15:11 +01:00
Shannon Booth
c12f21498c LibWeb: Support implicit downcast to DOMException in ExceptionOr 2025-12-29 17:15:11 +01:00
Callum Law
cbd07b2153 LibWeb: Don't mark whether shorthand properties are inherited
Inheritance applies to longhands individually so whether a shorthand was
marked as inherit or not is irrelevant
2025-12-29 16:11:13 +01:00