Commit graph

66204 commits

Author SHA1 Message Date
Jess
61fcccb104 Flake: Add and run formatter + Rename devshell
Add a formatter output to the flake (`nix fmt`), along with moving +
renaming the devshell so it will work by running `nix-shell` in the root
of the project.
2024-12-18 15:15:42 +00:00
Sam Atkins
6969d1eba3 LibWeb/CSS: Parse calc() as intermediate types instead of UnparsedCN
Previously we created a tree of CalculationNodes with dummy
UnparsedCalculationNode children, and then swapped those with the real
children. This matched the spec closely but had the unfortunate
downside that CalculationNodes couldn't be immutable, and couldn't know
their properties at construct-time. UnparsedCalculationNode is also a
footgun, as if it gets left in the tree accidentally we would VERIFY().

So instead, let's parse the calc() tree into an intermediate format, and
then convert each node in that tree, depth-first, into its
corresponding CalculationNode. This means each CalculationNode knows
what its children are when it is constructed, and they never change.

Apart from deleting UnparsedCalculationNode, we can also get rid of the
for_each_child_node() method that was only used by this "replace the
children" code.
2024-12-18 12:21:22 +00:00
Sam Atkins
cef1cb6aa7 LibWeb/CSS: Add Parser::Dimension::to_string()
This will be used when printing out unsupported dimensions inside calc,
for a more useful error message.
2024-12-18 12:21:22 +00:00
devgianlu
f3a9bb0a91 LibWeb: Correct WebCryptoAPI derive length behaviour
Fixes multiple slightly wrong behaviours of the `deriveBits` method
across various algorithms. Some of them might be due to a spec update.

Add tests related to fixes.
2024-12-18 13:18:40 +01:00
devgianlu
4b87467fc2 LibWeb: Update SubtleCrypto IDL according to latest spec
I suppose the IDL definition for `deriveBits` changed to make the
last parameter optional.
2024-12-18 13:18:40 +01:00
Pavel Shliak
a95303de02 LibWeb/WebAudio: Remove copy-pasted comments in DynamicsCompressorNode 2024-12-18 10:19:46 +01:00
Pavel Shliak
9232dcbde5 LibWeb/WebAudio: Set all the params in PannerNode constructor 2024-12-18 10:19:46 +01:00
Pavel Shliak
884599f1df LibWeb/WebAudio: Manage channelCountMode and channelCount for PannerNode 2024-12-18 10:19:46 +01:00
stasoid
15a96e841b Meta: Make pthread and mman available for all libraries on Windows
by default
2024-12-18 05:55:58 +01:00
Johan Dahlin
6fd7b9b6b9 LibWeb: Render otf fonts
This is required by WPT tests so we can validate the OpenType/features
are properly implemented.
2024-12-17 19:07:13 +01:00
Johan Dahlin
083f4f3d08 LibWeb: Layout/Shape font-variant-* css properties 2024-12-17 19:07:13 +01:00
Johan Dahlin
1c42d6831b LibWeb: Style font-variant-* css properties 2024-12-17 19:07:13 +01:00
Johan Dahlin
aabbe87628 LibWeb: Parse font-variant-* css properties 2024-12-17 19:07:13 +01:00
Johan Dahlin
8bd94e2593 LibWeb: Add font-variant-* css properties 2024-12-17 19:07:13 +01:00
Shannon Booth
6c691ccddc LibWeb/HTML: Add null handling for "get noopener for window open"
See: https://github.com/whatwg/html/pull/10847

