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

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

Issue 23084002: Use the outermost float for shape-outside (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 4 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/rendering/RenderBlock.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 8b1cc6f4e490cae60adee1074f1ed91ae28f0ee8..ccb60e115503a5f12e6d03bbcc53db689c2d5068 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -4288,15 +4288,13 @@ inline void RenderBlock::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNee
bool floatIsNewExtreme = updateOffsetIfNeeded(floatingObject);
if (floatIsNewExtreme)
- m_floatForHeight = floatingObject;
-
- m_last = floatingObject;
+ m_outermostFloat = floatingObject;
}
template <RenderBlock::FloatingObject::Type FloatTypeValue>
LayoutUnit RenderBlock::ComputeFloatOffsetAdapter<FloatTypeValue>::getHeightRemaining() const
{
- return m_floatForHeight ? m_renderer->logicalBottomForFloat(m_floatForHeight) - m_lineTop : LayoutUnit(1);
+ return m_outermostFloat ? m_renderer->logicalBottomForFloat(m_outermostFloat) - m_lineTop : LayoutUnit(1);
}
LayoutUnit RenderBlock::textIndentOffset() const
@@ -4339,10 +4337,10 @@ LayoutUnit RenderBlock::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, Lay
if (heightRemaining)
*heightRemaining = adapter.getHeightRemaining();
- const FloatingObject* lastFloat = adapter.lastFloat();
- if (offsetMode == ShapeOutsideFloatShapeOffset && lastFloat) {
- if (ShapeOutsideInfo* shapeOutside = lastFloat->renderer()->shapeOutsideInfo()) {
- shapeOutside->computeSegmentsForContainingBlockLine(logicalTop, logicalTopForFloat(lastFloat), logicalHeight);
+ const FloatingObject* outermostFloat = adapter.outermostFloat();
+ if (offsetMode == ShapeOutsideFloatShapeOffset && outermostFloat) {
+ if (ShapeOutsideInfo* shapeOutside = outermostFloat->renderer()->shapeOutsideInfo()) {
+ shapeOutside->computeSegmentsForContainingBlockLine(logicalTop, logicalTopForFloat(outermostFloat), logicalHeight);
left += shapeOutside->rightSegmentMarginBoxDelta();
}
}
@@ -4400,10 +4398,10 @@ LayoutUnit RenderBlock::logicalRightFloatOffsetForLine(LayoutUnit logicalTop, La
if (heightRemaining)
*heightRemaining = adapter.getHeightRemaining();
- const FloatingObject* lastFloat = adapter.lastFloat();
- if (offsetMode == ShapeOutsideFloatShapeOffset && lastFloat) {
- if (ShapeOutsideInfo* shapeOutside = lastFloat->renderer()->shapeOutsideInfo()) {
- shapeOutside->computeSegmentsForContainingBlockLine(logicalTop, logicalTopForFloat(lastFloat), logicalHeight);
+ const FloatingObject* outermostFloat = adapter.outermostFloat();
+ if (offsetMode == ShapeOutsideFloatShapeOffset && outermostFloat) {
+ if (ShapeOutsideInfo* shapeOutside = outermostFloat->renderer()->shapeOutsideInfo()) {
+ shapeOutside->computeSegmentsForContainingBlockLine(logicalTop, logicalTopForFloat(outermostFloat), logicalHeight);
rightFloatOffset += shapeOutside->leftSegmentMarginBoxDelta();
}
}
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698