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

Unified Diff: Source/WebCore/rendering/RenderRubyBase.cpp

Issue 7941019: Merge 95462 - Source/WebCore: Issues with merging ruby bases. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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/WebCore/rendering/RenderRubyBase.h ('k') | Source/WebCore/rendering/RenderRubyRun.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderRubyBase.cpp
===================================================================
--- Source/WebCore/rendering/RenderRubyBase.cpp (revision 95467)
+++ Source/WebCore/rendering/RenderRubyBase.cpp (working copy)
@@ -65,7 +65,7 @@
return true;
}
-void RenderRubyBase::moveChildren(RenderRubyBase* toBase, RenderObject* fromBeforeChild)
+void RenderRubyBase::moveChildren(RenderRubyBase* toBase, RenderObject* beforeChild)
{
// This function removes all children that are before (!) beforeChild
// and appends them to toBase.
@@ -75,19 +75,19 @@
// Inline children might be wrapped in an anonymous block if there's a continuation.
// Theoretically, in ruby bases, this can happen with only the first such a child,
// so it should be OK to just climb the tree.
- while (fromBeforeChild && fromBeforeChild->parent() != this)
- fromBeforeChild = fromBeforeChild->parent();
+ while (beforeChild && beforeChild->parent() != this)
+ beforeChild = beforeChild->parent();
if (childrenInline())
- moveInlineChildren(toBase, fromBeforeChild);
+ moveInlineChildren(toBase, beforeChild);
else
- moveBlockChildren(toBase, fromBeforeChild);
+ moveBlockChildren(toBase, beforeChild);
setNeedsLayoutAndPrefWidthsRecalc();
toBase->setNeedsLayoutAndPrefWidthsRecalc();
}
-void RenderRubyBase::moveInlineChildren(RenderRubyBase* toBase, RenderObject* fromBeforeChild)
+void RenderRubyBase::moveInlineChildren(RenderRubyBase* toBase, RenderObject* beforeChild)
{
RenderBlock* toBlock;
@@ -106,17 +106,17 @@
}
}
// Move our inline children into the target block we determined above.
- moveChildrenTo(toBlock, firstChild(), fromBeforeChild);
+ moveChildrenTo(toBlock, firstChild(), beforeChild);
}
-void RenderRubyBase::moveBlockChildren(RenderRubyBase* toBase, RenderObject* fromBeforeChild)
+void RenderRubyBase::moveBlockChildren(RenderRubyBase* toBase, RenderObject* beforeChild)
{
if (toBase->childrenInline()) {
// First check whether we move only wrapped inline objects.
- if (hasOnlyWrappedInlineChildren(fromBeforeChild)) {
+ if (hasOnlyWrappedInlineChildren(beforeChild)) {
// The reason why the base is in block flow must be after beforeChild.
// We therefore can extract the inline objects and move them to toBase.
- for (RenderObject* child = firstChild(); child != fromBeforeChild; child = firstChild()) {
+ for (RenderObject* child = firstChild(); child != beforeChild; child = firstChild()) {
if (child->isAnonymousBlock()) {
RenderBlock* anonBlock = toRenderBlock(child);
ASSERT(anonBlock->childrenInline());
@@ -133,7 +133,7 @@
// Moving block children -> have to set toBase as block flow
toBase->makeChildrenNonInline();
// Move children, potentially collapsing anonymous block wrappers.
- mergeBlockChildren(toBase, fromBeforeChild);
+ mergeBlockChildren(toBase, beforeChild);
// Now we need to check if the leftover children are all inline.
// If so, make this base inline again.
@@ -157,24 +157,24 @@
}
}
} else
- mergeBlockChildren(toBase, fromBeforeChild);
+ mergeBlockChildren(toBase, beforeChild);
}
-void RenderRubyBase::mergeBlockChildren(RenderRubyBase* toBase, RenderObject* fromBeforeChild)
+void RenderRubyBase::mergeBlockChildren(RenderRubyBase* toBase, RenderObject* beforeChild)
{
- // This function removes all children that are before fromBeforeChild and appends them to toBase.
+ // This function removes all children that are before beforeChild and appends them to toBase.
ASSERT(!childrenInline());
ASSERT(toBase);
ASSERT(!toBase->childrenInline());
// Quick check whether we have anything to do, to simplify the following code.
- if (fromBeforeChild != firstChild())
+ if (!firstChild())
return;
// If an anonymous block would be put next to another such block, then merge those.
RenderObject* firstChildHere = firstChild();
RenderObject* lastChildThere = toBase->lastChild();
- if (firstChildHere && firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline()
+ if (firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline()
&& lastChildThere && lastChildThere->isAnonymousBlock() && lastChildThere->childrenInline()) {
RenderBlock* anonBlockHere = toRenderBlock(firstChildHere);
RenderBlock* anonBlockThere = toRenderBlock(lastChildThere);
@@ -183,7 +183,7 @@
anonBlockHere->destroy();
}
// Move all remaining children normally.
- moveChildrenTo(toBase, firstChild(), fromBeforeChild);
+ moveChildrenTo(toBase, firstChild(), beforeChild);
}
RenderRubyRun* RenderRubyBase::rubyRun() const
« no previous file with comments | « Source/WebCore/rendering/RenderRubyBase.h ('k') | Source/WebCore/rendering/RenderRubyRun.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698