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

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: Rebase patch Created 6 years, 2 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 foundBox = true; 264 foundBox = true;
265 return -1; 265 return -1;
266 } 266 }
267 267
268 bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < logicalRight()); 268 bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < logicalRight());
269 bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > logicalLeft()); 269 bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > logicalLeft());
270 if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) { 270 if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) {
271 foundBox = true; 271 foundBox = true;
272 272
273 // The inline box may have different directionality than it's parent. S ince truncation 273 // The inline box may have different directionality than it's parent. S ince truncation
274 // behavior depends both on both the parent and the inline block's direc tionality, we 274 // behavior depends both on the parent and the inline block's directiona lity, we
275 // must keep track of these separately. 275 // must keep track of these separately.
276 bool ltr = isLeftToRightDirection(); 276 bool ltr = isLeftToRightDirection();
277 if (ltr != flowIsLTR) { 277 if (ltr != flowIsLTR) {
278 // Width in pixels of the visible portion of the box, excluding the ellipsis. 278 // Width in pixels of the visible portion of the box, excluding the ellipsis.
279 int visibleBoxWidth = visibleRightEdge - visibleLeftEdge - ellipsis Width; 279 int visibleBoxWidth = visibleRightEdge - visibleLeftEdge - ellipsis Width;
280 ellipsisX = ltr ? logicalLeft() + visibleBoxWidth : logicalRight() - visibleBoxWidth; 280 ellipsisX = ltr ? logicalLeft() + visibleBoxWidth : logicalRight() - visibleBoxWidth;
281 } 281 }
282 282
283 int offset = offsetForPosition(ellipsisX, false); 283 int offset = offsetForPosition(ellipsisX, false);
284 if (offset == 0) { 284 if (offset == 0) {
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); 555 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj);
556 const int rendererCharacterOffset = 24; 556 const int rendererCharacterOffset = 24;
557 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 557 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
558 fputc(' ', stderr); 558 fputc(' ', stderr);
559 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 559 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
560 } 560 }
561 561
562 #endif 562 #endif
563 563
564 } // namespace blink 564 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698