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

Side by Side Diff: Source/core/layout/LayoutTreeAsText.cpp

Issue 1043643002: Switch line layout to LayoutUnit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More TestExpectations tweaks Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 ts << ")"; 403 ts << ")";
404 } 404 }
405 } 405 }
406 406
407 static void writeTextRun(TextStream& ts, const LayoutText& o, const InlineTextBo x& run) 407 static void writeTextRun(TextStream& ts, const LayoutText& o, const InlineTextBo x& run)
408 { 408 {
409 // FIXME: For now use an "enclosingIntRect" model for x, y and logicalWidth, although this makes it harder 409 // FIXME: For now use an "enclosingIntRect" model for x, y and logicalWidth, although this makes it harder
410 // to detect any changes caused by the conversion to floating point. :( 410 // to detect any changes caused by the conversion to floating point. :(
411 int x = run.x(); 411 int x = run.x();
412 int y = run.y(); 412 int y = run.y();
413 int logicalWidth = ceilf(run.left() + run.logicalWidth()) - x; 413 int logicalWidth = (run.left() + run.logicalWidth()).ceil() - x;
414 414
415 // FIXME: Table cell adjustment is temporary until results can be updated. 415 // FIXME: Table cell adjustment is temporary until results can be updated.
416 if (o.containingBlock()->isTableCell()) 416 if (o.containingBlock()->isTableCell())
417 y -= toLayoutTableCell(o.containingBlock())->intrinsicPaddingBefore(); 417 y -= toLayoutTableCell(o.containingBlock())->intrinsicPaddingBefore();
418 418
419 ts << "text run at (" << x << "," << y << ") width " << logicalWidth; 419 ts << "text run at (" << x << "," << y << ") width " << logicalWidth;
420 if (!run.isLeftToRightDirection() || run.dirOverride()) { 420 if (!run.isLeftToRightDirection() || run.dirOverride()) {
421 ts << (!run.isLeftToRightDirection() ? " RTL" : " LTR"); 421 ts << (!run.isLeftToRightDirection() ? " RTL" : " LTR");
422 if (run.dirOverride()) 422 if (run.dirOverride())
423 ts << " override"; 423 ts << " override";
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 element->document().updateLayout(); 780 element->document().updateLayout();
781 781
782 LayoutObject* layoutObject = element->layoutObject(); 782 LayoutObject* layoutObject = element->layoutObject();
783 if (!layoutObject || !layoutObject->isListItem()) 783 if (!layoutObject || !layoutObject->isListItem())
784 return String(); 784 return String();
785 785
786 return toLayoutListItem(layoutObject)->markerText(); 786 return toLayoutListItem(layoutObject)->markerText();
787 } 787 }
788 788
789 } // namespace blink 789 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTextCombine.cpp ('k') | Source/core/layout/line/AbstractInlineTextBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698