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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTreeAsText.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, 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 * 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 { 448 {
449 for (const InlineFlowBox* rootBox = o.firstLineBox(); rootBox; rootBox = roo tBox->nextLineBox()) { 449 for (const InlineFlowBox* rootBox = o.firstLineBox(); rootBox; rootBox = roo tBox->nextLineBox()) {
450 writeInlineFlowBox(ts, *rootBox, indent); 450 writeInlineFlowBox(ts, *rootBox, indent);
451 } 451 }
452 } 452 }
453 453
454 static void writeTextRun(TextStream& ts, const LayoutText& o, const InlineTextBo x& run) 454 static void writeTextRun(TextStream& ts, const LayoutText& o, const InlineTextBo x& run)
455 { 455 {
456 // FIXME: For now use an "enclosingIntRect" model for x, y and logicalWidth, although this makes it harder 456 // FIXME: For now use an "enclosingIntRect" model for x, y and logicalWidth, although this makes it harder
457 // to detect any changes caused by the conversion to floating point. :( 457 // to detect any changes caused by the conversion to floating point. :(
458 int x = run.x(); 458 int x = run.x().toInt();
459 int y = run.y(); 459 int y = run.y().toInt();
460 int logicalWidth = (run.left() + run.logicalWidth()).ceil() - x; 460 int logicalWidth = (run.left() + run.logicalWidth()).ceil() - x;
461 461
462 // FIXME: Table cell adjustment is temporary until results can be updated. 462 // FIXME: Table cell adjustment is temporary until results can be updated.
463 if (o.containingBlock()->isTableCell()) 463 if (o.containingBlock()->isTableCell())
464 y -= toLayoutTableCell(o.containingBlock())->intrinsicPaddingBefore(); 464 y -= toLayoutTableCell(o.containingBlock())->intrinsicPaddingBefore();
465 465
466 ts << "text run at (" << x << "," << y << ") width " << logicalWidth; 466 ts << "text run at (" << x << "," << y << ") width " << logicalWidth;
467 if (!run.isLeftToRightDirection() || run.dirOverride()) { 467 if (!run.isLeftToRightDirection() || run.dirOverride()) {
468 ts << (!run.isLeftToRightDirection() ? " RTL" : " LTR"); 468 ts << (!run.isLeftToRightDirection() ? " RTL" : " LTR");
469 if (run.dirOverride()) 469 if (run.dirOverride())
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 element->document().updateStyleAndLayout(); 845 element->document().updateStyleAndLayout();
846 846
847 LayoutObject* layoutObject = element->layoutObject(); 847 LayoutObject* layoutObject = element->layoutObject();
848 if (!layoutObject || !layoutObject->isListItem()) 848 if (!layoutObject || !layoutObject->isListItem())
849 return String(); 849 return String();
850 850
851 return toLayoutListItem(layoutObject)->markerText(); 851 return toLayoutListItem(layoutObject)->markerText();
852 } 852 }
853 853
854 } // namespace blink 854 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTheme.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutVTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698