Commit graph

2467 commits

Author SHA1 Message Date
Konstantin Konstantin
1915574165 LibWeb: Fix NavigationType enum to string conversion
Convert NavigationType to lowercase strings, as described in the spec.

Import related WPT test.
2024-12-02 06:47:49 +00:00
Pavel Shliak
4d5acc7a00 LibWeb: Remove IDBRequest.idl FIXME
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-01 22:04:05 +01:00
Pavel Shliak
e02fd4ca8c Tests: Reimport Event-constants WPT
I reimported and rebaselined it using the latest version
of our WPT importer. Now it passes.
2024-12-01 22:01:48 +01:00
Tim Ledbetter
a486c86eee LibWeb: Limit HTMLCanvasElement width and height to allowed values
Setting the `width` or `height` properties of `HTMLCanvasElement` to a
value greater than 2147483647 will now cause the property to be set to
its default value.
2024-12-01 15:12:04 +00:00
Tim Ledbetter
b05bc71002 LibWeb: Limit HTMLImageElement width and height to allowed values
Setting the `width` or `height` properties of `HTMLImageElement` to a
value greater than 2147483647 will now cause the property to be set to
0.
2024-12-01 15:12:04 +00:00
Shannon Booth
30c8510725 LibWeb: Ensure requests modules is not empty before indexing into it
Regression from 5af613aa65

Fixes: #2676
2024-12-01 15:49:16 +01:00
Timothy Flynn
3947c6d4ed LibWeb: Disable Text/input/wpt-import/css/cssom/serialize-values.html
It's currently too slow for sanitized CI runs.
2024-11-30 12:10:12 -05:00
Netanel Haber
d743fcb376 LibWeb: Take namespace into account when matching attribute 2024-11-30 16:47:14 +00:00
Jelle Raaijmakers
033cd9cab3 LibWeb: Add test for document.execCommand("delete")
Anchor the minimum functionality for this. WPT has an extensive suite
to test editing functionalities, but they all take a long time to
execute - so let's have a simple regression test in-tree for now.
2024-11-30 17:35:45 +01:00
Sam Atkins
90e763de4c LibURL: Replace Host's Empty state with making Url's Host optional
A couple of reasons:
- Origin's Host (when in the tuple state) can't be null
- There's an "empty host" concept in the spec which is NOT the same as a
  null Host, and that was confusing me.
2024-11-30 12:07:39 +01:00
Shannon Booth
91007eb476 LibWeb: Ensure principal realm returned for nested Shadow Realms
Recently reported against the shadow realm proposal after running into
issues with WPT tests.

In a nested shadow realm, the associated realm is a shadow realm, not
the principal realm. One such issue this fixes is a crash when a nested
shadow realm performs an operation which requires the principal settings
object.
2024-11-30 11:55:11 +01:00
Shannon Booth
218ac86b67 LibWeb: Use relevant principal settings for HighResolutionTime
Fixes a crash when setting the timestamps when creating a DOM event
within a ShadowRealm.
2024-11-30 11:55:11 +01:00
Shannon Booth
6a668f27c7 LibWeb: Push promise rejection handling onto UniversalGlobalScopeMixin
This is needed for shadow realms which don't have a window or worker
global object. Fixes a crash for the attached test.
2024-11-30 11:55:11 +01:00
devgianlu
399b3d2430 LibCrypto+LibWeb: Parse EC public key in parse_subject_public_key_info
Replicate what we are doing with RSA and parse both the private and
public key when parsing the ASN1.

The only thing that changed in the tests is the error message.
2024-11-30 11:17:44 +01:00
devgianlu
ab2960e49f LibCrypto+LibWeb: Reorganize OID ASN1 constants
I have divided ANS1 constants by length so that they don't have
trailing zeros that need to be removed.

Also moved OIDs lists to the only place they are used for clarity.

