void FloatingObjects::clear() { m_set.clear(); m_placedFloatsTree.clear(); m_leftObjectsCount = 0; m_rightObjectsCount = 0; markLowestFloatLogicalBottomCacheAsDirty(); }
void FloatingObjects::remove(FloatingObject* toBeRemoved) { decreaseObjectsCount(toBeRemoved->getType()); std::unique_ptr<FloatingObject> floatingObject = m_set.take(toBeRemoved); ASSERT(floatingObject->isPlaced() || !floatingObject->isInPlacedTree()); if (floatingObject->isPlaced()) removePlacedObject(*floatingObject); markLowestFloatLogicalBottomCacheAsDirty(); ASSERT(!floatingObject->originatingLine()); }
FloatingObject* FloatingObjects::add(PassOwnPtr<FloatingObject> floatingObject) { FloatingObject* newObject = floatingObject.leakPtr(); increaseObjectsCount(newObject->type()); m_set.add(adoptPtr(newObject)); if (newObject->isPlaced()) addPlacedObject(*newObject); markLowestFloatLogicalBottomCacheAsDirty(); return newObject; }
FloatingObject* FloatingObjects::add( std::unique_ptr<FloatingObject> floatingObject) { FloatingObject* newObject = floatingObject.release(); increaseObjectsCount(newObject->getType()); m_set.add(WTF::wrapUnique(newObject)); if (newObject->isPlaced()) addPlacedObject(*newObject); markLowestFloatLogicalBottomCacheAsDirty(); return newObject; }
void FloatingObjects::addPlacedObject(FloatingObject& floatingObject) { ASSERT(!floatingObject.isInPlacedTree()); floatingObject.setIsPlaced(true); if (m_placedFloatsTree.isInitialized()) m_placedFloatsTree.add(intervalForFloatingObject(floatingObject)); #if ENABLE(ASSERT) floatingObject.setIsInPlacedTree(true); #endif markLowestFloatLogicalBottomCacheAsDirty(); }
void FloatingObjects::removePlacedObject(FloatingObject& floatingObject) { ASSERT(floatingObject.isPlaced() && floatingObject.isInPlacedTree()); if (m_placedFloatsTree.isInitialized()) { bool removed = m_placedFloatsTree.remove(intervalForFloatingObject(floatingObject)); ASSERT_UNUSED(removed, removed); } floatingObject.setIsPlaced(false); #if ENABLE(ASSERT) floatingObject.setIsInPlacedTree(false); #endif markLowestFloatLogicalBottomCacheAsDirty(); }