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

Unified Diff: Source/core/rendering/InlineFlowBox.h

Issue 699683002: Continue with InlineBox float->LayoutUnit migration. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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/InlineFlowBox.h
diff --git a/Source/core/rendering/InlineFlowBox.h b/Source/core/rendering/InlineFlowBox.h
index f9a88bda17b76a25b3cd74716842932fa472d921..67005cf52b36b1e25f2d913331c411c7676f93d9 100644
--- a/Source/core/rendering/InlineFlowBox.h
+++ b/Source/core/rendering/InlineFlowBox.h
@@ -21,6 +21,7 @@
#ifndef InlineFlowBox_h
#define InlineFlowBox_h
+#include "core/rendering/FloatToLayoutUnit.h"
#include "core/rendering/InlineBox.h"
#include "core/rendering/RenderObjectInlines.h"
#include "core/rendering/RenderOverflow.h"
@@ -105,7 +106,7 @@ public:
virtual void deleteLine() override final;
virtual void extractLine() override final;
virtual void attachLine() override final;
- virtual void adjustPosition(float dx, float dy) override;
+ virtual void adjustPosition(FloatWillBeLayoutUnit dx, FloatWillBeLayoutUnit dy) override;
virtual void extractLineBoxFromRenderObject();
virtual void attachLineBoxToRenderObject();
@@ -173,11 +174,11 @@ public:
// Helper functions used during line construction and placement.
void determineSpacingForFlowBoxes(bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer);
LayoutUnit getFlowSpacingLogicalWidth();
- float placeBoxesInInlineDirection(float logicalLeft, bool& needsWordSpacing);
- float placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastChild,
- float& logicalLeft, float& minLogicalLeft, float& maxLogicalRight, bool& needsWordSpacing);
- void beginPlacingBoxRangesInInlineDirection(float logicalLeft) { setLogicalLeft(logicalLeft); }
- void endPlacingBoxRangesInInlineDirection(float logicalLeft, float logicalRight, float minLogicalLeft, float maxLogicalRight)
+ FloatWillBeLayoutUnit placeBoxesInInlineDirection(FloatWillBeLayoutUnit logicalLeft, bool& needsWordSpacing);
+ FloatWillBeLayoutUnit placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastChild,
+ FloatWillBeLayoutUnit& logicalLeft, FloatWillBeLayoutUnit& minLogicalLeft, FloatWillBeLayoutUnit& maxLogicalRight, bool& needsWordSpacing);
+ void beginPlacingBoxRangesInInlineDirection(FloatWillBeLayoutUnit logicalLeft) { setLogicalLeft(logicalLeft); }
+ void endPlacingBoxRangesInInlineDirection(FloatWillBeLayoutUnit logicalLeft, FloatWillBeLayoutUnit logicalRight, FloatWillBeLayoutUnit minLogicalLeft, FloatWillBeLayoutUnit maxLogicalRight)
{
setLogicalWidth(logicalRight - logicalLeft);
if (knownToHaveNoOverflow() && (minLogicalLeft < logicalLeft || maxLogicalRight > logicalRight))
@@ -204,7 +205,7 @@ public:
virtual RenderObject::SelectionState selectionState() const override;
virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidth) const override final;
- virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, float &truncatedWidth, bool&) override;
+ virtual FloatWillBeLayoutUnit placeEllipsisBox(bool ltr, FloatWillBeLayoutUnit blockLeftEdge, FloatWillBeLayoutUnit blockRightEdge, FloatWillBeLayoutUnit ellipsisWidth, FloatWillBeLayoutUnit &truncatedWidth, bool&) override;
bool hasTextChildren() const { return m_hasTextChildren; }
bool hasTextDescendants() const { return m_hasTextDescendants; }
@@ -245,7 +246,7 @@ public:
return m_overflow ? m_overflow->visualOverflowRect() : enclosingLayoutRect(frameRectIncludingLineHeight(lineTop, lineBottom));
}
LayoutUnit logicalLeftVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->visualOverflowRect().x() : m_overflow->visualOverflowRect().y()) : static_cast<LayoutUnit>(logicalLeft()); }
- LayoutUnit logicalRightVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->visualOverflowRect().maxX() : m_overflow->visualOverflowRect().maxY()) : static_cast<LayoutUnit>(ceilf(logicalRight())); }
+ LayoutUnit logicalRightVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->visualOverflowRect().maxX() : m_overflow->visualOverflowRect().maxY()) : static_cast<LayoutUnit>(LAYOUT_UNIT_CEIL(logicalRight())); }
LayoutUnit logicalTopVisualOverflow(LayoutUnit lineTop) const
{
if (m_overflow)
@@ -268,16 +269,16 @@ public:
void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, const LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom);
- FloatRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const
+ FloatRectWillBeLayoutRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const
{
if (isHorizontal())
- return FloatRect(m_topLeft.x(), lineTop.toFloat(), width(), (lineBottom - lineTop).toFloat());
- return FloatRect(lineTop.toFloat(), m_topLeft.y(), (lineBottom - lineTop).toFloat(), height());
+ return FloatRectWillBeLayoutRect(m_topLeft.x(), LAYOUT_UNIT_TO_FLOAT(lineTop), width(), LAYOUT_UNIT_TO_FLOAT(lineBottom - lineTop));
+ return FloatRectWillBeLayoutRect(LAYOUT_UNIT_TO_FLOAT(lineTop), m_topLeft.y(), LAYOUT_UNIT_TO_FLOAT(lineBottom - lineTop), height());
}
- FloatRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const
+ FloatRectWillBeLayoutRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const
{
- return FloatRect(logicalLeft(), lineTop.toFloat(), logicalWidth(), (lineBottom - lineTop).toFloat());
+ return FloatRectWillBeLayoutRect(logicalLeft(), LAYOUT_UNIT_TO_FLOAT(lineTop), logicalWidth(), LAYOUT_UNIT_TO_FLOAT(lineBottom - lineTop));
}
bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendantsHaveSameLineHeightAndBaseline; }
@@ -311,7 +312,7 @@ protected:
// Maximum logicalTop among all children of an InlineFlowBox. Used to
// calculate the offset for TextUnderlinePositionUnder.
- void computeMaxLogicalTop(float& maxLogicalTop) const;
+ void computeMaxLogicalTop(FloatWillBeLayoutUnit& maxLogicalTop) const;
private:
unsigned m_includeLogicalLeftEdge : 1;

Powered by Google App Engine
This is Rietveld 408576698