Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a2b3ca6b9e95d8b94200d874fd95e3dd36f873ab
https://github.com/WebKit/WebKit/commit/a2b3ca6b9e95d8b94200d874fd95e3dd36f873ab
Author: Antti Koivisto <[email protected]>
Date: 2026-09-04 (Fri, 04 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-container-query-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-container-query-invalidation-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-container-query.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-if-style-query-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-if-style-query.html
M Source/WebCore/css/MediaQueryParserContext.h
M Source/WebCore/css/calc/CSSCalcTree+Parser.cpp
M Source/WebCore/css/parser/CSSPropertyParserState.h
M Source/WebCore/css/query/ContainerQueryFeatures.cpp
M Source/WebCore/css/query/ContainerQueryParser.cpp
M Source/WebCore/css/query/GenericMediaQueryParser.cpp
M Source/WebCore/style/ContainerQueryEvaluator.cpp
M Source/WebCore/style/ContainerQueryEvaluator.h
Log Message:
-----------
[css-values-5] Support tree counting functions in container queries
https://bugs.webkit.org/show_bug.cgi?id=323319
rdar://186564084
Reviewed by Alan Baradlay.
They should work per https://github.com/w3c/csswg-drafts/issues/10982.
Two things stopped them. They were rejected at parse time by a currentProperty
test standing in for
"no element to resolve against", which a container query condition does have.
Replace it with an
explicit treeCountingFunctionsAllowed. Media queries keep rejecting them, which
is what makes them
evaluate to unknown.
Resolving one also needs a BuilderState and ContainerQueryEvaluator built its
conversion data
without one. Make it for the container and take the conversion data from that,
like
IfConditionEvaluator does. The style() declaration form was already doing this
the long way around
with a Builder of its own, which is why that form worked and nothing else did.
Invalidation on sibling changes is still missing.
Test:
imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-if-style-query.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-container-query-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-container-query-invalidation-expected.txt:
Still failing, but later: the queries now match, they just don't invalidate.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-container-query.html:
Cover the style() range form too, which nothing tested.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-if-style-query-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/tree-counting/sibling-function-if-style-query.html:
Added.
* Source/WebCore/css/MediaQueryParserContext.h:
* Source/WebCore/css/calc/CSSCalcTree+Parser.cpp:
(WebCore::CSSCalc::parseCalcFunction):
* Source/WebCore/css/parser/CSSPropertyParserState.h:
* Source/WebCore/css/query/ContainerQueryFeatures.cpp:
(WebCore::CQ::Features::evaluateStyleRangeValue):
(WebCore::CQ::Features::StyleFeatureSchema::localPropertyRegistry):
Both evaluators that reach a style() feature have a builder state now, so stop
testing for it.
* Source/WebCore/css/query/ContainerQueryParser.cpp:
(WebCore::CQ::ContainerQueryParser::consumeContainerCondition):
* Source/WebCore/css/query/GenericMediaQueryParser.cpp:
(WebCore::MQ::consumeValue):
* Source/WebCore/style/ContainerQueryEvaluator.cpp:
(WebCore::Style::ContainerQueryEvaluator::featureEvaluationContextForCondition
const):
* Source/WebCore/style/ContainerQueryEvaluator.h:
Canonical link: https://commits.webkit.org/320493@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications