Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 16977f92e64ac17ddc03794b2eb269636b659855
https://github.com/WebKit/WebKit/commit/16977f92e64ac17ddc03794b2eb269636b659855
Author: Antti Koivisto <[email protected]>
Date: 2025-06-13 (Fri, 13 Jun 2025)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-mutation-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-mutation.html
M Source/WebCore/style/AnchorPositionEvaluator.cpp
M Source/WebCore/style/StyleTreeResolver.cpp
M Source/WebCore/style/StyleTreeResolver.h
Log Message:
-----------
[css-anchor-position-1] anchor-name mutation doesn't propagate to its
anchor-positioned dependency
https://bugs.webkit.org/show_bug.cgi?id=294129
rdar://152727401
Reviewed by Alan Baradlay.
We failed to invalidate the anchored elements in some cases when an anchor
changed its name.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-mutation-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-name-mutation.html:
Added.
Test by Kiet.
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::findAnchorsForAnchorPositionedElement):
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositioningStatesAfterInterleavedLayout):
Include anchor references that we fail to resolve into
anchorPositionedToAnchorMap. They may get resolved later.
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositionedStateForLayoutTimePositioned):
Remove a hack where we created anchor positioned state for anything with
position-anchor here. It was hiding invalidation bugs.
(WebCore::Style::AnchorPositionEvaluator::updateSnapshottedScrollOffsets):
No resolved anchor -> reset scroll offset.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
Collect any changed anchor names and scopes whens style changes.
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::TreeResolver::resolve):
If there are changed anchor names use them to invalidate any existing anchor
positioned elements for another round of interleaving.
Ensure we do at least one round of interleaving if there are any style changes
and any anchor positioned elements as any style
change may cause anchors to move.
(WebCore::Style::TreeResolver::updateAnchorPositioningState):
Remove setting of m_needsInterleavedLayout on seeing any anchor names, it is no
longer needed and was hiding bugs.
(WebCore::Style::TreeResolver::collectChangedAnchorNames):
Collect the changed names and names affected by changes in anchor scopes.
* Source/WebCore/style/StyleTreeResolver.h:
Canonical link: https://commits.webkit.org/296184@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes