Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fecb6a8fbcc7d3a1278988ab0d8824e5b941c80a
https://github.com/WebKit/WebKit/commit/fecb6a8fbcc7d3a1278988ab0d8824e5b941c80a
Author: Brent Fulgham <[email protected]>
Date: 2026-04-22 (Wed, 22 Apr 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-style-dynamic-001-expected.txt
M Source/WebCore/rendering/RenderElement.cpp
M Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp
M Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h
Log Message:
-----------
[css-contain] Support contain:style for quotes
https://bugs.webkit.org/show_bug.cgi?id=232083
rdar://84758186
Reviewed by Antti Koivisto.
WebKit does not honor the CSS Containment spec requirement that
contain:style creates a scoping boundary for quote depth. Quotes inside
a style-contained element inherit the current depth from the outer scope,
but depth changes inside do not propagate back out.
Add a scope stack to updateQuotesUpTo() that tracks contain:style
boundaries during quote processing. When entering a new containment
scope, the stack inherits the parent scope's last quote so inner quotes
start at the correct depth. When leaving a scope, the parent scope's
state is restored so outer quotes are unaffected by inner depth changes.
Also trigger quote recalculation when contain:style changes dynamically
on any element, since this alters scope boundaries for existing quotes.
Tests: imported/w3c/web-platform-tests/css/css-contain/quote-scoping-001.html
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-002.html
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-003.html
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-004.html
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-invalidation-001.html
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-invalidation-003.html
imported/w3c/web-platform-tests/css/css-contain/quote-scoping-invalidation-004.html
* LayoutTests/TestExpectations:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-style-dynamic-001-expected.txt:
Document the new PASS condition.
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange): Set hasQuotesNeedingUpdate when style
containment
changes on an element.
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updateRemainingQuotes): Clear
scope stack
after full pass.
(WebCore::findQuoteScopeRoot): Added. Walks ancestors to find the nearest
contain:style boundary.
(WebCore::RenderTreeUpdater::GeneratedContent::popExitedQuoteScopes): Added.
Unwinds
the scope stack when a quote is no longer inside the top scope.
(WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):Use scope
stack to pass
the correct previous quote per containment scope instead of flat document order.
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h:
Canonical link: https://commits.webkit.org/311785@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications