Chromium Code Reviews| Index: Source/core/layout/FloatingObjects.cpp |
| diff --git a/Source/core/layout/FloatingObjects.cpp b/Source/core/layout/FloatingObjects.cpp |
| index 1a8166162bb0215deae347c793fb8bed01627001..61d34a6d410c1ed14b83f8de41e79ed6d7b75189 100644 |
| --- a/Source/core/layout/FloatingObjects.cpp |
| +++ b/Source/core/layout/FloatingObjects.cpp |
| @@ -212,9 +212,9 @@ LayoutUnit FloatingObjects::lowestFloatLogicalBottom(FloatingObject::Type floatT |
| LayoutUnit lowestFloatBottomLeft = 0; |
| LayoutUnit lowestFloatBottomRight = 0; |
| for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { |
| - FloatingObject* floatingObject = it->get(); |
| - if (floatingObject->isPlaced()) { |
| - FloatingObject::Type curType = floatingObject->type(); |
| + FloatingObject& floatingObject = it->getReference(); |
| + if (floatingObject.isPlaced()) { |
| + FloatingObject::Type curType = floatingObject.type(); |
| LayoutUnit curFloatLogicalBottom = m_renderer->logicalBottomForFloat(floatingObject); |
| if (curType & FloatingObject::FloatLeft) |
| lowestFloatBottomLeft = std::max(lowestFloatBottomLeft, curFloatLogicalBottom); |
| @@ -227,8 +227,8 @@ LayoutUnit FloatingObjects::lowestFloatLogicalBottom(FloatingObject::Type floatT |
| setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, FloatingObject::FloatRight, lowestFloatBottomRight); |
| } else { |
| for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { |
| - FloatingObject* floatingObject = it->get(); |
| - if (floatingObject->isPlaced() && floatingObject->type() == floatType) |
| + FloatingObject& floatingObject = it->getReference(); |
| + if (floatingObject.isPlaced() && floatingObject.type() == floatType) |
| lowestFloatBottom = std::max(lowestFloatBottom, m_renderer->logicalBottomForFloat(floatingObject)); |
| } |
| setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, floatType, lowestFloatBottom); |
| @@ -438,7 +438,7 @@ inline static bool rangesIntersect(int floatTop, int floatBottom, int objectTop, |
| template<> |
| inline bool ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded(const FloatingObject& floatingObject) |
| { |
| - LayoutUnit logicalRight = m_renderer->logicalRightForFloat(&floatingObject); |
| + LayoutUnit logicalRight = m_renderer->logicalRightForFloat(floatingObject); |
| if (logicalRight > m_offset) { |
| m_offset = logicalRight; |
| return true; |
| @@ -449,7 +449,7 @@ inline bool ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>:: |
| template<> |
| inline bool ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded(const FloatingObject& floatingObject) |
| { |
| - LayoutUnit logicalLeft = m_renderer->logicalLeftForFloat(&floatingObject); |
| + LayoutUnit logicalLeft = m_renderer->logicalLeftForFloat(floatingObject); |
| if (logicalLeft < m_offset) { |
| m_offset = logicalLeft; |
| return true; |
| @@ -460,7 +460,7 @@ inline bool ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>: |
| template <FloatingObject::Type FloatTypeValue> |
| LayoutUnit ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining() const |
| { |
| - return this->m_outermostFloat ? this->m_renderer->logicalBottomForFloat(this->m_outermostFloat) - this->m_lineTop : LayoutUnit(1); |
| + return this->m_outermostFloat ? this->m_renderer->logicalBottomForFloat(*(this->m_outermostFloat)) - this->m_lineTop : LayoutUnit(1); |
| } |
| template <FloatingObject::Type FloatTypeValue> |
| @@ -472,8 +472,8 @@ inline void ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded(const Int |
| // Make sure the float hasn't changed since it was added to the placed floats tree. |
| ASSERT(floatingObject->isPlaced()); |
| - ASSERT(interval.low() == m_renderer->pixelSnappedLogicalTopForFloat(floatingObject)); |
| - ASSERT(interval.high() == m_renderer->pixelSnappedLogicalBottomForFloat(floatingObject)); |
| + ASSERT(interval.low() == m_renderer->pixelSnappedLogicalTopForFloat(*floatingObject)); |
|
Julien - ping for review
2015/03/16 15:27:54
It seems like |floatingObject| should be a referen
Sunil Ratnu
2015/03/17 11:31:19
Done.
|
| + ASSERT(interval.high() == m_renderer->pixelSnappedLogicalBottomForFloat(*floatingObject)); |
| bool floatIsNewExtreme = updateOffsetIfNeeded(*floatingObject); |
| if (floatIsNewExtreme) |
| @@ -483,7 +483,7 @@ inline void ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded(const Int |
| template<> |
| inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded(const FloatingObject& floatingObject) |
| { |
| - LayoutUnit logicalRight = m_renderer->logicalRightForFloat(&floatingObject); |
| + LayoutUnit logicalRight = m_renderer->logicalRightForFloat(floatingObject); |
| if (ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOutsideInfo()) { |
| ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainingBlockLine(*m_renderer, floatingObject, m_lineTop, m_lineBottom - m_lineTop); |
| if (!shapeDeltas.lineOverlapsShape()) |
| @@ -502,7 +502,7 @@ inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::u |
| template<> |
| inline bool ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded(const FloatingObject& floatingObject) |
| { |
| - LayoutUnit logicalLeft = m_renderer->logicalLeftForFloat(&floatingObject); |
| + LayoutUnit logicalLeft = m_renderer->logicalLeftForFloat(floatingObject); |
| if (ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOutsideInfo()) { |
| ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainingBlockLine(*m_renderer, floatingObject, m_lineTop, m_lineBottom - m_lineTop); |
| if (!shapeDeltas.lineOverlapsShape()) |