[webkit-changes] [WebKit/WebKit] 40cf94: [CSS] Respect proximity in the cascade

Matthieu Dubet noreply at github.com
Tue Dec 5 10:13:32 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 40cf94b5b6f9268ea70a80d6bf2f871115c11882
      https://github.com/WebKit/WebKit/commit/40cf94b5b6f9268ea70a80d6bf2f871115c11882
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2023-12-05 (Tue, 05 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-proximity-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-specificity-expected.txt
    M Source/WebCore/style/ElementRuleCollector.cpp
    M Source/WebCore/style/ElementRuleCollector.h

  Log Message:
  -----------
  [CSS] Respect proximity in the cascade
https://bugs.webkit.org/show_bug.cgi?id=264943
rdar://118507507

Reviewed by Antti Koivisto.

https://drafts.csswg.org/css-cascade-6/#cascade-proximity

CSS Cascade level 6 introduces the new concept of proximity to decide
which rule to apply : the closest scope will be prioritized.

* LayoutTests/fast/css/scope-at-rule-expected.html:
* LayoutTests/fast/css/scope-at-rule.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-proximity-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-specificity-expected.txt:
* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::addMatchedRule):
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
(WebCore::Style::ElementRuleCollector::scopeRulesMatch):
(WebCore::Style::compareRules):
* Source/WebCore/style/ElementRuleCollector.h:

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




More information about the webkit-changes mailing list