Index: Source/core/rendering/RenderRubyRun.cpp |
diff --git a/Source/core/rendering/RenderRubyRun.cpp b/Source/core/rendering/RenderRubyRun.cpp |
index 493fb0b6a1a8cf0ce856acb73748af53e035048b..d74e76ab9a1fa282641dd2f281f1f4cf5683409a 100644 |
--- a/Source/core/rendering/RenderRubyRun.cpp |
+++ b/Source/core/rendering/RenderRubyRun.cpp |
@@ -131,9 +131,13 @@ void RenderRubyRun::addChild(RenderObject* child, RenderObject* beforeChild) |
} else { |
// child is not a text -> insert it into the base |
// (append it instead if beforeChild is the ruby text) |
+ RenderRubyBase* base = rubyBaseSafe(); |
+ if (beforeChild == base) |
+ beforeChild = base->firstChild(); |
if (beforeChild && beforeChild->isRubyText()) |
beforeChild = 0; |
- rubyBaseSafe()->addChild(child, beforeChild); |
+ ASSERT(!beforeChild || beforeChild->isDescendantOf(base)); |
+ base->addChild(child, beforeChild); |
} |
} |