OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #include "config.h" | 20 #include "config.h" |
21 #include "core/layout/line/InlineBox.h" | 21 #include "core/layout/line/InlineBox.h" |
22 | 22 |
| 23 #include "core/layout/LayoutObject.h" |
23 #include "core/layout/line/InlineFlowBox.h" | 24 #include "core/layout/line/InlineFlowBox.h" |
24 #include "core/layout/line/RootInlineBox.h" | 25 #include "core/layout/line/RootInlineBox.h" |
25 #include "core/paint/BlockPainter.h" | 26 #include "core/paint/BlockPainter.h" |
26 #include "core/rendering/PaintInfo.h" | 27 #include "core/rendering/PaintInfo.h" |
27 #include "core/rendering/RenderBlockFlow.h" | 28 #include "core/rendering/RenderBlockFlow.h" |
28 #include "core/rendering/RenderObjectInlines.h" | |
29 #include "platform/Partitions.h" | 29 #include "platform/Partitions.h" |
30 #include "platform/fonts/FontMetrics.h" | 30 #include "platform/fonts/FontMetrics.h" |
31 | 31 |
32 #ifndef NDEBUG | 32 #ifndef NDEBUG |
33 #include <stdio.h> | 33 #include <stdio.h> |
34 #endif | 34 #endif |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 struct SameSizeAsInlineBox { | 38 struct SameSizeAsInlineBox { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void InlineBox::showTreeForThis() const | 83 void InlineBox::showTreeForThis() const |
84 { | 84 { |
85 renderer().showTreeForThis(); | 85 renderer().showTreeForThis(); |
86 } | 86 } |
87 | 87 |
88 void InlineBox::showLineTreeForThis() const | 88 void InlineBox::showLineTreeForThis() const |
89 { | 89 { |
90 renderer().containingBlock()->showLineTreeAndMark(this, "*"); | 90 renderer().containingBlock()->showLineTreeAndMark(this, "*"); |
91 } | 91 } |
92 | 92 |
93 void InlineBox::showLineTreeAndMark(const InlineBox* markedBox1, const char* mar
kedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const RenderOb
ject* obj, int depth) const | 93 void InlineBox::showLineTreeAndMark(const InlineBox* markedBox1, const char* mar
kedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const LayoutOb
ject* obj, int depth) const |
94 { | 94 { |
95 int printedCharacters = 0; | 95 int printedCharacters = 0; |
96 if (this == markedBox1) | 96 if (this == markedBox1) |
97 printedCharacters += fprintf(stderr, "%s", markedLabel1); | 97 printedCharacters += fprintf(stderr, "%s", markedLabel1); |
98 if (this == markedBox2) | 98 if (this == markedBox2) |
99 printedCharacters += fprintf(stderr, "%s", markedLabel2); | 99 printedCharacters += fprintf(stderr, "%s", markedLabel2); |
100 if (&renderer() == obj) | 100 if (&renderer() == obj) |
101 printedCharacters += fprintf(stderr, "*"); | 101 printedCharacters += fprintf(stderr, "*"); |
102 for (; printedCharacters < depth * 2; printedCharacters++) | 102 for (; printedCharacters < depth * 2; printedCharacters++) |
103 fputc(' ', stderr); | 103 fputc(' ', stderr); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 271 } |
272 | 272 |
273 InlineBox* InlineBox::prevLeafChildIgnoringLineBreak() const | 273 InlineBox* InlineBox::prevLeafChildIgnoringLineBreak() const |
274 { | 274 { |
275 InlineBox* leaf = prevLeafChild(); | 275 InlineBox* leaf = prevLeafChild(); |
276 if (leaf && leaf->isLineBreak()) | 276 if (leaf && leaf->isLineBreak()) |
277 return 0; | 277 return 0; |
278 return leaf; | 278 return leaf; |
279 } | 279 } |
280 | 280 |
281 RenderObject::SelectionState InlineBox::selectionState() const | 281 LayoutObject::SelectionState InlineBox::selectionState() const |
282 { | 282 { |
283 return renderer().selectionState(); | 283 return renderer().selectionState(); |
284 } | 284 } |
285 | 285 |
286 bool InlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidt
h) const | 286 bool InlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidt
h) const |
287 { | 287 { |
288 // Non-replaced elements can always accommodate an ellipsis. | 288 // Non-replaced elements can always accommodate an ellipsis. |
289 if (!renderer().isReplaced()) | 289 if (!renderer().isReplaced()) |
290 return true; | 290 return true; |
291 | 291 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 b->showTreeForThis(); | 358 b->showTreeForThis(); |
359 } | 359 } |
360 | 360 |
361 void showLineTree(const blink::InlineBox* b) | 361 void showLineTree(const blink::InlineBox* b) |
362 { | 362 { |
363 if (b) | 363 if (b) |
364 b->showLineTreeForThis(); | 364 b->showLineTreeForThis(); |
365 } | 365 } |
366 | 366 |
367 #endif | 367 #endif |
OLD | NEW |