[webkit-changes] [WebKit/WebKit] 20ce50: Invalidate :has(~ :is(.x ~ .y)) correctly

Cameron McCormack noreply at github.com
Tue Sep 12 22:35:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 20ce50e23068f44e6025e5d6c4196d8aa1116add
      https://github.com/WebKit/WebKit/commit/20ce50e23068f44e6025e5d6c4196d8aa1116add
  Author: Cameron McCormack <heycam at apple.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/is-pseudo-containing-complex-in-has-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/not-pseudo-containing-complex-in-has-expected.txt
    M Source/WebCore/style/ClassChangeInvalidation.cpp
    M Source/WebCore/style/RuleFeature.cpp
    M Source/WebCore/style/RuleFeature.h
    M Source/WebCore/style/StyleInvalidator.cpp

  Log Message:
  -----------
  Invalidate :has(~ :is(.x ~ .y)) correctly
https://bugs.webkit.org/show_bug.cgi?id=261370
rdar://problem/115205991

Reviewed by Antti Koivisto.

While selectors like

:has(~ .x ~ .y)

need only consider the later siblings of an element with class name "x"
or "y" changes, those like

:has(~ :is(.x ~ .y))

must also consider previous siblings for "x" changes, since the ~
combinator inside the :is() can select past the :has scope.

* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/is-pseudo-containing-complex-in-has-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/not-pseudo-containing-complex-in-has-expected.txt:
* Source/WebCore/style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):
* Source/WebCore/style/RuleFeature.cpp:
(WebCore::Style::isSiblingOrSubject):
(WebCore::Style::isHasPseudoClassMatchElement):
(WebCore::Style::computeNextHasPseudoClassMatchElement):
(WebCore::Style::computeHasPseudoClassMatchElement):
* Source/WebCore/style/RuleFeature.h:
(WebCore::Style::RuleFeatureSet::usesHasPseudoClass const):
* Source/WebCore/style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):

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




More information about the webkit-changes mailing list