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

Unified Diff: Source/core/rendering/FloatingObjects.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.h ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/FloatingObjects.cpp
diff --git a/Source/core/rendering/FloatingObjects.cpp b/Source/core/rendering/FloatingObjects.cpp
index 152a3a329c6aa7429fd7bfb15c84b2729c7a6759..b8fa4dd055bb5060e54e7f4ddccfb843167ff6e2 100644
--- a/Source/core/rendering/FloatingObjects.cpp
+++ b/Source/core/rendering/FloatingObjects.cpp
@@ -52,6 +52,7 @@ FloatingObject::FloatingObject(RenderBox* renderer)
#ifndef NDEBUG
, m_isInPlacedTree(false)
#endif
+ , m_isOverhangingOrIntruding(false)
{
EFloat type = renderer->style()->floating();
ASSERT(type != NoFloat);
@@ -73,6 +74,7 @@ FloatingObject::FloatingObject(RenderBox* renderer, Type type, const LayoutRect&
#ifndef NDEBUG
, m_isInPlacedTree(false)
#endif
+ , m_isOverhangingOrIntruding(false)
{
}
@@ -93,7 +95,6 @@ PassOwnPtr<FloatingObject> FloatingObject::copyToNewContainer(LayoutSize offset,
PassOwnPtr<FloatingObject> FloatingObject::unsafeClone() const
{
OwnPtr<FloatingObject> cloneObject = adoptPtr(new FloatingObject(renderer(), type(), m_frameRect, m_shouldPaint, m_isDescendant));
- cloneObject->m_originatingLine = m_originatingLine;
cloneObject->m_paginationStrut = m_paginationStrut;
cloneObject->m_isPlaced = m_isPlaced;
return cloneObject.release();
@@ -172,12 +173,28 @@ void FloatingObjects::clear()
{
deleteAllValues(m_set);
m_set.clear();
+ m_overhangingOrIntrudingSet.clear();
m_placedFloatsTree.clear();
m_leftObjectsCount = 0;
m_rightObjectsCount = 0;
markLowestFloatLogicalBottomCacheAsDirty();
}
+void FloatingObjects::clearOverhangingAndIntrudingFloats()
+{
+ FloatingObjectSetIterator end = m_overhangingOrIntrudingSet.end();
+ for (FloatingObjectSetIterator it = m_overhangingOrIntrudingSet.begin(); it != end; ++it) {
+ FloatingObject* floatingObject = *it;
+ decreaseObjectsCount(floatingObject->type());
+ m_set.remove(floatingObject);
+ removePlacedObject(floatingObject);
+ ASSERT(!floatingObject->originatingLine());
+ delete floatingObject;
+ }
+ m_overhangingOrIntrudingSet.clear();
+ markLowestFloatLogicalBottomCacheAsDirty();
+}
+
LayoutUnit FloatingObjects::lowestFloatLogicalBottom(FloatingObject::Type floatType)
{
bool isInHorizontalWritingMode = m_horizontalWritingMode;
@@ -331,10 +348,21 @@ FloatingObject* FloatingObjects::add(PassOwnPtr<FloatingObject> floatingObject)
return newObject;
}
+FloatingObject* FloatingObjects::addOverhangingOrIntrudingFloat(PassOwnPtr<FloatingObject> floatingObject)
+{
+ ASSERT(floatingObject->isPlaced());
+
+ floatingObject->setIsOverhangingOrIntruding(true);
+
+ m_overhangingOrIntrudingSet.add(floatingObject.get());
+ return add(floatingObject);
+}
+
void FloatingObjects::remove(FloatingObject* floatingObject)
{
decreaseObjectsCount(floatingObject->type());
m_set.remove(floatingObject);
+ m_overhangingOrIntrudingSet.remove(floatingObject);
ASSERT(floatingObject->isPlaced() || !floatingObject->isInPlacedTree());
if (floatingObject->isPlaced())
removePlacedObject(floatingObject);
« no previous file with comments | « Source/core/rendering/FloatingObjects.h ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698