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

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

Issue 703563002: Remove shape-outside. (Closed) Base URL: git@github.com:domokit/mojo.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
« no previous file with comments | « sky/engine/core/rendering/line/LineWidth.h ('k') | sky/engine/core/rendering/shapes/BoxShape.h » ('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 f511555694435032a3ea2dfb48bad954448f48eb..c33a9c5ba5fce821e910c8c7b76a6de9fcd34599 100644
--- a/sky/engine/core/rendering/line/LineWidth.cpp
+++ b/sky/engine/core/rendering/line/LineWidth.cpp
@@ -72,13 +72,6 @@ inline static float availableWidthAtOffset(const RenderBlockFlow& block, const L
return std::max(0.0f, newLineRight - newLineLeft);
}
-inline static float availableWidthAtOffset(const RenderBlockFlow& block, const LayoutUnit& offset, bool shouldIndentText)
-{
- float newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText).toFloat();
- float newLineRight = block.logicalRightOffsetForLine(offset, shouldIndentText).toFloat();
- return std::max(0.0f, newLineRight - newLineLeft);
-}
-
void LineWidth::updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth, const float& newLineLeft, const float& newLineRight)
{
if (newLineWidth <= m_availableWidth)
@@ -90,38 +83,6 @@ void LineWidth::updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWid
m_right = newLineRight;
}
-inline static bool isWholeLineFit(const RenderBlockFlow& block, const LayoutUnit& lineTop, LayoutUnit lineHeight, float uncommittedWidth, bool shouldIndentText)
-{
- for (LayoutUnit lineBottom = lineTop; lineBottom <= lineTop + lineHeight; lineBottom++) {
- LayoutUnit availableWidthAtBottom = availableWidthAtOffset(block, lineBottom, shouldIndentText);
- if (availableWidthAtBottom < uncommittedWidth)
- return false;
- }
- return true;
-}
-
-void LineWidth::wrapNextToShapeOutside(bool isFirstLine)
-{
- LayoutUnit lineHeight = m_block.lineHeight(isFirstLine, HorizontalLine, PositionOfInteriorLineBoxes);
- LayoutUnit lineLogicalTop = m_block.logicalHeight();
- LayoutUnit newLineTop = lineLogicalTop;
- LayoutUnit floatLogicalBottom = lineLogicalTop;
-
- float newLineWidth;
- float newLineLeft = m_left;
- float newLineRight = m_right;
- while (true) {
- newLineWidth = availableWidthAtOffset(m_block, newLineTop, shouldIndentText(), newLineLeft, newLineRight);
- if (newLineWidth >= m_uncommittedWidth && isWholeLineFit(m_block, newLineTop, lineHeight, m_uncommittedWidth, shouldIndentText()))
- break;
-
- if (newLineTop >= floatLogicalBottom)
- break;
-
- newLineTop++;
- }
- updateLineDimension(newLineTop, newLineWidth, newLineLeft, newLineRight);
-}
void LineWidth::fitBelowFloats(bool isFirstLine)
{
« no previous file with comments | « sky/engine/core/rendering/line/LineWidth.h ('k') | sky/engine/core/rendering/shapes/BoxShape.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698