public static class GridTrackListReads a CSS <track-list> into the tracks LayoutTree stores.
Remarks
⚠ This is the inverse of ToString, which is why it lives here rather than in the styling assembly. Vixen.Ui.Styling resolves declarations without knowing what a length measures and cannot see a GridTrackSize at all; Vixen.Ui, the bridge, can — but so can the layout conformance corpus, and only one of those two can be true of a parser that both of them must agree with. A type that already emits minmax(0,1fr) owns the reading of it too, and the alternative is two grammars that drift.
⚠ That the corpus and the stylesheet share this grammar is the point, not a convenience. Taffy's 1 526 grid fixtures reach the store through TaffyStyleMap and never touch CSS, so a grammar written only for the stylesheet would have no adversarial coverage at all — and this one is attacked by repeat(40000, 10px 10px) and by a single 84 KB attribute holding twenty-one thousand longhand tracks. Both callers parse with these lines, so a fixture that would break the stylesheet breaks the corpus first.
⚠ It is a tokeniser and not a Split, because both of the separators a track list uses also occur inside its functions. minmax(0px,1fr) holds a comma and repeat(auto-fill, 1px 1px) holds spaces, so splitting on either at the top level cuts through a function argument — and the corpus contains 40px repeat(1, 40px) repeat(auto-fill, 40px), which needs both separators read correctly in one string. A depth counter over the parentheses is the whole of the fix.
⚠ A fixed repeat(N, …) is expanded here and an automatic one is not, and that asymmetry is CSS Grid §7.2.3.2 rather than a shortcut. repeat(4, 10px) is defined as a textual expansion — it means exactly 10px 10px 10px 10px and nothing downstream can tell the two apart. repeat(auto-fill, …) is not: the number of repetitions is computed from the container's own definite size, so it changes when the box is resized without the declaration changing at all. Expanding it here would freeze one frame's answer into the style.
Anything outside the grammar — named lines, subgrid, masonry, calc(), none — is refused rather than skipped, and a refusal carries the token that caused it. Silence is the one behaviour a track list must not have: a list that half-parses becomes a one-column grid, which looks like a layout bug in a panel rather than a typo in a stylesheet, and nothing anywhere says which.
Methods (1)
public static bool TryParse(string value, List<GridTrackSize> tracks, out GridAutoRepeatSpan repeat, out string? refusal)Reads a track list.
Used by (2)
- TaffyTrackListParserVixen.Ui.Layout.Tests
- TrackListPropertyVixen.Ui