Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: Source/core/rendering/RenderRubyRun.cpp

Issue 563763002: Ruby: Update beforeChild when redirecting renderer insertion to a child. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: code review Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderRuby.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « Source/core/rendering/RenderRuby.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698