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

Unified Diff: WebCore/rendering/RenderRubyRun.cpp

Issue 3179009: Merge 65090 - 2010-08-10 Abhishek Arya <inferno@chromium.org>... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/375/
Patch Set: Created 10 years, 4 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 | « LayoutTests/fast/ruby/ruby-remove-no-base-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/rendering/RenderRubyRun.cpp
===================================================================
--- WebCore/rendering/RenderRubyRun.cpp (revision 55883)
+++ WebCore/rendering/RenderRubyRun.cpp (working copy)
@@ -143,14 +143,15 @@
RenderBlock::removeChild(beforeChild);
newRun->addChild(beforeChild);
} else {
- ASSERT(hasRubyBase()); // Otherwise beforeChild would be borked.
- // Insertion before a ruby base object.
- // In this case we need insert a new run before the current one and split the base.
- RenderObject* ruby = parent();
- RenderRubyRun* newRun = staticCreateRubyRun(ruby);
- ruby->addChild(newRun, this);
- newRun->addChild(child);
- rubyBaseSafe()->moveChildren(newRun->rubyBaseSafe(), beforeChild);
+ if (hasRubyBase()) {
+ // Insertion before a ruby base object.
+ // In this case we need insert a new run before the current one and split the base.
+ RenderObject* ruby = parent();
+ RenderRubyRun* newRun = staticCreateRubyRun(ruby);
+ ruby->addChild(newRun, this);
+ newRun->addChild(child);
+ rubyBaseSafe()->moveChildren(newRun->rubyBaseSafe(), beforeChild);
+ }
}
} else {
// child is not a text -> insert it into the base
@@ -171,13 +172,14 @@
if (base && rightNeighbour && rightNeighbour->isRubyRun()) {
// Ruby run without a base can happen only at the first run.
RenderRubyRun* rightRun = static_cast<RenderRubyRun*>(rightNeighbour);
- ASSERT(rightRun->hasRubyBase());
- RenderRubyBase* rightBase = rightRun->rubyBaseSafe();
- // Collect all children in a single base, then swap the bases.
- rightBase->moveChildren(base);
- moveChildTo(rightRun, rightRun->children(), base);
- rightRun->moveChildTo(this, children(), rightBase);
- // The now empty ruby base will be removed below.
+ if (rightRun->hasRubyBase()) {
+ RenderRubyBase* rightBase = rightRun->rubyBaseSafe();
+ // Collect all children in a single base, then swap the bases.
+ rightBase->moveChildren(base);
+ moveChildTo(rightRun, rightRun->children(), base);
+ rightRun->moveChildTo(this, children(), rightBase);
+ // The now empty ruby base will be removed below.
+ }
}
}
« no previous file with comments | « LayoutTests/fast/ruby/ruby-remove-no-base-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698