Commit graph

2467 commits

Author SHA1 Message Date
Tim Ledbetter
d8511e39c9 LibWeb: Report exceptions that occur during mutation observer microtask 2024-12-19 15:25:08 +00:00
Tim Ledbetter
4a6e457d4b LibWeb: Update run_timer_initialization_steps to the latest spec
This fixes a number of WPT tests, which expect an error to be reported
if an exception is thrown in the timer callback.
2024-12-19 15:25:08 +00:00
Lucien Fiorini
b909e3d587 Tests: Add screenshot test for Canvas2D fillstyle opacity 2024-12-19 13:31:12 +01:00
Lucas CHOLLET
61755b29c9 Tests: Import a bunch of css-color tests from WPT 2024-12-19 09:54:14 +00:00
Lucas CHOLLET
9261688488 Tests: Import a few ICC profiles related tests 2024-12-19 09:54:14 +00:00
devgianlu
637f934f69 LibWeb: Correctly normalize HashAlgorithmIdentifier
Make sure that `HashAlgorithmIdentifier` is passed through
`normalize_an_algorithm` to verify that the hash is valid and supported.

This is required by the spec, but we are not following it very strictly
in `normalize_an_algorithm` because it is pretty convoluted.

Fixes ~60 tests.
2024-12-18 12:45:06 -08:00
Lucien Fiorini
d9ab68dd62 Tests: Import WPT test for canvas filter values 2024-12-18 18:54:20 +01:00
Lucien Fiorini
aea0172a44 Tests: Add screenshot test for canvas filters 2024-12-18 18:54:20 +01:00
sideshowbarker
ce65457746 LibWeb: Fix internal logic for recognizing non-abstract ARIA roles 2024-12-18 15:24:51 +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
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
Johan Dahlin
1c42d6831b LibWeb: Style 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
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
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
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
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
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
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
devgianlu
718b78dd43 LibWeb: Import WPT RSA.importKey tests
This serves as a control for the changes in the next commits. I
originally had a regression, but did not notice because the tests were
missing.
2024-12-16 11:35:00 +01:00
devgianlu
6e33dbb533 LibWeb: Fix ED25519 JWK key export format
The presence of padding in the base64 fields and the typo 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
Feng Yu
7bb7edd6df LibWeb: Fix is_valid_status_text to handle UTF-8 correctly
This change fixed a WPT subtest which I also imported.
2024-12-15 08:33:30 +00:00
stelar7
a25bba27fa LibWeb: Close the database if the upgrade connection is aborted 2024-12-14 23:02:59 +01:00
Tim Ledbetter
022141647a LibWeb: Implement PopoverInvokerElement attribute change steps
PopoverInvokerElement's explicitly set attr-element should be set to
null whenever the value of the `popovertarget` content attribute is
changed.
2024-12-14 12:11:28 -08:00
Shannon Booth
18dddaa742 LibWeb/HTML: Use DOM's post-connection steps for iframe elements
See: https://github.com/whatwg/html/commit/c8ec987d1
2024-12-14 12:06:41 -08:00
Lucas CHOLLET
3c60510896 LibWeb/CSS: Correctly serialize the colorspace name of xyz and xyz-d65
This gives us a +40 subtests passes in:
 - css/css-color/parsing/color-valid-color-function.html
2024-12-14 07:43:48 +00:00
devgianlu
9240d38273 LibCrypto+LibTLS+LibWeb: Store EC key size + refactor serialization
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Push notes / build (push) Waiting to run
In order for public/private key serialization to work correctly we must
store the size of the key because P-521 cannot be stored as full words
inside `UnsignedBigInteger` and therefore is exported as the wrong
length (68 instead of 66).

This makes it also possible to refactor some methods and cleanup
constants scattered around.

Gets almost all import/export tests, expect the JWK ones that calculate
the public key on export. The `SECPxxxr1` implementation currently fails
to do calculations for P-521.
2024-12-14 01:52:16 +01:00
devgianlu
70db7772b8 LibWeb: Expose support for P-521 in ECDH and ECDSA
Replace all TODOs and FIXMEs requiring P-521 support with actual code
paths that make use of it. Gets a few tests by simply not failing early.
2024-12-14 01:52:16 +01:00
Sam Atkins
2c3f826162 Tests: Disable crashing css-hover-shadow-dom.html test 2024-12-13 16:11:02 +00:00
Manuel Zahariev
5d85f3a5c8 LibWeb: Test layout of standalone SVG document: edge cases
Tests with different combinations of missing width, height
and viewBox.

All tests confirmed to work on Ladybird:
 - exactly the same as Chromium (131.0.6778.85)
 - almost the same as Firefox (129.0.2)
    - only difference: standalone-w.svg: same size, different alignment
2024-12-13 15:02:49 +00:00
Manuel Zahariev
5d77104c2f LibWeb: Test layout of standalone SVG document: main use case
SVG document with specified width and height attributes is layed out
with this width/height.
2024-12-13 15:02:49 +00:00
Gingeh
84150f972f LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
sideshowbarker
583ca6af89 LibWeb: Implement <input type=checkbox switch> experimentally
In conformance with the requirements of the spec PR at
https://github.com/whatwg/html/pull/9546, this change adds support for
the “switch” attribute for type=checkbox “input” elements — which is
shipping in Safari (since Safari 17.4). This change also implements
support for exposing it to AT users with role=switch.
2024-12-13 11:31:27 +00:00
Psychpsyo
4dc65c57a0 LibWeb: Make MouseEvent.offsetX/Y ignore transforms
That is what the spec calls it, at least.
In code, this manifests as making the offset very aware
of the element's transform, because the click position comes
relative to the viewport, not to the transformed element.
2024-12-13 07:18:56 +01:00
Luke Warlow
fcf6cc27f2 LibWeb: Implement popover beforetoggle and toggle events 2024-12-12 15:10:33 -07:00
Nathan van der Kamp
a276cf2d5e LibWeb: Add PopOverInvokerElement and use it in HTMLButtonElement
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Push notes / build (push) Waiting to run
The popoverTargetElement seems to be one of the only cases of a
reflected Element? attribute in the HTML spec, the behaviour of which
is specified in section 2.6.1.

Buttons can't actually toggle popovers yet because showing/hiding
popovers is not implemented yet.
2024-12-12 17:11:27 +00:00
sideshowbarker
32dddc8140 Tests: Import some ARIA and HTML-AAM (regression) tests (no code)
We’re passing all the tests in this patch on trunk — so let’s go ahead
and welcome them into our regression-testing garden.
2024-12-12 13:54:47 +00:00
sideshowbarker
50e7e9f58d LibWeb: Assign “dir”, “dd”, “dt” default ARIA roles per-spec
Also, import http://wpt.live/html-aam/dir-role.tentative.html (which
provides test/regression coverage for the “dir” change).
2024-12-12 05:13:45 -08:00
sideshowbarker
ccbc436e85 LibWeb: Support the “image” synonym for the “img” ARIA role
Additionally: For “img” elements with empty “alt” attributes, change the
default role to the newer, preferred “none” synonym for the older
“presentation” role; import https://wpt.fyi/results/html-aam/roles.html
(which provides test/regression coverage for these changes).
2024-12-12 05:13:45 -08:00
sideshowbarker
96540e9f89 LibWeb: Add support for the “suggestion” ARIA role
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Push notes / build (push) Waiting to run
2024-12-12 08:53:20 +00:00