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

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

Issue 680213004: Reland of Different fonts selected for width calculation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating Test Expectation Created 6 years 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 foundBox = true; 251 foundBox = true;
252 return -1; 252 return -1;
253 } 253 }
254 254
255 bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < logicalRight()); 255 bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < logicalRight());
256 bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > logicalLeft()); 256 bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > logicalLeft());
257 if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) { 257 if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) {
258 foundBox = true; 258 foundBox = true;
259 259
260 // The inline box may have different directionality than it's parent. S ince truncation 260 // The inline box may have different directionality than it's parent. S ince truncation
261 // behavior depends both on both the parent and the inline block's direc tionality, we 261 // behavior depends both on the parent and the inline block's directiona lity, we
262 // must keep track of these separately. 262 // must keep track of these separately.
263 bool ltr = isLeftToRightDirection(); 263 bool ltr = isLeftToRightDirection();
264 if (ltr != flowIsLTR) { 264 if (ltr != flowIsLTR) {
265 // Width in pixels of the visible portion of the box, excluding the ellipsis. 265 // Width in pixels of the visible portion of the box, excluding the ellipsis.
266 int visibleBoxWidth = visibleRightEdge - visibleLeftEdge - ellipsis Width; 266 int visibleBoxWidth = visibleRightEdge - visibleLeftEdge - ellipsis Width;
267 ellipsisX = ltr ? logicalLeft() + visibleBoxWidth : logicalRight() - visibleBoxWidth; 267 ellipsisX = ltr ? logicalLeft() + visibleBoxWidth : logicalRight() - visibleBoxWidth;
268 } 268 }
269 269
270 int offset = offsetForPosition(ellipsisX, false); 270 int offset = offsetForPosition(ellipsisX, false);
271 if (offset == 0) { 271 if (offset == 0) {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); 541 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj);
542 const int rendererCharacterOffset = 75; 542 const int rendererCharacterOffset = 75;
543 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 543 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
544 fputc(' ', stderr); 544 fputc(' ', stderr);
545 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 545 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
546 } 546 }
547 547
548 #endif 548 #endif
549 549
550 } // namespace blink 550 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/third_party/AndroidEmojiMonospace/README.chromium ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698