[css-nesting] Implement CSSNestedDeclarations behind a flag
The CSSWG recently resolved to change how "bare" declarations work
when mixed with nested style rules. Previously, any declaration
following a nested style rule would be "shifted up" to join
the leading declarations, but as of the work leading up to
Issue 10234 [1], such declarations now instead remain in place
(wrapped in a CSSNestedDeclarations rule).
This CL implements this rule, as well as the parser changes needed
to produce those rules during ConsumeDeclarationList.
The parsing behavior is similar to the behavior previously seen
for emitting signalling/invisible rules (removed in CL:5593832),
although naturally without any signalling, nor any invisibility.
Per spec, CSSNestedDeclarations is a kind of style rule that matches
exactly what its parent style rule matches, and with the same
specificity behavior. This is different from the '&' pseudo-class,
which uses the maximum specificity across its arguments, and can't
match pseudo-elements. This CL implements this via an inner
StyleRule, held by the CSSNestedDeclarations rule.
This inner StyleRule can't be observed via CSSOM. It exists primarily
to be able to bucket the rule normally on RuleSet.
Change-Id: If9afe0cbb41e7de0acdd781ecfbf6884d677c6f8
Binary-Size: crbug.com/344608183
Bug: 343463516, 361600667
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5594117
Reviewed-by: Steinar H Gunderson sesse@chromium.org
Commit-Queue: Anders Hartvoll Ruud andruud@chromium.org
Reviewed-by: Philip Pfaffe pfaffe@chromium.org
Cr-Commit-Position: refs/heads/main@{#1347266}