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

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

Issue 131223003: Track intruding and overhanging floats (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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/FloatingObjects.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/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 8a4f224b3df5663e1a5a323024160c2b4bd0edd9..cef0791261d9a244c28626751d91b4103ca6512c 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -177,6 +177,9 @@ RenderBlockFlow* RenderBlockFlow::createAnonymousBlockFlow() const
void RenderBlockFlow::willBeDestroyed()
{
+ if (containsFloats())
+ m_floatingObjects->clearOverhangingAndIntrudingFloats();
+
if (lineGridBox())
lineGridBox()->destroy();
@@ -1832,8 +1835,7 @@ void RenderBlockFlow::moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, boo
for (FloatingObjectSetIterator it = fromFloatingObjectSet.begin(); it != end; ++it) {
FloatingObject* floatingObject = *it;
- // Don't insert the object again if it's already in the list
- if (toBlockFlow->containsFloat(floatingObject->renderer()))
+ if (floatingObject->isOverhangingOrIntruding() || toBlockFlow->containsFloat(floatingObject->renderer()))
continue;
toBlockFlow->m_floatingObjects->add(floatingObject->unsafeClone());
@@ -2425,7 +2427,7 @@ void RenderBlockFlow::addIntrudingFloats(RenderBlockFlow* prev, LayoutUnit logic
? LayoutSize(logicalLeftOffset - (prev != parent() ? prev->marginLeft() : LayoutUnit()), logicalTopOffset)
: LayoutSize(logicalTopOffset, logicalLeftOffset - (prev != parent() ? prev->marginTop() : LayoutUnit()));
- m_floatingObjects->add(floatingObject->copyToNewContainer(offset));
+ m_floatingObjects->addOverhangingOrIntrudingFloat(floatingObject->copyToNewContainer(offset));
}
}
}
@@ -2468,7 +2470,7 @@ LayoutUnit RenderBlockFlow::addOverhangingFloats(RenderBlockFlow* child, bool ma
if (!m_floatingObjects)
createFloatingObjects();
- m_floatingObjects->add(floatingObject->copyToNewContainer(offset, shouldPaint, true));
+ m_floatingObjects->addOverhangingOrIntrudingFloat(floatingObject->copyToNewContainer(offset, shouldPaint, true));
}
} else {
if (makeChildPaintOtherFloats && !floatingObject->shouldPaint() && !floatingObject->renderer()->hasSelfPaintingLayer()
« no previous file with comments | « Source/core/rendering/FloatingObjects.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698