Fixed a couple of WPT tests by adding SECP521r1 to the list of known
curves.
2024-11-30 11:17:44 +01:00
Tim Ledbetter
b39fdcfec2 LibWeb: Implement the HTMLInputElement.height attribute
This allows the height of an image button input to be set and queried.
2024-11-30 11:01:33 +01:00
Tim Ledbetter
45a2823e08 LibWeb: Implement the HTMLInputElement.width attribute
This allows the width of an image button input to be set and queried.
2024-11-30 11:01:33 +01:00
Sam Atkins
8e3adbe082 LibWeb: Serialize text-decoration closer to spec
This gets us 32 WPT subtest passes that I'm aware of. :^)
2024-11-30 11:01:12 +01:00
Sam Atkins
671d3e8a48 LibWeb/CSS: Sort text-decoration-line values in spec order
This wins us 49 WPT subtest passes! :^)
2024-11-30 11:01:12 +01:00
Sam Atkins
fa1e102f3c Tests: Import text-decoration WPT tests 2024-11-30 11:01:12 +01:00
Sam Atkins
9453c25925 LibWeb/CSS: Don't repeat CSS-wide keywords when serializing shorthands
Regardless of what the shorthand property is, if all its longhands are
the same CSS-wide keyword such as "initial" or "inherit", then it's the
same as the shorthand being that value.

This gets us 2 WPT subtest passes.
2024-11-30 11:01:12 +01:00
Sam Atkins
0c39d07b4d LibWeb/CSS: Serialize overflow correctly
When the x and y values are the same, we only want to serialize one.

This gets us 10 local WPT subtest passes. :^)
2024-11-30 11:01:12 +01:00
Sam Atkins
e4d55a6037 LibWeb/CSS: Use ShorthandStyleValue to serialize shorthands
This wins us 65 new WPT subtest passes! It also shows up that we're
doing the wrong thing in ShorthandStyleValue in places, notably with
the grid properties. However, having one place to fix instead of two
will make it easier to correct them. :^)

In order to be fully correct, we should use the algorithm here:
https://drafts.csswg.org/cssom/#serialize-a-css-value

However, it's quite hand-wavy. What we do have in the meantime is
`ShorthandStyleValue::to_string()`, where we special-case the
serialization rules for shorthands with a generic fallback that's
equivalent to what the previous `get_property_value()` code was doing.
2024-11-30 11:01:12 +01:00
Sam Atkins
bc17a3c2eb LibWeb: Correctly skip "decimal" in counter() serialization
It's not a keyword, it's a custom-ident. The simplest way of comparing
is by serializing it as a string.

This gets us 2 subtest passes.
2024-11-30 11:01:12 +01:00
Sam Atkins
917d659f8b LibWeb/CSS: Remove unwanted newline from list serialization
Gets us 1 subtest pass.
2024-11-30 11:01:12 +01:00
Sam Atkins
8cdb8ca193 LibWeb/CSS: Add missing commas to rect() serialization
Gets us 1 WPT subtest pass.
2024-11-30 11:01:12 +01:00
Sam Atkins
5bcd9abc42 LibWeb/CSS: Serialize background-repeat correctly
This gets us 4 WPT subtest passes.
2024-11-30 11:01:12 +01:00
Sam Atkins
2fc164c0b6 Tests: Import WPT CSSOM tests about serialization
This is an area we're lacking in, so let's bring these in-tree to track
them more easily. :^)
2024-11-30 11:01:12 +01:00
Pavel Shliak
f2a406f8cc Tests: Import WPTs to prevent optional string argument regressions
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-11-29 20:23:01 +00:00
Pavel Shliak
a25ff8d46e Tests: Import WPT inputevent constructor test 2024-11-29 20:23:01 +00:00
stasoid
a90b7026fb LibWeb/Layout: Account for box-sizing in table width/height calculations
Fixes #1726

Fixes
wpt/css/CSS2/abspos/abspos-containing-block-initial-004c.xht
wpt/css/CSS2/abspos/abspos-containing-block-initial-004d.xht
wpt/css/CSS2/abspos/abspos-containing-block-initial-005b.xht
wpt/css/CSS2/abspos/abspos-containing-block-initial-005d.xht
2024-11-29 15:43:59 +01:00
Tim Ledbetter
99f8972928 LibWeb: Ignore negative values when setting HTMLProgressElement.max
When attempting to set `HTMLProgressElement.max` to a value not greater
than 0, we were previously setting the value to 1. We now retain the
previous value.
2024-11-29 15:32:04 +01:00
Kostya Farber
81f8866606 LibWeb: Lay out the fieldset's rendered legend 2024-11-29 12:36:52 +00:00
Tim Ledbetter
6218f1a609 LibWeb: Limit HTMLSelectElement.size to allowed values
This change ensures that the correct default value of 0 is used and
that values greater than 2147483647 will fall back to the default value.

It also splits the display size concept into a separate method, as
this isn't supposed to be used when getting the IDL property.
2024-11-29 13:30:57 +01:00
sideshowbarker
6bfc35b6a9 LibWeb: Fix aria-label precedence in accessible-name computation
This change makes Ladybird give the value of the aria-label attribute
the correct precedence for accessible-name computation required by the
“Accessible Name and Description Computation” and HTML-AAM specs and by
the corresponding WPT tests.

