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); |