Tim Ledbetter
16dbb44de2
LibWeb: Update DOMImplementation.createDocumentType() name validation
...
This now follows the latest specification steps.
2025-06-19 07:55:47 -04:00
Tim Ledbetter
ba641d4784
LibWeb: Update attribute name validation in Element.setAttribute()
...
This now follows the latest specification steps.
2025-06-19 11:00:53 +01:00
Tim Ledbetter
acf2d773d5
LibWeb: Update attribute name validation in Element.toggleAttribute
...
This now follows the latest specification steps.
2025-06-19 11:00:53 +01:00
Tim Ledbetter
4593c28769
LibWeb: Update validate_and_extract and its users to the latest spec
2025-06-19 11:00:53 +01:00
Tim Ledbetter
c6cc7e1874
Tests: Update dom/nodes/attributes.html WPT test
2025-06-19 11:00:53 +01:00
Tim Ledbetter
07b3b70a10
LibWeb: Return the correct computed value for opacity properties
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-06-19 10:27:35 +02:00
Tim Ledbetter
269d5bb40e
LibWeb: Resolve percentages for opacity properties at parse time
2025-06-19 10:27:35 +02:00
Gingeh
e96338dd63
LibWeb: Don't play initially-paused animations
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-06-18 17:17:29 +02:00
Tim Ledbetter
e0af205d69
LibWeb/CSS: Implement the empty-cells property
...
This property sets whether table borders and backgrounds are painted
if a given table cell has no visible content.
2025-06-18 14:55:03 +01:00
Jelle Raaijmakers
3c0b125c1c
Tests: Force layout in test to prevent flakiness
2025-06-18 12:52:24 +02:00
Tim Ledbetter
fa1e02e5d7
LibWeb: Allow calc() values in cubic-bezier() easing functions
2025-06-18 08:57:06 +02:00
Tim Ledbetter
c5a3eaaf45
LibWeb: Allow calc() values in steps() easing functions
2025-06-18 08:57:06 +02:00
Veeti Paananen
21b531598d
LibWeb/CSS: Fix reference bug when canonicalizing linear easing stops
...
+2 WPT tests
2025-06-18 08:53:10 +02:00
Aliaksandr Kalenik
b9b6927b85
LibWeb: Fix swapped strings for auto-fill and auto-fit in GridRepeat
...
...serialization.
2025-06-17 17:43:04 +01:00
Jelle Raaijmakers
e8e6dbcee0
LibWeb: Fix document element's .scrollHeight and .scrollWidth
...
We were using the viewport's size as the viewport scrolling area, but
those are completely different things.
2025-06-17 17:17:34 +01:00
Sam Atkins
0e168ce631
Tests: Reimport dom/nodes/moveBefore tests
...
Apart from these moving out of `tentative/`, the
custom-element-move-reactions.html test was updated to be less flaky:
5e87cd92c0
2025-06-17 13:59:01 +02:00
Tim Ledbetter
701fcb9e87
LibWeb: Allow anonymous layer block rule with no declarations
2025-06-17 08:58:00 +01:00
Tim Ledbetter
30cdacc05a
LibWeb: Add flow relative values for the clear property
...
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Currently `inline-start` and `inline-end` are always treated as `left`
and `right` respectively.
2025-06-17 09:26:26 +02:00
Tim Ledbetter
28b24b72bc
LibWeb: Don't resolve flow-relative values for float too early
...
This allows `getComputedStyle()` to return the correct value if `float`
is set to `inline-start` or `inline-end`
2025-06-17 09:26:26 +02:00
Tim Ledbetter
6c6219db05
LibWeb: Use shorthand keywords for contain used value where possible
...
The used value of `contain` is now set to `strict` or `content` when
the relevant set of containment keywords are specified.
2025-06-17 08:17:33 +01:00
Tim Ledbetter
96d8bed35b
LibWeb/CSS: Serialize contain values in canonical order
2025-06-17 08:17:33 +01:00
Callum Law
12c9da2d3f
LibWeb: Serialize grid/grid-template as "none" when applicable
...
This exposes a bunch of false-positives in the
grid-{shorthand,template}-invalid.html WPT tests, but gains us some
new passes as well.
2025-06-16 12:37:40 +01:00
Callum Law
7d81823eb3
LibWeb: Handle CSS-wide keywords in style_property_for_sided_shorthand
...
CSS-wide keywords should not be concatenated in the same way as other
values unless they are all the same.
2025-06-16 12:37:40 +01:00
Callum Law
62da650992
LibWeb: Don't serialize longhands if we directly serialized shorthand
...
The spec assumes that we only store values against expanded longhands,
there are however limited circumstances where we store against
shorthands directly in addition to the expanded longhands. For example
if the value of the shorthand is unresolved we store an
UnresolvedStyleValue against the shorthand directly and a
PendingSubstitutionStyleValue against each of the longhands.
This commit updates the logic so that in the case we serialize a
shorthand directly we should also mark it's longhands as serialized to
avoid serializing them separately.
This also avoids the scenario where we tried to create and serialize a
ShorthandStyleValue with PendingSubstitutionStyleValue longhands, so we
can remove the check and related FIXME for that.
2025-06-16 12:37:40 +01:00
Callum Law
f8f4da3b90
LibWeb: Don't serialize shorthand with non-uniform CSS-wide keywords
2025-06-16 12:37:40 +01:00
Callum Law
3c6b8d5a2c
LibWeb: Propagate CSS-wide keyword to transition longhands
...
Previously we would treat CSS-wide keywords as equivalent to "none"
2025-06-16 12:37:40 +01:00
Callum Law
335190e925
LibWeb: Handle nested shorthands in all-same-CSS-wide-keyword to_string
...
Previously we only checked direct sub-properties, not accounting for the
nested case.
2025-06-16 12:37:40 +01:00
Prajjwal
e1d2582680
LibWeb: Resolve FIXME in media select resource algorithm
...
Fixes at least three WPT test that were previously timing out:
- html/semantics/embedded-content/media-elements/error-codes/error.html
- html/semantics/embedded-content/media-elements/location-of-the-media-resource/currentSrc.html
- html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
2025-06-16 23:28:10 +12:00
Tim Ledbetter
7faeef8d0d
LibWeb: Treat font-variant values with unknown keywords as invalid
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-06-15 16:44:51 +02:00
Tim Ledbetter
d89a67ffee
LibWeb: Don't serialize omitted box-shadow and text-shadow values
2025-06-15 16:05:12 +02:00
Tim Ledbetter
68d3ddb1a7
LibWeb: Parse the transform-origin z-value
2025-06-15 16:01:54 +02:00
Tim Ledbetter
a8d5758777
LibWeb: Only resolve transform-origin keywords for the computed value
...
Previously, we were resolving these keywords at parse time, which gave
an incorrect serialization of the specified value.
2025-06-15 16:01:54 +02:00
Tim Ledbetter
a3f6e71e33
LibWeb/CSS: Disallow third argument in 2D scale functions
2025-06-15 15:59:02 +02:00
Tete17
e7906f4332
LibWeb: Import decompression-corrupt-input.tentative.any.html tests
...
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
It is now fully green :)
2025-06-14 18:26:56 -04:00
Tim Ledbetter
39cef6eeb5
LibWeb: Disallow default as a keyframe name
2025-06-14 17:56:10 -04:00
Tim Ledbetter
64728aef6c
LibWeb: Disallow non-ASCII font-language-override values
2025-06-14 16:05:04 -04:00
Tim Ledbetter
c55f281475
LibWeb: Disallow empty font-language-override string values
2025-06-14 16:05:04 -04:00
Tim Ledbetter
028bcd3d67
LibWeb/CSS: Backtrack the parser if a property does not accept a value
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-06-14 08:22:56 +02:00
Tim Ledbetter
26293114d8
LibWeb/CSS: Treat repeated text-decoration-line values as invalid
2025-06-14 08:19:47 +02:00
Jelle Raaijmakers
3df83dade8
LibWeb: Treat DOM::Range offsets as UTF-16 code unit offsets
...
We generated `PaintableFragment`s with a start and length represented in
UTF-8 byte offsets, but failed to consider that the offsets in a
`DOM::Range` are actually expressed in UTF-16 code units.
This is a bit of a mess: almost all web specs use UTF-16 code units as
the unit for indexing into text nodes, but we almost exclusively use
UTF-8 in our code base. Arguably the best thing would for us to use
UTF-16 everywhere as well: it prevents these mismatches in our
implementations for the price of a bit more memory usage - and even that
could potentially be optimized for.
But for now, try to do the correct thing and lazily allocate UTF-16 data
in a `PaintableFragment` whenever we need to index into it or if we're
asked to determine the code unit offset of a pixel position.
2025-06-13 15:08:26 +02:00
Jelle Raaijmakers
dbbdf2cebc
LibWeb: Improve caret positioning behavior inside fragments
...
When clicking on a glyph or starting a selection on it, we would use the
glyph's offset/index as the position which represents the left side of
the glyph, or the position between the glyph and the glyph before it.
Instead of looking at which glyph is under the mouse pointer, look at
which glyph boundary is closer. Now, if you click to the right of a
glyph (but still on that glyph), it correctly selects the next glyph's
offset as the position.
2025-06-13 15:08:26 +02:00
Timothy Flynn
de34143a4e
LibWeb: Do not spin the event loop awaiting text track state changes
...
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
The text track processing model would previously spin forever waiting
for the track URL to change. It would then recursively invoke itself
to handle the new URL, again entering the spin loop. This meant that
tracks could easily cause event loop hangs.
We now have an observer system to be notified when the track state
changes instead. This lets us exit the processing model and move on.
2025-06-12 12:25:23 -04:00
Callum Law
d31a58a7d6
LibWeb: Add support for the 'all' CSS property
...
The "longhands" array is populated in the code generator to avoid the
overhead of manually maintaining the list in Properties.json
There is one subtest that still fails in
'cssstyledeclaration-csstext-all-shorthand', this is related to
us not maintaining the relative order of CSS declarations for custom vs
non-custom properties.
2025-06-12 15:25:35 +01:00
Jelle Raaijmakers
0762d57f65
LibWeb: Remove accidentally added test expectation
...
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This was added in 4b6489917b .
2025-06-12 13:09:26 +02:00
Jelle Raaijmakers
4b6489917b
LibGfx: Disable tech(variations) font support for now
...
We apparently don't support it in the right way, since it causes the
wrong font to display on https://ladybird.org .
2025-06-12 11:04:37 +01:00
Sam Atkins
00f76ccbf4
LibWeb/CSS: Add alternative src() syntax for URLs
...
url() has some limitations because of allowing unquoted URLs as its
contents. For example, it can't use `var()`. To get around this, there's
an alternative `src()` function which behaves the same as `url()` except
that it is parsed as a regular function, which makes `var()` and friends
work properly.
There's no WPT test for this as far as I can tell, so I added our own.
2025-06-11 16:26:23 +02:00
AmusedNetwork
7c85e57c32
LibWeb: Unit test for Anchor element covered by pseudo-element
2025-06-09 16:20:43 +01:00
Callum Law
a9eecf76df
LibWeb: Dont compute style when CSSStyleProperties lacks owner node
...
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / 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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some instances of CSSStyleProperties can lack an owner node, for
instance the return value of a call to `window.getComputedStyle` where
the specified pseudo-element is invalid. In this case we should treat
the computed style as empty, as there is no node to compute the style
for.
2025-06-09 12:28:41 +01:00
Callum Law
610ad25555
LibWeb: Update m_inline_style when element style attribute is removed
...
Previously we would just throw it away and construct a new (empty) one
when required. This doesn't work as any existing references to the old
instance will contain out of date information. Now we retain and update
the existing instance instead.
2025-06-09 12:06:44 +01:00
Callum Law
f53bec3a67
LibWeb: Throw error on insertRule with disallowed @namespace rule
...
Resolves a FIXME in `CSSRuleList::insert_a_css_rule`. Gets us a bit
closer to passing https://wpt.live/css/cssom/at-namespace.html but that
requires more work around parsing of selectors with namespaces (namely
disallowing use of undeclared selectors), which I have added a FIXME
for.
2025-06-09 11:56:24 +01:00