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

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

Issue 2651123005: Place ellipsis correctly in presence of list markers (Closed)
Patch Set: bug 645938 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 1401
1402 while (box) { 1402 while (box) {
1403 int currResult = 1403 int currResult =
1404 box->placeEllipsisBox(ltr, LayoutUnit(visibleLeftEdge), 1404 box->placeEllipsisBox(ltr, LayoutUnit(visibleLeftEdge),
1405 LayoutUnit(visibleRightEdge), ellipsisWidth, 1405 LayoutUnit(visibleRightEdge), ellipsisWidth,
1406 truncatedWidth, foundBox) 1406 truncatedWidth, foundBox)
1407 .toInt(); 1407 .toInt();
1408 if (currResult != -1 && result == -1) 1408 if (currResult != -1 && result == -1)
1409 result = LayoutUnit(currResult); 1409 result = LayoutUnit(currResult);
1410 1410
1411 // List markers will sit outside the box so don't let them contribute
1412 // width.
1413 int boxWidth = box->getLineLayoutItem().isListMarker()
1414 ? 0
1415 : box->logicalWidth().round();
1411 if (ltr) { 1416 if (ltr) {
1412 visibleLeftEdge += box->logicalWidth().round(); 1417 visibleLeftEdge += boxWidth;
1413 box = box->nextOnLine(); 1418 box = box->nextOnLine();
1414 } else { 1419 } else {
1415 visibleRightEdge -= box->logicalWidth().round(); 1420 visibleRightEdge -= boxWidth;
1416 box = box->prevOnLine(); 1421 box = box->prevOnLine();
1417 } 1422 }
1418 } 1423 }
1419 return result; 1424 return result;
1420 } 1425 }
1421 1426
1422 void InlineFlowBox::clearTruncation() { 1427 void InlineFlowBox::clearTruncation() {
1423 for (InlineBox* box = firstChild(); box; box = box->nextOnLine()) 1428 for (InlineBox* box = firstChild(); box; box = box->nextOnLine())
1424 box->clearTruncation(); 1429 box->clearTruncation();
1425 } 1430 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 ASSERT(child->prevOnLine() == prev); 1651 ASSERT(child->prevOnLine() == prev);
1647 prev = child; 1652 prev = child;
1648 } 1653 }
1649 ASSERT(prev == m_lastChild); 1654 ASSERT(prev == m_lastChild);
1650 #endif 1655 #endif
1651 } 1656 }
1652 1657
1653 #endif 1658 #endif
1654 1659
1655 } // namespace blink 1660 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698