Commit graph

4302 commits

Author SHA1 Message Date
sideshowbarker
062e33438e LibWeb: Space-separate parts of multi-label accessible names
This change ensures that when an accessible name is computed from
multiple labels, the parts computed from each label are separated by
spaces. Otherwise, without this change, the parts are run together in
the accessible name, with no space in between.
2024-12-26 20:44:14 +00:00
Andreas Kling
3bfb0534be LibGC: Rename MarkedVector => RootVector
Let's try to make it a bit more clear that this is a Vector of GC roots.
2024-12-26 19:10:44 +01:00
Lucas CHOLLET
55b4a983a7 LibWeb/CSS: Add the TransitionEvent type 2024-12-25 17:14:08 +01:00
Glenn Skrzypczak
08589741f5 LibWeb: Correctly implement event listeners default passive attribute
This commit implements the default value of the passive attribute of
event listeners according to the spec.
2024-12-25 14:57:22 +00:00
Pavel Shliak
4c7cd05078 LibWeb: Update FormData constructor to reflect the spec 2024-12-25 14:52:57 +00:00
sideshowbarker
72a86f2df3 LibWeb: Fix selector matching for non-HTML mixed-case element names
This change fixes selector matching for non-HTML elements that have
mixed-case names — such as the SVG foreignObject element.

Otherwise, without this change, attempting to use a selector to match
such an element — e.g., document.querySelector("foreignObject") — fails.
2024-12-25 13:54:06 +00:00
Timothy Flynn
79a2b96d1c Meta: Consolidate checking for the system audio backend
The goal here is to ensure we check for audio backends in a way that
makes sense. On macOS, let's just always use Audio Unit (and thus avoid
any checks for Pulse, to reduce needless/confusing build log noise). We
will also only use the Qt audio backend if no other backend was found,
rather than only checking for Pulse.
2024-12-25 12:00:43 +01:00
Timothy Flynn
c51cd34bfb LibMedia: Remove outdated FIXME regarding Audio tests
This FIXME does not apply to Ladybird outside Serenity.
2024-12-25 12:00:43 +01:00
sideshowbarker
f2ac591614 LibWeb: Compute default ARIA roles for SVG elements
This change adds support for computing default ARIA roles for (selected)
SVG elements, per the requirements in the SVG Accessibility API Mappings
spec at https://w3c.github.io/svg-aam/#mapping_role_table.

This only computes roles for the elements which are covered in the WPT
test at https://wpt.fyi/results/svg-aam/role/roles.html — that is, the
“a”, “g”, and “image” elements.
2024-12-25 10:58:48 +00:00
Shannon Booth
f3e92f2ae5 LibWeb/HTML: Implement the StorageEvent interface 2024-12-25 11:57:14 +01:00
Lucas CHOLLET
c5f9710492 LibWeb/CSS: Create a MediaQueryListEvent when calling MQLE::create()
Otherwise, if not implemented, `MediaQueryListEvent::create()` would
result in a call to `DOM::Event::create()`. This issue exists here:
673537b26b/Libraries/LibWeb/DOM/Document.cpp (L2865)
2024-12-25 11:56:37 +01:00
Andrew Kaster
b11bdd4022 LibWeb: Import WPT tests for WebAssembly.Global
There's one failing due to the constructor object not having the name
"Global" vs "WebAssembly.Global". This also doesn't include the
tentative test for the type property.
2024-12-24 15:20:28 +01:00
Shannon Booth
910ff8b694 LibWeb/HTML: Consider <a> all-named elements instead of <link>
Leaving only the unimplemented legacy [[Call]] override funkiness
of HTMLAllCollection left not passing in the WPT tests.
2024-12-23 21:19:08 +01:00
Lucas CHOLLET
c70431672e Tests/LibWeb: Remove some support files from TestConfig.ini
Since 8e34efd4b5, these files are detected
by the runner and already skipped.
2024-12-23 10:59:47 -08:00
sideshowbarker
966c68ae0e LibWeb: Align accname alt-vs-title behavior w/ HTML-AAM spec & WPT tests
The https://wpt.fyi/results/accname/name/comp_tooltip.tentative.html
test was recently added by moving an existing subtest out from the test
at https://wpt.fyi/results/accname/name/comp_tooltip.html, and changing
the test expectations to match the HTML-AAM spec requirements at
https://w3c.github.io/html-aam/#img-element-accessible-name-computation.
See https://github.com/web-platform-tests/wpt/pull/49552.

So this code change updates Ladybird to match the updated WPT test
expectations — and to match the existing HTML-AAM spec requirements.
2024-12-23 14:01:37 +01:00
Ali Mohammad Pur
50733c564c LibRegex: Use the *actually* correct repeat start offset for Repeat
Fixes #2931 and various frequent crashes.
2024-12-23 13:13:52 +01:00
devgianlu
89061dd3c4 LibCrypto: Replace all hashes implementation with OpenSSL
This required multiple changes:
- Make hashes non-copiable because they contain a heap allocated pointer
- Reference classes via `NonnullOwnPtr` only (they are non-copiable)
- Drop all existing hashes implementations
- Use the `OpenSSLHashFunction` base class to implement the same hashes

I was not able to come up with a way to divide this commit into multiple
without increasing the amount of changes.

