Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
index 8e907b7b6e0e01bdf42e667f94ce7161892d94fd..0bdca61413ba71c56f2fbc0f919cd968bc88d289 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
@@ -655,6 +655,11 @@ void LayoutBlock::collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* |
// destroyed. See crbug.com/282088 |
if (child->beingDestroyed()) |
return; |
+ if (child->continuation()) |
+ return; |
+ // Ruby elements use anonymous wrappers for ruby runs and ruby bases by design, so we don't remove them. |
+ if (child->isRubyRun() || child->isRubyBase()) |
+ return; |
parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::ChildAnonymousBlockChanged); |
child->moveAllChildrenTo(parent, child->nextSibling(), child->hasLayer()); |