LibWeb/CSS: Reimplement var()/attr() as arbitrary substitution functions

"Arbitrary substitution functions" are a family of functions that
includes var() and attr(). All of them resolve to an arbitrary set of
component values that are not known at parse-time, so they have to be
substituted at computed-value time.

Besides it being nice to follow the spec closely, this means we'll be
able to implement the others (such as `if()` and `inherit()`) more
easily.

The main omission here is the new "spread syntax", which can be
implemented in the future.
This commit is contained in:
Sam Atkins 2025-06-19 17:03:26 +01:00 committed by Tim Ledbetter
commit b6032b0fcd
Notes: github-actions[bot] 2025-07-09 15:45:46 +00:00
11 changed files with 480 additions and 346 deletions

View file

@ -8,9 +8,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> at (8,30) content-size 784x0 children: inline
TextNode <#text>
BlockContainer <div.string-no-fallback> at (9,31) content-size 100x20 children: inline
InlineNode <(anonymous)>
TextNode <#text>
BlockContainer <div.string-no-fallback> at (9,31) content-size 100x20 children: not-inline
BlockContainer <(anonymous)> at (8,52) content-size 784x0 children: inline
TextNode <#text>
BlockContainer <div.px> at (9,53) content-size 200x20 children: not-inline