Nothing breaks with this commit!
2024-12-22 18:53:45 +01:00
Pavel Shliak
78595f05d8 Meta/LibWeb: Use correct shorthand range in is_inherited_property 2024-12-22 12:33:41 +01:00
Jelle Raaijmakers
4d9f17eddf LibGfx+LibWeb: Draw glyph runs with subpixel accuracy
This improves the quality of our font rendering, especially when
animations are involved. Relevant changes:

  * Skia fonts have their subpixel flag set, which means that individual
    glyphs are rendered at subpixel offsets causing glyph runs as a
    whole to look better.

  * Fragment offsets are no longer rounded to whole device pixels, and
    instead the floating point offset is kept. This allows us to pass
    through the floating point baseline position all the way to the Skia
    calls, which already expected that to be a float position.

The `scrollable-contains-table.html` ref test needed different table
headings since they would slightly inflate the column size in the test
file, but not the reference.
2024-12-21 23:09:52 +01:00
Jelle Raaijmakers
2052792663 LibWeb: Use correct boundaries in Selection::collapse_to_start/end()
We were using the anchor_node() as the boundary point node when
collapsing a selection, but the spec tells us to use the start and end
boundary point nodes.
2024-12-21 19:15:58 +01:00
Feng Yu
b3edbd7bf2 LibWeb: Implement the ClipboardItem API
Spec: https://w3c.github.io/clipboard-apis/#clipboard-item-interface
2024-12-20 15:29:18 +00:00
Gingeh
bdd6729d78 LibWeb: Use paintables when calculating mouse event offset 2024-12-20 15:50:41 +01:00
sideshowbarker
3365cae4a9 Tests: Import more WPT ARIA tests (more regression coverage); no code 2024-12-20 06:23:21 -08:00
Tyler Dence
0378645c25 LibWeb: PlatformObject::DefineOwnProperty fix 'has own property' check
PlatformObjects with named properties does not qualify as 'has own
property' just by virtue of a named property existing.

This fixes at least one WPT test, which is imported.
2024-12-20 15:10:24 +01:00
sideshowbarker
695ce3763e LibWeb: Replace ARIA “synonym” roles with their preferred synonyms
This change does replacement of ARIA roles that have newer synonyms.

There are a number of newer ARIA roles that are synonyms for older
roles. https://wpt.fyi/results/wai-aria/role/synonym-roles.html has a
number of subtests which expect that when retrieving the value of an
explicitly- specified role attribute, if the value is one of the older
role values, implementations must replace that with its newer synonym.
2024-12-20 05:45:59 -08:00
sideshowbarker
e9dedeee34 Tests: Import ARIAMixin string attributes CEReactions tests (no code) 2024-12-20 05:17:05 -08:00
R-Goc
74309ce8c2 Tests: Remove use of VLAs from TestRSA.cpp
This commit removes the use of variable length arrays from the tests for
RSA. This is the last remaining place using VLAs.
2024-12-20 09:37:56 +01:00
Timothy Flynn
edd3b14ddf LibCrypto: Protect the SignedBigInteger ctor against integer overflow
In particular, if given a value of -2147483648, we would invoke signed
integer overflow (which is UB).
2024-12-19 23:37:30 +01:00
Totto16
540c840755 LibWeb: Add test for getComputedStyle with a PseudoElement argument
This test checks the case, where an unknown pseudo element is used as
second argument to getComputedStyle
2024-12-19 19:35:57 +00:00
Sam Atkins
1c9f0601e9 Tests: Re-enable slow WPT svg-in-iframe/object tests
These all use `<meta name=timeout content=long>` and so should now be
safe to run without timing out.

Fixes #2792
2024-12-19 17:27:33 +00:00
Sam Atkins
f62ccb010d Tests: Let WPT tests set their own timeout
The official WPT runner supports a `<meta name=timeout content=long>`
tag to let tests opt-in to a longer timeout. Modify our harness to pass
that custom timeout to our runner, so that we don't incorrectly time
out if our default time is shorter than the requested one.
2024-12-19 17:27:33 +00:00
Andreas Kling
9164c9784d LibGfx: Treat PNG files with invalid frame data as transparent
If we have a valid PNG header with geometry info etc, we should still
display it as *something*, even if the image data itself is missing or
corrupted.

This matches the behavior of other browsers, and is something that
Cloudflare Turnstile checks for.

To achieve this, we split the PNG decoder's initialization into two
steps: "everything except reading frame data" and "reading frame data".
If the latter step fails, we yield a transparent bitmap with the
geometry from the PNG's IHDR chunk.
2024-12-19 16:49:28 +01:00
Tim Ledbetter
e74d8a6003 LibWeb: Report exceptions that occur during resize observer callback 2024-12-19 15:25:08 +00:00
Tim Ledbetter
62ecff0b40 LibWeb: Report exceptions that occur during microtask callback 2024-12-19 15:25:08 +00:00
Tim Ledbetter
7a41ab960c LibWeb: Report exceptions when invoking intersection observer callback 2024-12-19 15:25:08 +00:00
Tim Ledbetter
7cacf5ca55 LibWeb: Report exceptions when invoking custom element reactions 2024-12-19 15:25:08 +00:00
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