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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 1969203003: Move makeChildrenInlineIfPossible to LayoutBlockFlow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 6be6b75b76089c6e3307c7076cabaf140f266678..9245ae6329a98073e1b6a28b078c2a7ed2bd2c7f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -490,50 +490,6 @@ void LayoutBlock::removeLeftoverAnonymousBlock(LayoutBlock* child)
child->destroy();
}
-void LayoutBlock::makeChildrenInlineIfPossible()
-{
- ASSERT(isLayoutBlockFlow());
- // Collapsing away anonymous wrappers isn't relevant for the children of anonymous blocks, unless they are ruby bases.
- if (isAnonymousBlock() && !isRubyBase())
- return;
-
- Vector<LayoutBlock*, 3> blocksToRemove;
- for (LayoutObject* child = firstChild(); child; child = child->nextSibling()) {
- if (child->isFloating())
- continue;
- if (child->isOutOfFlowPositioned())
- continue;
-
- // There are still block children in the container, so any anonymous wrappers are still needed.
- if (!child->isAnonymousBlock())
- return;
- // If one of the children is being destroyed then it is unsafe to clean up anonymous wrappers as the
- // entire branch may be being destroyed.
- if (toLayoutBlock(child)->beingDestroyed())
- return;
- // We can't remove anonymous wrappers if they contain continuations as this means there are block children present.
- if (toLayoutBlock(child)->continuation())
- return;
- // We are only interested in removing anonymous wrappers if there are inline siblings underneath them.
- if (!child->childrenInline())
- 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;
-
- blocksToRemove.append(toLayoutBlock(child));
- }
-
- // If we make an object's children inline we are going to frustrate any future attempts to remove
- // floats from its children's float-lists before the next layout happens so clear down all the floatlists
- // now - they will be rebuilt at layout.
- toLayoutBlockFlow(this)->removeFloatingObjectsFromDescendants();
-
- for (size_t i = 0; i < blocksToRemove.size(); i++)
- collapseAnonymousBlockChild(this, blocksToRemove[i]);
- setChildrenInline(true);
-}
-
void LayoutBlock::collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* child)
{
if (!parent->canCollapseAnonymousBlockChild())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698