Which also fixes a crash when window.open is given a blob URL which is
not present in the Blob URL registry.
2024-12-17 17:06:47 +01:00
Jelle Raaijmakers
03aafda788 CI: Post comment when PR has a merge conflict
Switch out the action with another one that actually supports posting
comments :^)
2024-12-17 07:07:16 -08:00
Jelle Raaijmakers
25e05e76c4 CI: Remove always() from job conditionals
These jobs have no dependencies on other jobs, nor should they be
uncancelable.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
cf9bf59550 CI: Remove branch conditional from nightly Android build
Apart from the fact that this workflow is failing every time, we don't
need to check the branch we're on since it's only invoked for the
default branch of the repository. We can also remove the `always()`
since there are no job dependencies nor do we want this to be
uncancelable.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
b00bb05b6b CI: Refactor branch matching in jobs
Matching `master` can be a bit simpler and prevent invoking the job
altogether. Additionally, we don't need an `always()` here: we don't
have job dependencies and we want these jobs to be cancelable.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
8ddd9ea5f4 CI: Convert paths-ignore into separate job that checks changed paths
We need to invoke the CI jobs every time, even if nothing relevant has
changed, because we marked them as required status checks for PRs. If
they are not invoked, the associated status checks remain in a 'pending'
state indefinitely not allowing us to (auto-)merge the PR.
2024-12-17 05:20:58 -08:00
Jelle Raaijmakers
1b01464e41 CI: Add permissions to merge conflict labeler
This was not necessary in my own test repository, but maybe we need it
here regardless.
2024-12-17 13:58:34 +01:00
Jelle Raaijmakers
9ccaa3b7eb CI: Automatically label PRs with merge conflicts
This action adds and removes the new "conflicts" label to indicate
whether a pull request is in need of conflict resolution. This both
automatically informs the author of the PR that this is the case, if
they have notifications enabled that is, and makes for an easier
evaluation of the PR queue.
2024-12-17 13:53:23 +01:00
Feng Yu
e0c0668f3d LibWeb: Avoid re-encoding response headers
isomorphic encoding a value that has already been encoded will
result in garbage data. `response_headers` is already encoded in
ISO-8859-1/latin1, we cannot use `from_string_pair`, as it triggers
ISO-8859-1/latin1 encoding.

Follow-up of https://github.com/LadybirdBrowser/ladybird/pull/1893
2024-12-17 13:44:10 +01:00
Luke Wilde
3063be11a9 LibWeb/WebAudio: Implement BaseAudioContext#createPanner
Required by Unity Web games.
2024-12-17 13:38:20 +01:00
Luke Wilde
4f691c2410 LibWeb/WebAudio: Implement PannerNode
Required by https://scottts.itch.io/different-strokes
2024-12-17 13:38:20 +01:00
stasoid
27a654c739 LibGC: Port to Windows 2024-12-17 12:14:41 +01:00
stasoid
969fb1a3a8 LibRequests: Port to Windows 2024-12-17 11:07:53 +01:00
stasoid
212cea4535 LibCore: Add System::getpid 2024-12-17 11:07:53 +01:00
devgianlu
94374f0d19 LibWeb: Implement AES-KW in WebCryptoAPI
Add support for AES-KW for key wrapping/unwrapping. Very similar
implementation to other AES modes.

Added generic tests for symmetric import and specific AES-KW ones.

Adds ~400 test passes on WPT. Now we do better than Firefox in
`WebCryptoAPI/wrapKey_unwrapKey`!
2024-12-17 11:00:14 +01:00
devgianlu
1d94d678b3 LibCrypto: Implement AES-KW
Add the AES-KW (Key Wrap) implementation as of
https://www.rfc-editor.org/rfc/rfc3394#section-4.2.

Tests are taken from section 4 of RFC3394.
2024-12-17 11:00:14 +01:00
Luke Warlow
0a02eb639d LibWeb: Implement popover's close watcher
Auto popovers now correctly establish a close watcher when shown.

This means popovers now correctly close with an escape key press.

