[webkit-changes] [WebKit/WebKit] 2cfe18: [CSS] Allow nesting style rule with relaxed syntax

Matthieu Dubet noreply at github.com
Fri Sep 1 07:02:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2cfe184f6dbee766aefa51db1de3e613c185b0fb
      https://github.com/WebKit/WebKit/commit/2cfe184f6dbee766aefa51db1de3e613c185b0fb
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/cssom-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/parser/CSSParserImpl.h
    M Source/WebCore/css/parser/CSSSelectorParser.cpp

  Log Message:
  -----------
  [CSS] Allow nesting style rule with relaxed syntax
https://bugs.webkit.org/show_bug.cgi?id=260812
rdar://113475843

Reviewed by Antti Koivisto.

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

The CSS nesting spec now allows having identifier as the first token
in the nested style rule selector.
This implementation follows the spec algorithm of first trying to parse
a declaration, then a nested style rule, otherwise it goes to error recovery (until next semicolon).

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/cssom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt:
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeStyleRule):
(WebCore::CSSParserImpl::consumeBlockContent):
(WebCore::CSSParserImpl::consumeDeclarationListInNewNestingContext):
(WebCore::CSSParserImpl::consumeDeclarationList):
(WebCore::CSSParserImpl::consumeStyleBlock):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeDeclarationListOrStyleBlockHelper): Deleted.
* Source/WebCore/css/parser/CSSParserImpl.h:
* Source/WebCore/css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeNestedSelectorList):

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




More information about the webkit-changes mailing list