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
...
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
Callum Law
f8f4da3b90
LibWeb: Don't serialize shorthand with non-uniform CSS-wide keywords
2025-06-16 12:37:40 +01: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
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
Tim Ledbetter
39cef6eeb5
LibWeb: Disallow default as a keyframe name
2025-06-14 17:56:10 -04:00
Tim Ledbetter
028bcd3d67
LibWeb/CSS: Backtrack the parser if a property does not accept a value
2025-06-14 08:22:56 +02: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
Callum Law
a9eecf76df
LibWeb: Dont compute style when CSSStyleProperties lacks owner node
...
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
50cce72ab9
LibWeb: Implement text-wrap CSS property
...
This resolves an issue introduced in 94f5a51 with the
tab-size-text-wrap test
2025-06-04 12:48:36 +01:00
Callum Law
9ba74316d2
LibWeb: Implement text-wrap-style CSS property
2025-06-04 12:48:36 +01:00
Tim Ledbetter
e2d0d8e2b9
LibWeb/CSS: Implement the scrollbar-color property
...
This allows the user to set the scrollbar thumb and track colors.
2025-06-02 00:17:51 +02:00
Callum Law
94f5a51820
LibWeb: Convert white-space CSS property to shorthand
...
This exposed a few bugs which caused the following tests to behave
incorrectly:
- `tab-size-text-wrap.html`: This previously relied on a bug where we
incorrectly treated `white-space: pre` as allowing text wrapping. The
fix here is to implement the text-wrap CSS shorthand property.
- `execCommand-preserveWhitespace.html`: We don't correctly serialize
shorthand properties. This is covered by an existing FIXME in
`CSSStyleProperties::serialized()`
- `white-space-shorthand.html`: The last 5 subtests here fail as we
don't correctly handle shorthand properties in
`CSSStyleProperties::remove_property()`. This is covered by an
existing FIXME in said function.
2025-05-29 12:04:28 +02:00
Callum Law
50bdd2cb85
LibWeb: Parse and propagate text-wrap-mode CSS property
2025-05-29 12:04:28 +02:00
Callum Law
ea30356fba
LibWeb: Parse and propagate white-space-collapse CSS property
2025-05-29 12:04:28 +02:00
Andreas Kling
2d064116ab
Tests: Import a WPT test for @font-face format specifiers
2025-05-23 16:36:56 +02:00
Sam Atkins
bb035fbfe0
Tests: Import a whole bunch of WPT mediaqueries tests
...
A lot of these are ref-tests, so I'm skipping the failing ones for now,
and will make as many pass as possible in subsequent commits.
2025-05-23 10:17:58 +01:00
Andreas Kling
f813c495ae
Tests: Import a WPT test for sin(), cos() and tan() serialization
2025-05-18 17:23:34 +02:00
Sam Atkins
2748522924
Tests: Import matchMedia() test
2025-05-17 07:53:24 +01:00
Sam Atkins
eb98bd1a36
Tests: Import some selector pseudo-class parsing tests
2025-05-17 00:30:44 +02:00
Sam Atkins
c9484e279f
LibWeb/CSS: Implement CSSPageRule.setSelectorText()
...
Gets us 12 WPT subtest passes.
2025-05-16 16:42:10 +01:00
Sam Atkins
a56ce0f6fa
Tests: Import attribute-selector case-sensitivity tests
2025-05-16 16:41:57 +01:00
Sam Atkins
101f6b1d7e
Tests: Import CSSMarginRule tests
2025-05-16 11:01:39 +01:00
Sam Atkins
1002464322
Tests: Import WPT CSSOM and parsing tests for @page
2025-05-15 09:53:29 +01:00
Tim Ledbetter
03e34db9f8
LibWeb: Interpolate the content-visibility property correctly
2025-05-13 11:24:05 +01:00
Tim Ledbetter
882ad4726e
LibWeb: Interpolate the visibility property correctly
2025-05-13 11:24:05 +01:00
Psychpsyo
dbece92637
LibWeb: Make elements with 'opacity: 0' respond to hit-testing
2025-05-07 01:45:07 +03:00
Sam Atkins
09b508d8e8
Tests: Import some URL-related WPT tests
2025-05-03 23:22:40 +01:00
Tim Ledbetter
23009779e1
LibWeb: Interpolate font-style values correctly
...
These are interpolated by computed value, except a value of `normal` is
treated as `oblique 0deg`.
2025-05-03 12:05:22 +02:00
Tim Ledbetter
542c3cbe51
LibWeb: Implement the transition-behavior CSS property
...
This specifies whether transitions should be started for transitions
whose animation behavior is discrete.
2025-05-02 11:07:19 +01:00
Tim Ledbetter
c1a3b95176
LibWeb: Set transition property name when firing transition events
2025-04-29 12:23:31 +02:00
Tim Ledbetter
e7ae9c8ebf
LibWeb: Parse all as keyword in transition shorthand
...
This ensures that the parsing of the `transition` shorthand property
behaves in the same way as the `transition-property` longhand.4
2025-04-28 20:51:36 +02:00
Andreas Kling
d8ea16d94e
LibWeb: Don't assume calc() simplification worked on invalid tree
...
Fixes #4469
2025-04-25 16:55:05 +02:00
Andreas Kling
4f4b43f1d2
Tests: Import WPT test for CSS scale interpolation
2025-04-25 14:08:12 +02:00
Andreas Kling
0553bcb35b
LibWeb: Simplify standalone CSS math functions when used outside calc()
...
Math functions like abs(), clamp(), round(), etc, can be used by
themselves in property values, without wrapping them in calc().
Before this change, we were neglecting to run calc simplification on the
generated calculation node trees. By doing that manually after parsing a
standalone math function, we score at least a couple hundred WPT points.
2025-04-24 20:38:00 +02:00
Andreas Kling
cf34a7bb32
LibWeb: Invalidate owner sheet on add/remove in CSSStyleProperties
...
Fixes at least 2 WPT subtests.
2025-04-24 18:26:54 +02:00
Andreas Kling
fbb3b06462
LibWeb: Don't assume table caption box wants to create a BFC
...
Instead, use the generic create_independent_formatting_context_if_needed
so that unusual situations like image-as-table-caption don't crash.
This logic clearly needs more work, but let's at least do better than
crashing. This gives us 26 new subtest passes on WPT.
2025-04-24 18:26:54 +02:00
Andreas Kling
f7a7cd9b2b
LibWeb: Prevent infinite recursion on abspos w/ intrinsic max-size
...
We were incorrectly deciding that abspos elements shouldn't treat many
max-width and max-height values as `none`. My best understanding is that
this was a hack in 2023 for an issue that has been solved since then.
By removing the incorrect short-circuit, we stop at least one WPT test
from crashing due to infinite recursion and get ourselves +34 passes.
2025-04-24 18:26:54 +02:00
Andreas Kling
e5d62e9915
LibWeb: Track whether HTMLLinkElement was enabled when created by parser
...
This information is needed by the script-blocking style sheet logic, and
its absence was causing a WPT test to crash.
2025-04-24 18:26:54 +02:00
Andreas Kling
1772adb600
LibWeb: Don't crash on non-finite values in CSS clamp() function
...
Stops a WPT test from crashing, giving us 29 new subtest passes. :^)
2025-04-24 18:26:54 +02:00
Andreas Kling
2f76b24b89
LibWeb: Throw on deleting CSS @namespace rule in disallowed conditions
...
Fixes one(!) WPT test :^)
2025-04-24 18:26:54 +02:00
Tim Ledbetter
1ca9f2a44d
LibWeb: Allow multiple values for the transition-delay property
2025-04-23 21:02:59 +01:00
Tim Ledbetter
c5f1f36119
LibWeb: Allow multiple values for transition-timing-function property
2025-04-23 21:02:59 +01:00
Tim Ledbetter
1f8f3804a3
LibWeb: Allow transition-property with multiple values
2025-04-23 21:02:59 +01:00
Tim Ledbetter
04d7228c51
LibWeb: Implement interpolation of repeatable lists
2025-04-23 09:13:45 +01:00
Tim Ledbetter
9cf04f40f6
LibWeb: Implement the color-mix() function
...
This takes 2 color values and returns the result of mixing them by a
given amount.
2025-04-22 12:19:51 +02:00
Tim Ledbetter
4283c73d02
LibWeb: Return correct computed value for lab-like and lch-like colors
2025-04-20 16:51:20 +02:00
Tim Ledbetter
5074d90888
LibWeb: Implement serialization of lab-like color values
2025-04-20 16:51:20 +02:00