LibWeb/CSS: Insert required comments when serializing lists of tokens

Certain pairs of tokens are required to have `/**/` inserted between
them to prevent eg two `<ident>`s getting merged together when
round-tripping.
This commit is contained in:
Sam Atkins
2025-11-04 12:04:49 +00:00
committed by Jelle Raaijmakers
parent 9ac0966fc6
commit e026c98d64
Notes: github-actions[bot] 2025-11-04 13:07:01 +00:00
2 changed files with 164 additions and 62 deletions

View File

@@ -2,77 +2,77 @@ Harness status: OK
Found 72 tests
1 Pass
71 Fail
Fail Serialization of consecutive foo and bar tokens.
Fail Serialization of consecutive foo and bar() tokens.
59 Pass
13 Fail
Pass Serialization of consecutive foo and bar tokens.
Pass Serialization of consecutive foo and bar() tokens.
Fail Serialization of consecutive foo and url(bar) tokens.
Fail Serialization of consecutive foo and - tokens.
Fail Serialization of consecutive foo and 123 tokens.
Fail Serialization of consecutive foo and 123% tokens.
Fail Serialization of consecutive foo and 123em tokens.
Fail Serialization of consecutive foo and --> tokens.
Fail Serialization of consecutive foo and () tokens.
Fail Serialization of consecutive @foo and bar tokens.
Fail Serialization of consecutive @foo and bar() tokens.
Pass Serialization of consecutive foo and - tokens.
Pass Serialization of consecutive foo and 123 tokens.
Pass Serialization of consecutive foo and 123% tokens.
Pass Serialization of consecutive foo and 123em tokens.
Pass Serialization of consecutive foo and --> tokens.
Pass Serialization of consecutive foo and () tokens.
Pass Serialization of consecutive @foo and bar tokens.
Pass Serialization of consecutive @foo and bar() tokens.
Fail Serialization of consecutive @foo and url(bar) tokens.
Fail Serialization of consecutive @foo and - tokens.
Fail Serialization of consecutive @foo and 123 tokens.
Fail Serialization of consecutive @foo and 123% tokens.
Fail Serialization of consecutive @foo and 123em tokens.
Fail Serialization of consecutive @foo and --> tokens.
Fail Serialization of consecutive #foo and bar tokens.
Fail Serialization of consecutive #foo and bar() tokens.
Pass Serialization of consecutive @foo and - tokens.
Pass Serialization of consecutive @foo and 123 tokens.
Pass Serialization of consecutive @foo and 123% tokens.
Pass Serialization of consecutive @foo and 123em tokens.
Pass Serialization of consecutive @foo and --> tokens.
Pass Serialization of consecutive #foo and bar tokens.
Pass Serialization of consecutive #foo and bar() tokens.
Fail Serialization of consecutive #foo and url(bar) tokens.
Fail Serialization of consecutive #foo and - tokens.
Fail Serialization of consecutive #foo and 123 tokens.
Fail Serialization of consecutive #foo and 123% tokens.
Fail Serialization of consecutive #foo and 123em tokens.
Fail Serialization of consecutive #foo and --> tokens.
Fail Serialization of consecutive 123foo and bar tokens.
Fail Serialization of consecutive 123foo and bar() tokens.
Pass Serialization of consecutive #foo and - tokens.
Pass Serialization of consecutive #foo and 123 tokens.
Pass Serialization of consecutive #foo and 123% tokens.
Pass Serialization of consecutive #foo and 123em tokens.
Pass Serialization of consecutive #foo and --> tokens.
Pass Serialization of consecutive 123foo and bar tokens.
Pass Serialization of consecutive 123foo and bar() tokens.
Fail Serialization of consecutive 123foo and url(bar) tokens.
Fail Serialization of consecutive 123foo and - tokens.
Fail Serialization of consecutive 123foo and 123 tokens.
Fail Serialization of consecutive 123foo and 123% tokens.
Fail Serialization of consecutive 123foo and 123em tokens.
Fail Serialization of consecutive 123foo and --> tokens.
Fail Serialization of consecutive # and bar tokens.
Fail Serialization of consecutive # and bar() tokens.
Pass Serialization of consecutive 123foo and - tokens.
Pass Serialization of consecutive 123foo and 123 tokens.
Pass Serialization of consecutive 123foo and 123% tokens.
Pass Serialization of consecutive 123foo and 123em tokens.
Pass Serialization of consecutive 123foo and --> tokens.
Pass Serialization of consecutive # and bar tokens.
Pass Serialization of consecutive # and bar() tokens.
Fail Serialization of consecutive # and url(bar) tokens.
Fail Serialization of consecutive # and - tokens.
Fail Serialization of consecutive # and 123 tokens.
Fail Serialization of consecutive # and 123% tokens.
Fail Serialization of consecutive # and 123em tokens.
Fail Serialization of consecutive - and bar tokens.
Fail Serialization of consecutive - and bar() tokens.
Pass Serialization of consecutive # and - tokens.
Pass Serialization of consecutive # and 123 tokens.
Pass Serialization of consecutive # and 123% tokens.
Pass Serialization of consecutive # and 123em tokens.
Pass Serialization of consecutive - and bar tokens.
Pass Serialization of consecutive - and bar() tokens.
Fail Serialization of consecutive - and url(bar) tokens.
Fail Serialization of consecutive - and - tokens.
Fail Serialization of consecutive - and 123 tokens.
Fail Serialization of consecutive - and 123% tokens.
Fail Serialization of consecutive - and 123em tokens.
Fail Serialization of consecutive 123 and bar tokens.
Fail Serialization of consecutive 123 and bar() tokens.
Pass Serialization of consecutive - and - tokens.
Pass Serialization of consecutive - and 123 tokens.
Pass Serialization of consecutive - and 123% tokens.
Pass Serialization of consecutive - and 123em tokens.
Pass Serialization of consecutive 123 and bar tokens.
Pass Serialization of consecutive 123 and bar() tokens.
Fail Serialization of consecutive 123 and url(bar) tokens.
Fail Serialization of consecutive 123 and 123 tokens.
Fail Serialization of consecutive 123 and 123% tokens.
Fail Serialization of consecutive 123 and 123em tokens.
Fail Serialization of consecutive 123 and % tokens.
Fail Serialization of consecutive @ and bar tokens.
Fail Serialization of consecutive @ and bar() tokens.
Pass Serialization of consecutive 123 and 123 tokens.
Pass Serialization of consecutive 123 and 123% tokens.
Pass Serialization of consecutive 123 and 123em tokens.
Pass Serialization of consecutive 123 and % tokens.
Pass Serialization of consecutive @ and bar tokens.
Pass Serialization of consecutive @ and bar() tokens.
Fail Serialization of consecutive @ and url(bar) tokens.
Fail Serialization of consecutive @ and - tokens.
Fail Serialization of consecutive . and 123 tokens.
Fail Serialization of consecutive . and 123% tokens.
Fail Serialization of consecutive . and 123em tokens.
Fail Serialization of consecutive + and 123 tokens.
Fail Serialization of consecutive + and 123% tokens.
Fail Serialization of consecutive + and 123em tokens.
Fail Serialization of consecutive / and * tokens.
Pass Serialization of consecutive @ and - tokens.
Pass Serialization of consecutive . and 123 tokens.
Pass Serialization of consecutive . and 123% tokens.
Pass Serialization of consecutive . and 123em tokens.
Pass Serialization of consecutive + and 123 tokens.
Pass Serialization of consecutive + and 123% tokens.
Pass Serialization of consecutive + and 123em tokens.
Pass Serialization of consecutive / and * tokens.
Fail Comments are handled correctly when computing a/* comment */b using t1:.
Fail Comments are handled correctly when computing a/* comment */var(--t1) using t1:b.
Fail Comments are handled correctly when computing var(--t1)b using t1:a/* comment */.
Fail Comments are handled correctly when computing var(--t1)b using t1:'a/* unfinished '.
Pass Comments are handled correctly when computing var(--t1)b using t1:"a/* unfinished ".
Fail Comments are handled correctly when computing var(--t1)b using t1:'a " '/* comment */.
Fail Empty fallback between tokens must not disturb comment insertion
Pass Empty fallback between tokens must not disturb comment insertion