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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 { 305 {
306 return getLineLayoutItem().getSelectionState(); 306 return getLineLayoutItem().getSelectionState();
307 } 307 }
308 308
309 bool InlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidt h) const 309 bool InlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidt h) const
310 { 310 {
311 // Non-atomic inline-level elements can always accommodate an ellipsis. 311 // Non-atomic inline-level elements can always accommodate an ellipsis.
312 if (!getLineLayoutItem().isAtomicInlineLevel()) 312 if (!getLineLayoutItem().isAtomicInlineLevel())
313 return true; 313 return true;
314 314
315 IntRect boxRect(left(), 0, m_logicalWidth, 10); 315 IntRect boxRect(left().toInt(), 0, m_logicalWidth.toInt(), 10);
316 IntRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsi sWidth, 10); 316 IntRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsi sWidth, 10);
317 return !(boxRect.intersects(ellipsisRect)); 317 return !(boxRect.intersects(ellipsisRect));
318 } 318 }
319 319
320 LayoutUnit InlineBox::placeEllipsisBox(bool, LayoutUnit, LayoutUnit, LayoutUnit, LayoutUnit& truncatedWidth, bool&) 320 LayoutUnit InlineBox::placeEllipsisBox(bool, LayoutUnit, LayoutUnit, LayoutUnit, LayoutUnit& truncatedWidth, bool&)
321 { 321 {
322 // Use -1 to mean "we didn't set the position." 322 // Use -1 to mean "we didn't set the position."
323 truncatedWidth += logicalWidth(); 323 truncatedWidth += logicalWidth();
324 return LayoutUnit(-1); 324 return LayoutUnit(-1);
325 } 325 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 void showLineTree(const blink::InlineBox* b) 420 void showLineTree(const blink::InlineBox* b)
421 { 421 {
422 if (b) 422 if (b)
423 b->showLineTreeForThis(); 423 b->showLineTreeForThis();
424 else 424 else
425 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); 425 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n");
426 } 426 }
427 427
428 #endif 428 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.h ('k') | third_party/WebKit/Source/core/layout/line/InlineFlowBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698