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

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

Issue 952273006: Make the constructor of a LayoutRect from an IntRect explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/layout/LayoutInline.cpp ('k') | Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 LayoutBlock* cb = o.containingBlock(); 185 LayoutBlock* cb = o.containingBlock();
186 bool adjustForTableCells = cb ? cb->isTableCell() : false; 186 bool adjustForTableCells = cb ? cb->isTableCell() : false;
187 187
188 LayoutRect r; 188 LayoutRect r;
189 if (o.isText()) { 189 if (o.isText()) {
190 // FIXME: Would be better to dump the bounding box x and y rather than t he first run's x and y, but that would involve updating 190 // FIXME: Would be better to dump the bounding box x and y rather than t he first run's x and y, but that would involve updating
191 // many test results. 191 // many test results.
192 const RenderText& text = toRenderText(o); 192 const RenderText& text = toRenderText(o);
193 IntRect linesBox = text.linesBoundingBox(); 193 IntRect linesBox = text.linesBoundingBox();
194 r = IntRect(text.firstRunX(), text.firstRunY(), linesBox.width(), linesB ox.height()); 194 r = LayoutRect(IntRect(text.firstRunX(), text.firstRunY(), linesBox.widt h(), linesBox.height()));
195 if (adjustForTableCells && !text.firstTextBox()) 195 if (adjustForTableCells && !text.firstTextBox())
196 adjustForTableCells = false; 196 adjustForTableCells = false;
197 } else if (o.isLayoutInline()) { 197 } else if (o.isLayoutInline()) {
198 // FIXME: Would be better not to just dump 0, 0 as the x and y here. 198 // FIXME: Would be better not to just dump 0, 0 as the x and y here.
199 const LayoutInline& inlineFlow = toLayoutInline(o); 199 const LayoutInline& inlineFlow = toLayoutInline(o);
200 r = IntRect(0, 0, inlineFlow.linesBoundingBox().width(), inlineFlow.line sBoundingBox().height()); 200 r = LayoutRect(IntRect(0, 0, inlineFlow.linesBoundingBox().width(), inli neFlow.linesBoundingBox().height()));
201 adjustForTableCells = false; 201 adjustForTableCells = false;
202 } else if (o.isTableCell()) { 202 } else if (o.isTableCell()) {
203 // FIXME: Deliberately dump the "inner" box of table cells, since that i s what current results reflect. We'd like 203 // FIXME: Deliberately dump the "inner" box of table cells, since that i s what current results reflect. We'd like
204 // to clean up the results to dump both the outer box and the intrinsic padding so that both bits of information are 204 // to clean up the results to dump both the outer box and the intrinsic padding so that both bits of information are
205 // captured by the results. 205 // captured by the results.
206 const LayoutTableCell& cell = toLayoutTableCell(o); 206 const LayoutTableCell& cell = toLayoutTableCell(o);
207 r = LayoutRect(cell.location().x(), cell.location().y() + cell.intrinsic PaddingBefore(), cell.size().width(), cell.size().height() - cell.intrinsicPaddi ngBefore() - cell.intrinsicPaddingAfter()); 207 r = LayoutRect(cell.location().x(), cell.location().y() + cell.intrinsic PaddingBefore(), cell.size().width(), cell.size().height() - cell.intrinsicPaddi ngBefore() - cell.intrinsicPaddingAfter());
208 } else if (o.isBox()) { 208 } else if (o.isBox()) {
209 r = toLayoutBox(&o)->frameRect(); 209 r = toLayoutBox(&o)->frameRect();
210 } 210 }
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 element->document().updateLayout(); 780 element->document().updateLayout();
781 781
782 LayoutObject* renderer = element->renderer(); 782 LayoutObject* renderer = element->renderer();
783 if (!renderer || !renderer->isListItem()) 783 if (!renderer || !renderer->isListItem())
784 return String(); 784 return String();
785 785
786 return toLayoutListItem(renderer)->markerText(); 786 return toLayoutListItem(renderer)->markerText();
787 } 787 }
788 788
789 } // namespace blink 789 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutInline.cpp ('k') | Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698