Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3fbfed522d7d675bfaea837af1a854aa8d1041ae
https://github.com/WebKit/WebKit/commit/3fbfed522d7d675bfaea837af1a854aa8d1041ae
Author: Chris Dumez <[email protected]>
Date: 2026-04-04 (Sat, 04 Apr 2026)
Changed paths:
M Source/WebCore/rendering/RenderLayer.cpp
Log Message:
-----------
Fix missing m_hasStickyAncestor check in
RenderLayer::ancestorLayerPositionStateChanged
https://bugs.webkit.org/show_bug.cgi?id=311481
Reviewed by Alan Baradlay.
ancestorLayerPositionStateChanged() had a duplicate check for
m_hasPaginatedAncestor/UpdatePagination and was missing the check for
m_hasStickyAncestor/SeenStickyLayer. Every other state bit tracked by
UPDATE_OR_VERIFY_STATE_BIT in recursiveUpdateLayerPositions had a
corresponding check in this function except m_hasStickyAncestor.
Without this check, if m_hasStickyAncestor becomes stale on a
descendant layer, ancestorLayerPositionStateChanged() will not detect
the mismatch, SubtreeNeedsUpdate will not be set, and the descendant
will be skipped rather than updated.
No new tests. ancestorLayerPositionStateChanged() is a safety net that
catches cases where the normal dirty-bit propagation is insufficient to
update descendant state. In practice, changing position:sticky triggers
layout, which dirties layers via repaint-status changes, causing
updateLayerPositionsAfterLayout to traverse and update the full subtree
through the normal path. The safety net only matters for edge cases
where an ancestor's state changes but descendants remain clean while
the tree is being traversed for an unrelated reason -- a scenario that
is difficult to trigger deterministically from web content. The
existing LAYER_POSITIONS_ASSERT verification mode covers this in debug
builds.
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::ancestorLayerPositionStateChanged):
Canonical link: https://commits.webkit.org/310586@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications