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

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

Issue 763173003: Convert RenderBlockFlow code to use FloatingObject references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
Index: Source/core/rendering/FloatingObjects.cpp
diff --git a/Source/core/rendering/FloatingObjects.cpp b/Source/core/rendering/FloatingObjects.cpp
index f2e4989cd5904c397b0ccd85bbec43d4e06c0698..f5a01024f8cade3b567cbe988b9fcb553004e755 100644
--- a/Source/core/rendering/FloatingObjects.cpp
+++ b/Source/core/rendering/FloatingObjects.cpp
@@ -215,7 +215,7 @@ LayoutUnit FloatingObjects::lowestFloatLogicalBottom(FloatingObject::Type floatT
FloatingObject* floatingObject = it->get();
Julien - ping for review 2014/12/01 16:12:47 We should use a reference here. The best way is to
Sunil Ratnu 2015/03/16 08:06:30 Done. I've added a new method getReference() in Ow
if (floatingObject->isPlaced()) {
FloatingObject::Type curType = floatingObject->type();
- LayoutUnit curFloatLogicalBottom = m_renderer->logicalBottomForFloat(floatingObject);
+ LayoutUnit curFloatLogicalBottom = m_renderer->logicalBottomForFloat(*floatingObject);
if (curType & FloatingObject::FloatLeft)
lowestFloatBottomLeft = std::max(lowestFloatBottomLeft, curFloatLogicalBottom);
if (curType & FloatingObject::FloatRight)
@@ -229,7 +229,7 @@ LayoutUnit FloatingObjects::lowestFloatLogicalBottom(FloatingObject::Type floatT
for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
FloatingObject* floatingObject = it->get();
Julien - ping for review 2014/12/01 16:12:47 Ditto.
Sunil Ratnu 2015/03/16 08:06:30 Done.
if (floatingObject->isPlaced() && floatingObject->type() == floatType)
- lowestFloatBottom = std::max(lowestFloatBottom, m_renderer->logicalBottomForFloat(floatingObject));
+ 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));
+ 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.renderer()->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.renderer()->shapeOutsideInfo()) {
ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainingBlockLine(*m_renderer, floatingObject, m_lineTop, m_lineBottom - m_lineTop);
if (!shapeDeltas.lineOverlapsShape())

Powered by Google App Engine
This is Rietveld 408576698