[webkit-changes] [WebKit/WebKit] 801286: [CSS Container Queries][Style queries] Update styl...

Antti Koivisto noreply at github.com
Wed Feb 28 08:00:09 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 801286aa3dcb9720da3f98e6d25ce5e1ab5b79bb
      https://github.com/WebKit/WebKit/commit/801286aa3dcb9720da3f98e6d25ce5e1ab5b79bb
  Author: Antti Koivisto <antti at apple.com>
  Date:   2024-02-28 (Wed, 28 Feb 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/custom-property-style-query-change-expected.txt
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/style/RuleSet.cpp
    M Source/WebCore/style/RuleSet.h
    M Source/WebCore/style/StyleScopeRuleSets.cpp
    M Source/WebCore/style/StyleScopeRuleSets.h
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.h

  Log Message:
  -----------
  [CSS Container Queries][Style queries] Update style correctly for non-inherited custom property mutations
https://bugs.webkit.org/show_bug.cgi?id=270110
rdar://123645196

Reviewed by Alan Baradlay.

Mutating a custom property referenced in a style query needs to re-evaluate descendant styles or potential
style containers. This needs to happen also when the custom property is non-inherited.

* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/custom-property-style-query-change-expected.txt:
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::customPropertyValueEqual const):

Add a helper.

* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/style/RuleSet.cpp:
(WebCore::Style::RuleSet::containerQueryRules const):
* Source/WebCore/style/RuleSet.h:
* Source/WebCore/style/StyleScopeRuleSets.cpp:
(WebCore::Style::ScopeRuleSets::collectFeatures const):
(WebCore::Style::ScopeRuleSets::customPropertyNamesInStyleContainerQueries const):

Collect all the property names used in style queries.

* Source/WebCore/style/StyleScopeRuleSets.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::computeDescendantsToResolve const):

Check if we have property dependent style queries and if so see if their value has changed.
If it has we need to re-resolve the descendants.

(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::computeDescendantsToResolve): Deleted.
* Source/WebCore/style/StyleTreeResolver.h:

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



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


More information about the webkit-changes mailing list