[webkit-changes] [WebKit/WebKit] ef4eef: [CSS] Implement @scope rule nested inside style rule
Matthieu Dubet
noreply at github.com
Wed Dec 6 13:59:21 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ef4eef3a7abb2e62ca9a69f8c7b81d2659db5a80
https://github.com/WebKit/WebKit/commit/ef4eef3a7abb2e62ca9a69f8c7b81d2659db5a80
Author: Matthieu Dubet <m_dubet at apple.com>
Date: 2023-12-06 (Wed, 06 Dec 2023)
Changed paths:
M LayoutTests/fast/css/scope-at-rule-expected.html
M LayoutTests/fast/css/scope-at-rule.html
M LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-nesting-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-specificity-expected.txt
M Source/WebCore/css/CSSScopeRule.cpp
M Source/WebCore/css/StyleRule.cpp
M Source/WebCore/css/StyleRule.h
M Source/WebCore/css/parser/CSSParserImpl.cpp
M Source/WebCore/style/RuleSetBuilder.cpp
M Source/WebCore/style/RuleSetBuilder.h
Log Message:
-----------
[CSS] Implement @scope rule nested inside style rule
https://bugs.webkit.org/show_bug.cgi?id=265368
rdar://103147385
Reviewed by Antti Koivisto.
Spec: https://drafts.csswg.org/css-nesting/#nesting-at-scope
* LayoutTests/fast/css/scope-at-rule-expected.html:
* LayoutTests/fast/css/scope-at-rule.html:
Example removed because unsure about the actual spec expectation for this:
div {
@scope (.a) {
.green { color: green; }
}
}
Should the inner rule be translated to ":scope .green" ? ":is(div) .green" ? ":is(div) :scope .green" ?
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-nesting-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-specificity-expected.txt:
* Source/WebCore/css/CSSScopeRule.cpp:
(WebCore::CSSScopeRule::start const):
(WebCore::CSSScopeRule::end const):
* Source/WebCore/css/StyleRule.cpp:
(WebCore::StyleRuleScope::StyleRuleScope):
(WebCore::StyleRuleScope::scopeStart const): Deleted.
(WebCore::StyleRuleScope::scopeEnd const): Deleted.
* Source/WebCore/css/StyleRule.h:
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeScopeRule):
* Source/WebCore/style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::addChildRule):
(WebCore::Style::RuleSetBuilder::resolveSelectorListWithNesting):
(WebCore::Style::RuleSetBuilder::addStyleRule):
* Source/WebCore/style/RuleSetBuilder.h:
Canonical link: https://commits.webkit.org/271632@main
More information about the webkit-changes
mailing list