mirror of
https://github.com/mozilla-firefox/firefox.git
synced 2026-06-14 11:03:31 -05:00
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