Commit Graph

73713 Commits

Author SHA1 Message Date
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
Callum Law
e79644bf6b LibWeb: Mark scrollbar-color property as inherited 2025-12-29 16:11:13 +01:00
Jacob M Hunter
51114d12fb Documentation: Fix typos in build instructions 2025-12-29 09:02:34 -05:00
Andreas Kling
3ee80b23d3 LibJS: Store full realized SourceRange with each AST node
We were spending way too much time converting unrealized source ranges
into line/column pairs on real web content.

This improves JS parsing speed on x.com by 1.13x
2025-12-29 13:36:01 +01:00
Aliaksandr Kalenik
711100e3b7 LibJS: Avoid unnecessary NewArray in yield* iterator method calls
Use `Op::Call` directly instead of creating a single-element array and
using `CallWithArgumentArray` when calling iterator methods (`next`,
`throw`, `return`) in `yield*` expressions.
2025-12-28 19:12:15 +01:00
Tete17
fdb01e7f93 LibWeb: Add the Crypto task source
This is used by the spec to queue tasks to resolve or reject promises
created in response to calls to methods of SubtleCrypto.
2025-12-28 18:56:50 +01:00
Tete17
305e9c1b0f LibWeb: Implement decapsulateBits for SubtleCrypto 2025-12-28 18:56:50 +01:00
Tete17
c9b8b4557d LibWeb: Implement decapsulateKey for SubtleCrypto 2025-12-28 18:56:50 +01:00
Aliaksandr Kalenik
ebcf85f6e8 LibWeb: Lowercase attribute only once in NamedNodeMap::get_attribute()
...instead of doing it on every iteration.

This function is hot in profiles on github.com landing page (invoked
through `for_each_matching_attribute()`), so this helps a bit.
2025-12-28 14:11:36 +00:00
breakgimme
4f74ced414 LibWeb: Make User-Agent updates apply to HTTP requests on reload 2025-12-28 09:11:13 -05:00
Aliaksandr Kalenik
763d638353 LibGC: Fix incorrect &cell key in GraphConstructorVisitor 2025-12-27 19:06:56 +01:00
Aliaksandr Kalenik
c26c9a9e45 LibGC: Skip not live cells in GraphConstructorVisitor
Makes `GraphConstructorVisitor` consistent with `MarkingVisitor`.
2025-12-27 19:06:56 +01:00
Aliaksandr Kalenik
ed58f85b75 LibGC: Introduce separate GC root type for "must survive GC" cells
This way `GraphConstructorVisitor` is aware of `MustSurviveGC` roots and
could include them in a dump.
2025-12-27 19:06:56 +01:00
Aliaksandr Kalenik
9a2931527a LibWeb: Use ConservativeVector in get_session_history_entries()
This way we ensure doc states traversal queue elements are visited.
2025-12-27 18:40:21 +01:00
Aliaksandr Kalenik
38af5d623c LibWeb: Avoid shifting vector elements in get_session_history_entries()
This function essentially performs a BFS traversal over document states.
With this change, we let `doc_states` grow instead of removing traversed
states, avoiding shifting elements on every iteration.

This reduces `./test-web -j 1` from ~7m to ~5m on my machine.
2025-12-27 18:40:21 +01:00
Andreas Kling
207d82f8bc LibWeb: Actually protect buffer in create_bitmap_from_bitmap_data()
We were capturing a copy of the ByteBuffer instead of moving it into the
closure.
2025-12-27 16:40:34 +01:00
Andreas Kling
692368696f LibWeb: Use the WEB_SET_PROTOTYPE_FOR_INTERFACE pattern consistently 2025-12-27 16:40:34 +01:00
Andreas Kling
0949d4d193 LibWeb: Make PseudoElementTreeNode protect its tree pointers from GC 2025-12-27 16:40:34 +01:00