LibWeb/CSS: Keep invalid parts of <forgiving-selector-list>s around

Selectors like `:is(.valid, &!?!?!invalid)` need to keep the invalid
part around, even though it will never match, for a couple of reasons:

- Serialization needs to include them
- For nesting, we care if a `&` appeared anywhere in the selector, even
  in an invalid part.

So this patch introduces an `Invalid` simple selector type, which simply
holds its original ComponentValues. We search through these looking for
`&`, and we dump them out directly when asked to serialize.
This commit is contained in:
Sam Atkins 2024-11-13 15:49:43 +00:00 committed by Andreas Kling
commit 698dd600f2
Notes: github-actions[bot] 2024-11-13 19:39:05 +00:00
8 changed files with 110 additions and 3 deletions

View file

@ -0,0 +1,2 @@
:is(hello, !?) -> :is(hello, !?)
:is(what, :fake(:imaginary), really) -> :is(what, :fake(:imaginary), really)