[webkit-changes] [WebKit/WebKit] dedf70: [CSS] Mark selector as implicit to ignore them in ...

Matthieu Dubet noreply at github.com
Thu Dec 7 08:37:23 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dedf708653ff64d0743e6be773311fec317cd601
      https://github.com/WebKit/WebKit/commit/dedf708653ff64d0743e6be773311fec317cd601
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2023-12-07 (Thu, 07 Dec 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-specificity-expected.txt
    M Source/WebCore/css/CSSSelector.cpp
    M Source/WebCore/css/CSSSelector.h
    M Source/WebCore/css/parser/CSSParserImpl.cpp

  Log Message:
  -----------
  [CSS] Mark selector as implicit to ignore them in specificity calculation
https://bugs.webkit.org/show_bug.cgi?id=265992
rdar://119307433

Reviewed by Antti Koivisto.

We sometimes insert non author written selectors in the selector list
(for cases like `:has(> foo)` or scoped or nested selectors).
We should not count those implicit selectors in the specificity calculation.

* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-specificity-expected.txt:
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::SelectorSpecificity::specificityTuple const):
(WebCore::SelectorSpecificity::debugDescription const):
(WebCore::operator<<):
(WebCore::selectorSpecificity):
(WebCore::maxSpecificity):
(WebCore::simpleSelectorSpecificity):
(WebCore::CSSSelector::computeSpecificityTuple const):
(WebCore::CSSSelector::CSSSelector):
* Source/WebCore/css/CSSSelector.h:
(WebCore::CSSSelector::setImplicit):
(WebCore::CSSSelector::isImplicit const):
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeStyleRule):

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




More information about the webkit-changes mailing list