Vixen
02b45cc4
csharp
public sealed class StyleValueParser

Turns a declaration's text into something that can be interpolated.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

It has to accept both of two forms of the same value, which is the consequence of ADR-009 that the spike did not reach. ExCSS normalises what it can see, and it cannot see through a var(): color: red arrives already rewritten as rgb(255, 0, 0), while color: var(--c) with --c: red arrives as red, substituted afterwards by Vixen. Both are the same colour and a parser that handled only the first would work until someone used a custom property.

Results are cached by interned value id. A stylesheet says rgb(255, 0, 0) in forty places and they all intern to one id, so the parse happens once — which matters because this runs on every declaration of every animated property.

Methods (3)

  • public StyleValueParser(NameTable values, NameTable keywords)

    Creates a parser.

  • public StyleValue Parse(int value)

    Parses an interned value.

  • public StyleValue Parse(ReadOnlySpan<char> text)

    Parses value text.

Used by (5)

  • AnimatorVixen.Ui.Styling
  • DrawListBuilderVixen.Ui
  • LayoutStyleBuilderVixen.Ui
  • StyleValueTestsVixen.Ui.Styling.Tests
  • UiDocumentVixen.Ui