Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aeb822d74e8b49ed54c57069f08e44afdb43b999
      
https://github.com/WebKit/WebKit/commit/aeb822d74e8b49ed54c57069f08e44afdb43b999
  Author: Antti Koivisto <[email protected]>
  Date:   2026-09-03 (Thu, 03 Sep 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-stylesheet-change-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-stylesheet-change.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-view-transition-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-view-transition.html
    M Source/WebCore/style/AttributeChangeInvalidation.cpp
    M Source/WebCore/style/RuleFeature.cpp
    M Source/WebCore/style/RuleFeature.h
    M Source/WebCore/style/StyleResolver.cpp
    M
Source/WebCore/style/StyleScope.cpp
    M Source/WebCore/style/StyleScope.h
    M Source/WebCore/style/StyleScopeRuleSets.h

  Log Message:
  -----------
  [css-values-5] attr() stops invalidating on attribute change after a view 
transition
https://bugs.webkit.org/show_bug.cgi?id=323198
rdar://186467515

Reviewed by Alan Baradlay.

View transition code likes to throw away the style resolver where (in 
RuleFeatureSet via
ScopeRuleSets) the attribute names mentioned in attr() functions were 
registered during style
building. We ended up forgetting the attributes and style invalidation stopped 
working correctly.

Style sheet mutations hit the same bug without throwing away the resolver, as 
collectFeatures()
rebuilds RuleFeatureSet from the style sheets.

Fix by moving the map to Style::Scope. This cleans up code in general as 
RuleFeatureSet no longer
needs to be mutable.

Tests:
imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-stylesheet-change.html
       
imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-view-transition.html
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-stylesheet-change-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-stylesheet-change.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-view-transition-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-invalidation-after-view-transition.html:
 Added.
* Source/WebCore/style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* Source/WebCore/style/RuleFeature.cpp:
(WebCore::Style::RuleFeatureSet::add):
(WebCore::Style::RuleFeatureSet::clear):
(WebCore::Style::RuleFeatureSet::registerSubstitutionAttribute): Deleted.
*
Source/WebCore/style/RuleFeature.h:
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::setGlobalStateAfterApplyingProperties):
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::registerSubstitutionAttribute):
* Source/WebCore/style/StyleScope.h:
(WebCore::Style::Scope::substitutionAttribute const):
* Source/WebCore/style/StyleScopeRuleSets.h:
(WebCore::Style::ScopeRuleSets::mutableFeatures): Deleted.

Canonical link: 
https://flagged.apple.com:443/proxy?t2=DZ1C3R7cm7&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzIwNDIwQG1haW4=&emid=30a62724-6f2c-445b-a593-171fd7ee2cd7&c=11



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to