Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 42e9fa251171f9e4f0ec6f3599c63f04972cfd31
https://github.com/WebKit/WebKit/commit/42e9fa251171f9e4f0ec6f3599c63f04972cfd31
Author: Kate Lee <[email protected]>
Date: 2026-07-11 (Sat, 11 Jul 2026)
Changed paths:
M Source/WebCore/css/query/ContainerQuery.h
M Source/WebCore/css/query/ContainerQueryFeatures.cpp
M Source/WebCore/css/query/ContainerQueryFeatures.h
M Source/WebCore/css/query/ContainerQueryParser.cpp
M Source/WebCore/style/ContainerQueryEvaluator.cpp
M Source/WebCore/style/ContainerQueryEvaluator.h
M Source/WebCore/style/values/primitives/StyleLengthResolution.cpp
Log Message:
-----------
Select a scroll-state query container ahead of scroll state evaluation
https://bugs.webkit.org/show_bug.cgi?id=317758
Reviewed by Antti Koivisto.
A scroll-state() container query (scrollable/scrolled/stuck/snapped) must select
an ancestor query container whose container-type includes scroll-state, just as
a size query selects a size container. Previously a query only recorded the size
axes it needs, so scroll-state queries recorded nothing and were treated like
style queries, matching any ancestor container.
Introduce CQ::ContainerRequirements, bundling the size axes a query constrains
with whether it needs a scroll-state container, and store it on ContainerQuery.
selectContainer() requires ContainerType::hasScrollState() for scroll-state
queries and keeps the writing-mode-aware size-axis matching for size queries;
style and scroll-state queries (which need no size container) follow the same
ancestor walk and resolve against the container's pending style.
Feature evaluation remains stubbed; actual scrollable/scrolled/stuck/snapped
evaluation, and tests exercising container selection, are a follow-up.
Spec: https://drafts.csswg.org/css-conditional-5/#scroll-state-container
* Source/WebCore/css/query/ContainerQuery.h:
* Source/WebCore/css/query/ContainerQueryFeatures.h:
* Source/WebCore/css/query/ContainerQueryFeatures.cpp:
* Source/WebCore/css/query/ContainerQueryParser.cpp:
* Source/WebCore/style/ContainerQueryEvaluator.h:
* Source/WebCore/style/ContainerQueryEvaluator.cpp:
* Source/WebCore/style/values/primitives/StyleLengthResolution.cpp:
Canonical link: https://commits.webkit.org/316961@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications