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

Unified Diff: Source/core/layout/LayoutBlockFlow.cpp

Issue 1263923002: Revert of Refactor the treatment of shape-outside objects in float overlapping checks (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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/layout/LayoutBlockFlow.h ('k') | Source/core/layout/api/LineLayoutBlockFlow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlow.cpp
diff --git a/Source/core/layout/LayoutBlockFlow.cpp b/Source/core/layout/LayoutBlockFlow.cpp
index a834704f4aab72257e8a659a615eb575972ba931..8dd973bf8d1c41917ee1f604a178d51012ac365d 100644
--- a/Source/core/layout/LayoutBlockFlow.cpp
+++ b/Source/core/layout/LayoutBlockFlow.cpp
@@ -1824,7 +1824,7 @@
return newLogicalTop - logicalTop;
}
- newLogicalTop = nextFloatLogicalBottomBelowForBlock(newLogicalTop);
+ newLogicalTop = nextFloatLogicalBottomBelow(newLogicalTop);
ASSERT(newLogicalTop >= logicalTop);
if (newLogicalTop < logicalTop)
break;
@@ -2522,19 +2522,29 @@
return m_floatingObjects->lowestFloatLogicalBottom(floatType);
}
-LayoutUnit LayoutBlockFlow::nextFloatLogicalBottomBelow(LayoutUnit logicalHeight) const
+LayoutUnit LayoutBlockFlow::nextFloatLogicalBottomBelow(LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode offsetMode) const
{
if (!m_floatingObjects)
return logicalHeight;
- return m_floatingObjects->findNextFloatLogicalBottomBelow(logicalHeight);
-}
-
-LayoutUnit LayoutBlockFlow::nextFloatLogicalBottomBelowForBlock(LayoutUnit logicalHeight) const
-{
- if (!m_floatingObjects)
- return logicalHeight;
-
- return m_floatingObjects->findNextFloatLogicalBottomBelowForBlock(logicalHeight);
+
+ LayoutUnit logicalBottom;
+ const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+ FloatingObjectSetIterator end = floatingObjectSet.end();
+ for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
+ const FloatingObject& floatingObject = *it->get();
+ LayoutUnit floatLogicalBottom = logicalBottomForFloat(floatingObject);
+ ShapeOutsideInfo* shapeOutside = floatingObject.layoutObject()->shapeOutsideInfo();
+ if (shapeOutside && (offsetMode == ShapeOutsideFloatShapeOffset)) {
+ LayoutUnit shapeLogicalBottom = logicalTopForFloat(floatingObject) + marginBeforeForChild(*floatingObject.layoutObject()) + shapeOutside->shapeLogicalBottom();
+ // Use the shapeLogicalBottom unless it extends outside of the margin box, in which case it is clipped.
+ if (shapeLogicalBottom < floatLogicalBottom)
+ floatLogicalBottom = shapeLogicalBottom;
+ }
+ if (floatLogicalBottom > logicalHeight)
+ logicalBottom = logicalBottom ? std::min(floatLogicalBottom, logicalBottom) : floatLogicalBottom;
+ }
+
+ return logicalBottom;
}
bool LayoutBlockFlow::hitTestFloats(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset)
« no previous file with comments | « Source/core/layout/LayoutBlockFlow.h ('k') | Source/core/layout/api/LineLayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698