Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 37707f5c5229f30a2100a1477025ed53118d638a
https://github.com/WebKit/WebKit/commit/37707f5c5229f30a2100a1477025ed53118d638a
Author: Kate Lee <[email protected]>
Date: 2026-09-16 (Wed, 16 Sep 2026)
Changed paths:
M LayoutTests/TestExpectations
A LayoutTests/fast/css/scroll-state-query-non-scroll-container-expected.txt
A LayoutTests/fast/css/scroll-state-query-non-scroll-container.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-initially-scrollable-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-query-with-var-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-axis-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-body-001-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-body-002-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-change-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-container-type-change-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-layout-change-002-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-layout-change-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-pseudo-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-root-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-wm-expected.txt
M Source/WebCore/css/query/ContainerQueryFeatures.cpp
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/Element.h
M Source/WebCore/page/Page.cpp
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderView.cpp
M Source/WebCore/rendering/RenderView.h
M Source/WebCore/style/StyleDocumentScope.cpp
M Source/WebCore/style/StyleDocumentScope.h
Log Message:
-----------
Evaluate scroll-state(scrollable) container queries
https://bugs.webkit.org/show_bug.cgi?id=319791
Reviewed by Antti Koivisto.
scroll-state(scrollable) was recognized but always evaluated to false. Implement
it, for both the initial rendering and after scrolling.
Querying scroll state can cause layout cycles: a query result changes style,
style changes layout, and layout changes the queried state. The spec avoids this
by snapshotting the state after layout and querying that snapshot until the next
one is taken.
Take it in RenderingUpdateStep::SnapshottedScrollOffsets, where anchor
positioning
already snapshots its scroll adjustments, keeping the containers in a registry
of
their own and invalidating only those whose state changed. Scrolling schedules a
rendering update, so this covers scrolling without scroll-specific plumbing.
* LayoutTests/TestExpectations:
* LayoutTests/fast/css/scroll-state-query-non-scroll-container.html: Added.
* LayoutTests/fast/css/scroll-state-query-non-scroll-container-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-initially-scrollable-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-query-with-var-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-axis-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-body-001-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-body-002-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-change-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-container-type-change-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-layout-change-002-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-layout-change-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-pseudo-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-root-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/scroll-state/scroll-state-scrollable-wm-expected.txt:
* Source/WebCore/css/query/ContainerQueryFeatures.cpp:
(WebCore::CQ::Features::ScrollableFeatureSchema::evaluate const):
(WebCore::CQ::Features::scrollableFeatureSchema):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::invalidateForQueryContainerChange):
(WebCore::Element::invalidateForQueryContainerSizeChange): Deleted.
* Source/WebCore/dom/Element.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::updateRendering):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::styleWillChange):
* Source/WebCore/rendering/RenderView.cpp:
(WebCore::RenderView::registerScrollStateQueryBox):
(WebCore::RenderView::unregisterScrollStateQueryBox):
* Source/WebCore/rendering/RenderView.h:
* Source/WebCore/style/StyleDocumentScope.cpp:
(WebCore::Style::DocumentScope::invalidateForContainerDependencies):
(WebCore::Style::scrollableEdges):
(WebCore::Style::DocumentScope::updateScrollStateSnapshots):
(WebCore::Style::DocumentScope::scrollStateSnapshotFor const):
* Source/WebCore/style/StyleDocumentScope.h:
Canonical link: https://commits.webkit.org/321252@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications