[css-anchor-position-1] Fix intrinsic layout of anchor-positioned element after visibility change#35418
Conversation
|
EWS run on previous version of this PR (hash c01441f) Details |
There was a problem hiding this comment.
The fix seems logically correct (if we don't have a style we need to compute it). Can you tell why this hasn't caused trouble elsewhere and why it does cause trouble with anchor positioning?
You can just write
if (!existingStyle || existingStyle->hasExplicitlyInheritedProperties())
There was a problem hiding this comment.
Good point.
As for why it does work without anchor positioning - in that scenarios the resolution of children of element that became visible again is being done altogether always. In that case, in WebCore::Style::TreeResolver::computeDescendantsToResolve() we're hitting case Change::Renderer: that forces full resolution (yields DescendantsToResolve::All). Moreover, further down the road in TreeResolver::determineResolutionType() we have combinedValidity equal to WebCore::Style::Validity::SubtreeInvalid (for entire subtree) that leads to full resolution of all subtree elements. With anchor-positioning, if the element that become visible again is anchor positioned, at the point when update.change resolves to Change::Renderer only the original element creates renderer - it's children have to wait for anchor-positioning resolution. When it finally is done (few passes after) the update.change resolves to DescendantsToResolve::ChildrenWithExplicitInherit which then leads to no resolution in TreeResolver::determineResolutionType() as such corner-case was never happening before. The fix proposed in this PR just handles such unhanded case.
c01441f to
5aa9afe
Compare
|
EWS run on current version of this PR (hash 5aa9afe) Details |
…ment after visibility change https://bugs.webkit.org/show_bug.cgi?id=281728 Reviewed by Antti Koivisto. Since style resolution is not being done in one pass when anchoring is used, block elements hold its children resolution until resolving anchors is done. In that case - when it finally happens - the resolution of block element children is not enforced (as it would be during 1st pass) and the children are not willing to "force update" and create renderers in the process. The net outcome is that children of elements that became visible again, are not rendered. This change fixes the above issue by extending one of the conditions that leads to creation of renderers when the resolution is deferred due to anchoring. * LayoutTests/TestExpectations: * Source/WebCore/style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::determineResolutionType): Canonical link: https://commits.webkit.org/285486@main
5aa9afe to
8a01164
Compare
|
Committed 285486@main (8a01164): https://commits.webkit.org/285486@main Reviewed commits have been landed. Closing PR #35418 and removing active labels. |
8a01164
5aa9afe