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

Unified Diff: sky/engine/core/rendering/line/LineWidth.cpp

Issue 689733003: Remove most of FloatingObject. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « sky/engine/core/rendering/line/LineWidth.h ('k') | sky/engine/core/rendering/shapes/ShapeOutsideInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/line/LineWidth.cpp
diff --git a/sky/engine/core/rendering/line/LineWidth.cpp b/sky/engine/core/rendering/line/LineWidth.cpp
index 69cbd12dd5b0f94842b9ff778074d02838e3e482..93dc921d9dd2ce71493f54415bffa23214859673 100644
--- a/sky/engine/core/rendering/line/LineWidth.cpp
+++ b/sky/engine/core/rendering/line/LineWidth.cpp
@@ -59,45 +59,6 @@ void LineWidth::updateAvailableWidth(LayoutUnit replacedHeight)
computeAvailableWidthFromLeftAndRight();
}
-void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject* newFloat)
-{
- LayoutUnit height = m_block.logicalHeight();
- if (height < m_block.logicalTopForFloat(newFloat) || height >= m_block.logicalBottomForFloat(newFloat))
- return;
-
- ShapeOutsideDeltas shapeDeltas;
- if (ShapeOutsideInfo* shapeOutsideInfo = newFloat->renderer()->shapeOutsideInfo()) {
- LayoutUnit lineHeight = m_block.lineHeight(m_isFirstLine, m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
- shapeDeltas = shapeOutsideInfo->computeDeltasForContainingBlockLine(m_block, *newFloat, m_block.logicalHeight(), lineHeight);
- }
-
- if (newFloat->type() == FloatingObject::FloatLeft) {
- float newLeft = m_block.logicalRightForFloat(newFloat).toFloat();
- if (shapeDeltas.isValid()) {
- if (shapeDeltas.lineOverlapsShape())
- newLeft += shapeDeltas.rightMarginBoxDelta();
- else // Per the CSS Shapes spec, If the line doesn't overlap the shape, then ignore this shape for this line.
- newLeft = m_left;
- }
- if (shouldIndentText() && m_block.style()->isLeftToRightDirection())
- newLeft += floorToInt(m_block.textIndentOffset());
- m_left = std::max<float>(m_left, newLeft);
- } else {
- float newRight = m_block.logicalLeftForFloat(newFloat).toFloat();
- if (shapeDeltas.isValid()) {
- if (shapeDeltas.lineOverlapsShape())
- newRight += shapeDeltas.leftMarginBoxDelta();
- else // Per the CSS Shapes spec, If the line doesn't overlap the shape, then ignore this shape for this line.
- newRight = m_right;
- }
- if (shouldIndentText() && !m_block.style()->isLeftToRightDirection())
- newRight -= floorToInt(m_block.textIndentOffset());
- m_right = std::min<float>(m_right, newRight);
- }
-
- computeAvailableWidthFromLeftAndRight();
-}
-
void LineWidth::commit()
{
m_committedWidth += m_uncommittedWidth;
@@ -144,7 +105,7 @@ void LineWidth::wrapNextToShapeOutside(bool isFirstLine)
LayoutUnit lineHeight = m_block.lineHeight(isFirstLine, m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
LayoutUnit lineLogicalTop = m_block.logicalHeight();
LayoutUnit newLineTop = lineLogicalTop;
- LayoutUnit floatLogicalBottom = m_block.nextFloatLogicalBottomBelow(lineLogicalTop);
+ LayoutUnit floatLogicalBottom = lineLogicalTop;
float newLineWidth;
float newLineLeft = m_left;
@@ -173,12 +134,8 @@ void LineWidth::fitBelowFloats(bool isFirstLine)
float newLineLeft = m_left;
float newLineRight = m_right;
- FloatingObject* lastFloatFromPreviousLine = (m_block.containsFloats() ? m_block.m_floatingObjects->set().last().get() : 0);
- if (lastFloatFromPreviousLine && lastFloatFromPreviousLine->renderer()->shapeOutsideInfo())
- return wrapNextToShapeOutside(isFirstLine);
-
while (true) {
- floatLogicalBottom = m_block.nextFloatLogicalBottomBelow(lastFloatLogicalBottom, ShapeOutsideFloatShapeOffset);
+ floatLogicalBottom = lastFloatLogicalBottom;
if (floatLogicalBottom <= lastFloatLogicalBottom)
break;
« no previous file with comments | « sky/engine/core/rendering/line/LineWidth.h ('k') | sky/engine/core/rendering/shapes/ShapeOutsideInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698