[webkit-changes] [WebKit/WebKit] 9c97e5: [CSS Container Queries][Style queries] Resolve cus...

Antti Koivisto noreply at github.com
Mon Feb 12 10:55:31 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9c97e55d92afcdf5c161edf21a59efe47a86d10c
      https://github.com/WebKit/WebKit/commit/9c97e55d92afcdf5c161edf21a59efe47a86d10c
  Author: Antti Koivisto <antti at apple.com>
  Date:   2024-02-12 (Mon, 12 Feb 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-parsing-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/custom-property-style-queries-expected.txt
    M Source/WebCore/css/query/ContainerQueryFeatures.cpp
    M Source/WebCore/css/query/GenericMediaQueryParser.cpp
    M Source/WebCore/style/ContainerQueryEvaluator.cpp
    M Source/WebCore/style/StyleBuilder.cpp
    M Source/WebCore/style/StyleBuilder.h

  Log Message:
  -----------
  [CSS Container Queries][Style queries] Resolve custom properties in style queries if needed
https://bugs.webkit.org/show_bug.cgi?id=269189
rdar://122793669

Reviewed by Alan Baradlay.

Handle style(--foo:var(bar)), style(--foo:inherit) and registered custom properties.

* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-parsing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/custom-property-style-queries-expected.txt:
* Source/WebCore/css/query/ContainerQueryFeatures.cpp:

Resolve custom property values in style queries against the current style and registered property enviroment using Style::Builder.

* Source/WebCore/css/query/GenericMediaQueryParser.cpp:

Parse the custom property value in query using the path that returns unresolved and css-wide keyword values if needed.

(WebCore::MQ::consumeCustomPropertyValue):
* Source/WebCore/style/ContainerQueryEvaluator.cpp:

Pass also the parent style so 'inherit' can be resolved correctly.

(WebCore::Style::ContainerQueryEvaluator::featureEvaluationContextForQuery const):
* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::resolveCustomPropertyForContainerQueries):

Expose a helper for this case.

* Source/WebCore/style/StyleBuilder.h:

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




More information about the webkit-changes mailing list