Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e2fc90f7fb3453a248da7cfd0d5385403a705c46
https://github.com/WebKit/WebKit/commit/e2fc90f7fb3453a248da7cfd0d5385403a705c46
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-style-dynamic-001-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-style-containment-001-expected.txt
M Source/WebCore/rendering/RenderElement.cpp
M Source/WebCore/rendering/RenderView.h
M Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp
Log Message:
-----------
Dynamically toggling style containment (contain: style / content-visibility)
does not rebuild the counter tree
https://bugs.webkit.org/show_bug.cgi?id=324628
rdar://187880450
Reviewed by Alan Baradlay.
Counter and quote scoping treat an element with style containment as a
scope boundary. When that boundary appears or disappears at runtime, the
generated content built against the old scoping is stale.
Quotes already had an invalidation path in RenderElement::styleDidChange,
but counters had none, and the quote path only checked usedContain()'s
Style bit, missing content-visibility: hidden/auto (which also turn on
effective style containment).
This computes effective style containment (via ContainmentChecker) across
the old and new style and, when it changes, invalidates both quotes and
the counter tree. Counter invalidation mirrors quotes: a RenderView flag
drives a teardown of the counter node maps in updateCounters(), which
re-registers the RenderCounters so the existing loop lazily rebuilds the
tree with the new scoping.
As a drive-by, gave meaningful names to the bool arguments of
setHasCounterTreeNeedingUpdate/setHasQuotesNeedingUpdate.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-style-dynamic-001-expected.txt:
Progressions
*
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-style-containment-001-expected.txt:
Ditto
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
* Source/WebCore/rendering/RenderView.h:
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updateCounters):
Canonical link: https://commits.webkit.org/321497@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications