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

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp

Issue 2702043002: Use LayoutUnit for positioning ellipses (Closed)
Patch Set: bug 693905-2 Created 3 years, 10 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
Index: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
index c99a80a9d223a434ab7161328f1b80811064bbba..050b9bd5f67f68a1e748f62a989c267ec7fe7110 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
+++ b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
@@ -1409,8 +1409,8 @@ SelectionState InlineFlowBox::getSelectionState() const {
}
bool InlineFlowBox::canAccommodateEllipsis(bool ltr,
- int blockEdge,
- int ellipsisWidth) const {
+ LayoutUnit blockEdge,
+ LayoutUnit ellipsisWidth) const {
for (InlineBox* box = firstChild(); box; box = box->nextOnLine()) {
if (!box->canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth))
return false;
@@ -1434,23 +1434,21 @@ LayoutUnit InlineFlowBox::placeEllipsisBox(bool ltr,
InlineBox* box = ltr ? firstChild() : lastChild();
// NOTE: these will cross after foundBox = true.
- int visibleLeftEdge = blockLeftEdge.toInt();
- int visibleRightEdge = blockRightEdge.toInt();
+ LayoutUnit visibleLeftEdge = blockLeftEdge;
+ LayoutUnit visibleRightEdge = blockRightEdge;
while (box) {
- int currResult =
- box->placeEllipsisBox(ltr, LayoutUnit(visibleLeftEdge),
- LayoutUnit(visibleRightEdge), ellipsisWidth,
- truncatedWidth, foundBox)
- .toInt();
+ LayoutUnit currResult = box->placeEllipsisBox(
+ ltr, LayoutUnit(visibleLeftEdge), LayoutUnit(visibleRightEdge),
+ ellipsisWidth, truncatedWidth, foundBox);
if (currResult != -1 && result == -1)
- result = LayoutUnit(currResult);
+ result = currResult;
// List markers will sit outside the box so don't let them contribute
// width.
- int boxWidth = box->getLineLayoutItem().isListMarker()
- ? 0
- : box->logicalWidth().round();
+ LayoutUnit boxWidth = box->getLineLayoutItem().isListMarker()
+ ? LayoutUnit()
+ : box->logicalWidth();
if (ltr) {
visibleLeftEdge += boxWidth;
box = box->nextOnLine();

Powered by Google App Engine
This is Rietveld 408576698