Commit graph

6 commits

Author SHA1 Message Date
Sam Atkins
5178d1ebe3 LibWeb/CSS: Add flag to disable create-internal-rep type checking
CSSTransformComponents hold other CSSStyleValues as their parameters. We
want to be able to create internal representations from those parameters
without them caring if they would be valid when directly assigned to the
property.

This is a temporary solution to make transform functions work. To be
completely correct, we need to know what is allowed in that context,
along with value ranges - a combination of the contexts we create when
parsing, and when computing calculations. For transform functions, this
doesn't matter, as there's no limit to the range of allowed values.
2025-10-14 13:41:47 +01:00
Sam Atkins
3644e75de1 LibWeb/CSS: Allow setting any property to CSS-wide keywords in typed OM
A minor thing I missed before. Gets us 4 WPT passes per property that's
tested, which is quite a lot.
2025-10-09 16:14:58 +02:00
Sam Atkins
d855b3d90f LibWeb/CSS: Support converting CSSKeywordValue to a StyleValue
Either KeywordStyleValue or CustomIdentStyleValue depending on whether
we recognize it as a CSS::Keyword.
2025-10-04 22:57:00 +02:00
Sam Atkins
d3d695e9d2 LibWeb/CSS: Make CSSStyleValue.to_string() return ExceptionOr
DOMMatrix.to_string() throws exceptions if any of its values are
non-finite. This ends up affecting CSSStyleValue because its subclass
CSSTransformValue (which is about to be added) serializes
CSSTransformComponents, and one of those is CSSMatrixComponent, which
calls DOMMatrix.to_string().

This is all quite unfortunate, and because at the time the spec for
DOMMatrix was written, CSS couldn't represent NaN or infinity. That's
no longer true, so I'm hoping the spec can be updated and this can be
reverted. https://github.com/w3c/fxtf-drafts/issues/611
2025-09-24 12:27:05 +01:00
Sam Atkins
68ceacb0c5 LibWeb/CSS: Implement CSSKeywordish type 2025-09-24 12:27:05 +01:00
Sam Atkins
a93c6a347f LibWeb/CSS: Implement CSSKeywordValue
CSSStyleValue is adjusted to allow for subclasses. Serialization for
CSSKeywordValue is implemented differently than the spec says because
of a spec bug: https://github.com/w3c/csswg-drafts/issues/12545
2025-08-21 10:21:54 +01:00