Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0d64e94f2964423be2ad575d4913a8df40a0a639
https://github.com/WebKit/WebKit/commit/0d64e94f2964423be2ad575d4913a8df40a0a639
Author: Alan Baradlay <[email protected]>
Date: 2026-08-12 (Wed, 12 Aug 2026)
Changed paths:
A LayoutTests/fast/ruby/append-rt-to-ruby-grid-item-expected.txt
A LayoutTests/fast/ruby/append-rt-to-ruby-grid-item.html
M Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp
Log Message:
-----------
[anon-block-removal] A block level box is left inside an anonymous flex or
grid item
https://bugs.webkit.org/show_bug.cgi?id=321487
Reviewed by Antti Koivisto.
A ruby is a rebuild root, so appending a child to one destroys and recreates
its renderer. Detaching it from a
grid merges the anonymous items on either side of it, and on re-attach the box
it comes before is no longer the
merged item's first child, so findParentAndBeforeChildForNonSibling puts the
block level ruby inside that item
instead of next to it. It stops being a grid item and never lays out.
That misplacement is not new, but the anonymous block path used to undo it:
attach ends the inline parent with
block child case by calling removeLeftoverAnonymousBlock, which hoists
everything back into the grid.
shouldBuildAnonymousBlock is what leads there, and it asks the parent for its
display value. The parent here is
the anonymous item, whose display comes from the content it wraps rather than
from the grid, so the answer is no
and the box stays where it was put.
Ask what an anonymous item is an item of. Inline content and a block level box
may not share one item, which is
what the display values already listed there stand for.
* LayoutTests/fast/ruby/append-rt-to-ruby-grid-item.html: Added.
* LayoutTests/fast/ruby/append-rt-to-ruby-grid-item-expected.txt: Added.
* Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::attach):
Canonical link: https://commits.webkit.org/319032@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications