Skip to content

Commit e94f977

Browse files
committed
Do not clear fragmented state when removing inline renderer's anonymous wrapper
https://bugs.webkit.org/show_bug.cgi?id=242734 Reviewed by Antti Koivisto. When the anonymous block wrapper for an inline level child is not needed anymore (sibling block is removed or became non-inflow), we 1. detach the inline level child (and its subtree) 2. destroy the anonymous wrapper 3. re-attach the inline level child under the new parent (most likely the parent of the destroyed anonymous wrapper) We call this re-parenting activity an "internal move". Certain properties (e.g fragmentation state) are not supposed to change during this type of move (we simply stop calling some "reset" functions when RenderObject::IsInternalMove::Yes) This patch ensures that the internal move flag is set for both #1 and #3. * Source/WebCore/rendering/RenderBlockFlow.cpp: drive-by fix to ensure no ruby content gets multi-column context. (WebCore::RenderBlockFlow::willCreateColumns const): * Source/WebCore/rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded): Make sure both detach and attach are covered with the "internal move" flag as currently only the attach is covered. It means that whatever flags we reset at detach (not an internal move) we don't set back on attach (internal move). Canonical link: https://commits.webkit.org/252456@main
1 parent 4e6bb84 commit e94f977

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Source/WebCore/rendering/RenderBlockFlow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ bool RenderBlockFlow::willCreateColumns(std::optional<unsigned> desiredColumnCou
428428
// The following types are not supposed to create multicol context.
429429
if (isFileUploadControl() || isTextControl() || isListBox())
430430
return false;
431-
if (isRenderSVGBlock() || isRubyRun())
431+
if (isRenderSVGBlock() || isRubyRun() || isRubyBlock() || isRubyInline() || isRubyBase())
432432
return false;
433433
#if ENABLE(MATHML)
434434
if (isRenderMathMLBlock())

Source/WebCore/rendering/updating/RenderTreeBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ void RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded(RenderE
822822
}
823823

824824
RenderObject* next = nullptr;
825+
auto internalMoveScope = SetForScope { m_internalMovesType, RenderObject::IsInternalMove::Yes };
825826
for (auto* current = blockParent.firstChild(); current; current = next) {
826827
next = current->nextSibling();
827828
if (current->isAnonymousBlock())

0 commit comments

Comments
 (0)