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

Side by Side Diff: Source/core/rendering/InlineTextBox.cpp

Issue 593673003: Different fonts selected for width calculation and actual painting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@ellipsis_not_present
Patch Set: Created 6 years, 3 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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 foundBox = true; 276 foundBox = true;
277 return -1; 277 return -1;
278 } 278 }
279 279
280 bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < logicalRight()); 280 bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < logicalRight());
281 bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > logicalLeft()); 281 bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > logicalLeft());
282 if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) { 282 if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) {
283 foundBox = true; 283 foundBox = true;
284 284
285 // The inline box may have different directionality than it's parent. S ince truncation 285 // The inline box may have different directionality than it's parent. S ince truncation
286 // behavior depends both on both the parent and the inline block's direc tionality, we 286 // behavior depends both on the parent and the inline block's directiona lity, we
287 // must keep track of these separately. 287 // must keep track of these separately.
288 bool ltr = isLeftToRightDirection(); 288 bool ltr = isLeftToRightDirection();
289 if (ltr != flowIsLTR) { 289 if (ltr != flowIsLTR) {
290 // Width in pixels of the visible portion of the box, excluding the ellipsis. 290 // Width in pixels of the visible portion of the box, excluding the ellipsis.
291 int visibleBoxWidth = visibleRightEdge - visibleLeftEdge - ellipsis Width; 291 int visibleBoxWidth = visibleRightEdge - visibleLeftEdge - ellipsis Width;
292 ellipsisX = ltr ? logicalLeft() + visibleBoxWidth : logicalRight() - visibleBoxWidth; 292 ellipsisX = ltr ? logicalLeft() + visibleBoxWidth : logicalRight() - visibleBoxWidth;
293 } 293 }
294 294
295 int offset = offsetForPosition(ellipsisX, false); 295 int offset = offsetForPosition(ellipsisX, false);
296 if (offset == 0) { 296 if (offset == 0) {
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); 1369 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj);
1370 const int rendererCharacterOffset = 24; 1370 const int rendererCharacterOffset = 24;
1371 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 1371 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
1372 fputc(' ', stderr); 1372 fputc(' ', stderr);
1373 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 1373 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
1374 } 1374 }
1375 1375
1376 #endif 1376 #endif
1377 1377
1378 } // namespace blink 1378 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698