[webkit-changes] [WebKit/WebKit] 327568: Fix style invalidation of IDs within :nth-child/:n...

Tim Nguyen noreply at github.com
Thu Jun 8 08:49:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 32756878ae2c401f8c7e9f68557b0e5caa2027c7
      https://github.com/WebKit/WebKit/commit/32756878ae2c401f8c7e9f68557b0e5caa2027c7
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-06-08 (Thu, 08 Jun 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/style/IdChangeInvalidation.cpp
    M Source/WebCore/style/IdChangeInvalidation.h
    M Source/WebCore/style/RuleFeature.cpp

  Log Message:
  -----------
  Fix style invalidation of IDs within :nth-child/:nth-last-child
https://bugs.webkit.org/show_bug.cgi?id=257848
rdar://110451692

Reviewed by Antti Koivisto.

When IDs change within :nth-child / :nth-last-child, we have to use ruleset invalidation, for this:

1. we collect the ID features when MatchElement is AnySibling in RuleFeatureSet (:nth-child/last-child selectors)
2. we store the match element rulesets on IdChangeInvalidation, since we'll want to run ruleset invalidation both
before & after (ID changes can affect siblings even when the new ID is not in the CSS)

* LayoutTests/TestExpectations:
* Source/WebCore/style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
(WebCore::Style::IdChangeInvalidation::invalidateStyleWithRuleSets):
* Source/WebCore/style/IdChangeInvalidation.h:
(WebCore::Style::IdChangeInvalidation::IdChangeInvalidation):
(WebCore::Style::IdChangeInvalidation::~IdChangeInvalidation):
* Source/WebCore/style/RuleFeature.cpp:
(WebCore::Style::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):

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




More information about the webkit-changes mailing list