[webkit-changes] [WebKit/WebKit] 41f7a3: [CSS] Always serialize implicit nesting selector/rule

Matthieu Dubet noreply at github.com
Thu Aug 31 16:22:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 41f7a301e412e75355904d8aa98393810cd91e3a
      https://github.com/WebKit/WebKit/commit/41f7a301e412e75355904d8aa98393810cd91e3a
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls-expected.txt
    M LayoutTests/inspector/css/getMatchedStylesForNodeNestingStyleGrouping-expected.txt
    M Source/WebCore/css/CSSGroupingRule.cpp
    M Source/WebCore/css/SelectorChecker.cpp
    M Source/WebCore/css/parser/CSSParserSelector.cpp
    M Source/WebCore/css/parser/CSSParserSelector.h
    M Source/WebCore/css/parser/CSSSelectorParser.cpp

  Log Message:
  -----------
  [CSS] Always serialize implicit nesting selector/rule
https://bugs.webkit.org/show_bug.cgi?id=260707
rdar://112900363

Reviewed by Patrick Angle and Antti Koivisto.

https://drafts.csswg.org/css-nesting/#cssom

"When serializing a relative selector in a nested style rule,
the selector must be absolutized, with the implied nesting selector inserted.
When serializing a nested group rule, it must serialize solely with child rules."

This patch moves the code which build the selector with the implicit & added
from rule set building time to parsing time.

* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls-expected.txt:
* LayoutTests/inspector/css/getMatchedStylesForNodeNestingStyleGrouping-expected.txt:
* Source/WebCore/css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::cssTextForDeclsAndRules const):
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* Source/WebCore/css/parser/CSSParserSelector.cpp:
(WebCore::CSSParserSelector::hasExplicitNestingParent const):
* Source/WebCore/css/parser/CSSParserSelector.h:
(WebCore::CSSParserSelector::selector const):
* Source/WebCore/css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeNestedComplexSelector):
(WebCore::CSSSelectorParser::resolveNestingParent):

Canonical link: https://commits.webkit.org/267531@main




More information about the webkit-changes mailing list