Otherwise, without this change, Ladybird fails some of the WPT subtests
of the test at https://wpt.fyi/results/accname/name/comp_label.html.
2024-11-29 12:18:28 +00:00
sideshowbarker
314e5d6bb7 LibWeb: Compute accessible names for hidden/hidden-but-referenced nodes
This change implements full support for the “A. Hidden Not Referenced”
step at https://w3c.github.io/accname/#step2A in the “Accessible Name
and Description Computation” spec — including handling all hidden nodes
that must be ignored, as well as handling hidden nodes that, for the
purposes of accessible-name computation, must not be ignored (due to
having aria-labelledby/aria-describedby references from other nodes).

Otherwise, without this change, not all cases of hidden nodes get
ignored as expected, while cases of nodes that are hidden but that have
aria-labelledby/aria-describedby references from other nodes get
unexpectedly ignored.
2024-11-29 12:18:28 +00:00
Pavel Shliak
c00b97a1f0 Tests: Fix 404 at css selector test
Fixes css/selectors/focus-visible-017-2.html
2024-11-29 12:16:50 +00:00
Pavel Shliak
1d2ceaf33f Tests: Fix 404 at css selector test
Fixes css/selectors/focus-visible-009.html
2024-11-29 12:16:50 +00:00
Pavel Shliak
dcca24868c Tests: Fix 404 at css-grid alignment tests
Fixes Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/
2024-11-29 12:16:50 +00:00
Pavel Shliak
577ca65c0e Tests: Fix 404 at input-text-to-image.html 2024-11-29 12:16:50 +00:00
Pavel Shliak
ab83540523 Tests: Fix 404 at Element-text-transform-fullwidth.html 2024-11-29 12:16:50 +00:00
Tim Ledbetter
aafc829e6d LibWeb: Don't allow HTMLTextAreaElement rows and cols to be set to 0
In this case we should fall back to the default value.
2024-11-29 09:48:45 +01:00
Tim Ledbetter
ae0c87c747 LibWeb: Limit HTMLInputElement.size to allowed values
Attempting to set `HTMLInputElement.size` to 0 via IDL now throws an
IndexSizeError DOMException. Attempting to set it to a value larger
than 2147483647 results in it being set to the default value.
2024-11-29 09:48:45 +01:00
Sam Atkins
971c04d413 Tests: Disable a worker test that's flaky on macOS
Consistently times out locally, but not on CI somehow.
2024-11-28 16:20:50 +00:00
devgianlu
46e724729c LibWeb: Match algorithm names case-insensitive
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
I dug through the code and the WebCryptoAPI spec to figure out the
reason for `... mixed case parameters` WPT tests and figured out that
our implementation was slightly wrong.

By being closer to the spec we can now pass those tests and also remove
a bunch of duplicated code.

Context: https://github.com/LadybirdBrowser/ladybird/pull/2598#discussion_r1859263798
2024-11-28 00:21:49 +01:00
Andreas Kling
a74954e145 LibWeb: Don't treat auto insets as definite for child of abspos element
This fixes an issue where the welcome screen wasn't showing up the first
time you visit https://puter.com/ :^)
2024-11-27 22:55:14 +01:00
Milo van der Tier
5deb2b4cad LibWeb: Do not give the HTML namespace to elements when parsing XML
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
While the code that did this referred to the HTML spec, other browsers
appear not to have this behavior when parsing XML, and it breaks a WPT
subtest.

This change does not appear to break any tests, and fixes 1 WPT subtest.
2024-11-27 17:10:32 +01:00
Andreas Kling
a7b791050e LibWeb: Only negotiate NavigableContainerViewport size with objects
Size negotiation should not occur for other viewports, such as iframe,
since that would allow content inside the iframe to affect the size of
the iframe in the containing document.

300 new subtest passes on WPT. :^)
2024-11-27 14:47:05 +01:00
Andreas Kling
630028daa5 Tests: Import SVG-in-iframe sizing tests from WPT 2024-11-27 14:47:05 +01:00
Tim Ledbetter
7fe3bf07e2 LibWeb: Limit HTMLTextAreaElement attributes to allowed values
If `HTMLTextAreaElement.rows` or `HTMLTextAreaElement.cols`
is set to a value larger than 2147483647, then it should be set to its
default value.
2024-11-27 11:00:25 +01:00