Also correctly hide open popovers when removed from the document.
2024-12-17 04:55:55 +01:00
InvalidUsernameException
09a55e56ee LibWeb: Add support for object-fit: scale-down 2024-12-16 20:47:32 +01:00
sideshowbarker
1b165d887b LibWeb: Support the ARIA “sectionheader” & “sectionfooter” roles 2024-12-16 06:56:31 -08:00
Timothy Flynn
203267fcc2 LibWeb: Do not worry about small OOM in JsonWebKey::parse
We do not concern ourselves with small OOM handling any longer. But the
main point of this patch is that we are for some reason getting a build
error with clang-19 here about ignoring a nodiscard return type inside
JsonArray::try_for_each.
2024-12-16 06:46:36 -08:00
Shannon Booth
e5436ce593 LibWeb/HTML: Remove uneeded FIXME about use of USVString
An AK::String works fine for a USVString as a USVString is just a more
strict version of DOMString. Maybe we will have a different String type
for it in the future, but for now using an AK::String is fine and we do
not need this FIXME.
2024-12-16 05:03:00 -08:00
Shannon Booth
a5bdc56063 LibWeb/HTML: Make ErrorEvent::create a trusted event
Matching DOM::Event.
2024-12-16 05:03:00 -08:00
sideshowbarker
aa5207199f Tests: Import remaining HTML-AAM tests (no code)
This change imports the remaining HTML-AAM tests from WPT that haven’t
yet been imported in any previous PRs — giving us complete in-tree
regression-testing coverage for all available WPT tests for the
requirements in the HTML-AAM spec.
2024-12-16 04:59:46 -08:00
devgianlu
6ef8b54d21 LibWeb: Add support for AES-GCM encrypt and decrypt
Adds ~400 WPT test passes.
2024-12-16 13:27:53 +01:00
devgianlu
1ae28324bd LibCrypto: Accept correct IV sizes for AES-GCM
AES-GCM should accept 96-bits keys as is. Any other key should be
preprocessed with GHASH.
2024-12-16 13:27:53 +01:00
devgianlu
3167d4f06b LibCrypto: Move GHash hashing routine to separate function
This allows for the function to be used outside `GHash`. In particular,
it'll be used for IV preparation in AES-GCM.
2024-12-16 13:27:53 +01:00
Glenn Skrzypczak
e18fb7fc93 LibWeb/Fetch: Handle streams on abort
When aborting fetch, the request stream now gets closed and the
response stream errors.
2024-12-16 12:43:16 +01:00
Glenn Skrzypczak
b263cd11f7 LibWeb/Fetch: Deserialize abort reason
Deserialize the fetch controllers abort reason according to the spec.
Currently fetch does not support a scenario where this actually happens.
2024-12-16 12:43:16 +01:00
Tim Ledbetter
2b1725ea51 LibWeb: Collapse selection when selecting text inside a text control 2024-12-16 11:43:28 +01:00
devgianlu
584cbcf3ef LibWeb: Implement wrapKey and unwrapKey methods
This implements the last WebCryptoAPI methods `wrapKey` and `unwrapKey`.
Most of the functionality is already there because they rely on
`encrypt` and `decrypt`. The only test failures are for `AES-GCM` which
is not implemented yet.
2024-12-16 11:35:00 +01:00
devgianlu
c1a65f3d53 LibWeb: Parse JsonWebKey from string
Add the ability to parse a `JsonWebKey` structure from a raw string.
2024-12-16 11:35:00 +01:00
devgianlu
06733bea48 LibWeb: Fix X448 PCKS#8 key export format
The ASN1 structure for PCKS#8 was wrong and missing one wrapping of the
key in a OctetString.

The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
2024-12-16 11:35:00 +01:00
devgianlu
89f1f3f31c LibWeb: Fix X25519 PCKS#8 key export format
The ASN1 structure for PCKS#8 was wrong and missing one wrapping of the
key in a OctetString.

The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
2024-12-16 11:35:00 +01:00
devgianlu
880401030d LibWeb: Fix X448 JWK key export format
The presence of padding in the base64 fields made plenty of WPT tests
fail. Additionally, export was performed with the wrong public key.

The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
2024-12-16 11:35:00 +01:00
devgianlu
ac99e2791f LibWeb: Fix X25519 JWK key export format
The presence of padding in the base64 fields made plenty of WPT tests
fail.

The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
2024-12-16 11:35:00 +01:00
devgianlu
08af878466 LibCrypto+LibWeb: Allow serializing key info without params
Previously, if `nullptr` was passed as params for
`wrap_in_private_key_info` or `wrap_in_subject_public_key_info` an ASN1
null was serialized. This was not the intended behaviour for many.

The issue was discovered while implementing `wrapKey` and `unwrapKey` in
the next commits.
2024-12-16 11:35:00 +01:00