Files
Nicolas Chevobbe 01f7f5bd3d Bug 2035143 - [devtools] Move handling of var() in OutputParser to onCloseParenthesis. r=devtools-reviewers,jdescottes.
This is moving the last special cases for Function tokens to onCloseParenthesis,
which means we can also remove `#parseVariable`, `#parseMatchingParens` and the
`stopAtComma` parameter for `#doParse`.

This has the nice side effects of adding color swatches for some declarations
where we didn't use to be able to compute those (results of `color-mix()`,
`contrast-color()`, relative color syntax `from` color, `var()` with fallback),
which are reflected in the changes in the tests.

With this final change, we also needed to change how we're handling font family
names so they can fit nicely in this new design. So instead of keeping track
of the different font family parts, and then appending them to `parts`, we
now keep a single index when we detect a font family name, and when we find
a delimiter or a closing parenthesis, we wrap the meaningful part of the
font family in a dedicated element.

As we needed something similar to what we have for stack entry for fonts, in order
to map a "part" to multiple tokens, we update the `CLOSED_STACK_ENTRY` "token",
renaming it to better convey what it does, and renaming the `stackEntry` into
a more generic `data` property.

Differential Revision: https://phabricator.services.mozilla.com/D296786
2026-05-04 19:45:03 +00:00
..