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 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 { | 133 { |
134 if (hasVirtualLogicalHeight()) | 134 if (hasVirtualLogicalHeight()) |
135 return virtualLogicalHeight(); | 135 return virtualLogicalHeight(); |
136 | 136 |
137 if (lineLayoutItem().isText()) | 137 if (lineLayoutItem().isText()) |
138 return m_bitfields.isText() ? LayoutUnit(lineLayoutItem().style(isFirstL
ineStyle())->fontMetrics().height()) : LayoutUnit(); | 138 return m_bitfields.isText() ? LayoutUnit(lineLayoutItem().style(isFirstL
ineStyle())->fontMetrics().height()) : LayoutUnit(); |
139 if (lineLayoutItem().isBox() && parent()) | 139 if (lineLayoutItem().isBox() && parent()) |
140 return isHorizontal() ? toLayoutBox(layoutObject()).size().height() : to
LayoutBox(layoutObject()).size().width(); | 140 return isHorizontal() ? toLayoutBox(layoutObject()).size().height() : to
LayoutBox(layoutObject()).size().width(); |
141 | 141 |
142 ASSERT(isInlineFlowBox()); | 142 ASSERT(isInlineFlowBox()); |
143 LayoutBoxModelObject* flowObject = boxModelObject(); | 143 LineLayoutBoxModel flowObject = boxModelObject(); |
144 const FontMetrics& fontMetrics = lineLayoutItem().style(isFirstLineStyle())-
>fontMetrics(); | 144 const FontMetrics& fontMetrics = lineLayoutItem().style(isFirstLineStyle())-
>fontMetrics(); |
145 LayoutUnit result = fontMetrics.height(); | 145 LayoutUnit result = fontMetrics.height(); |
146 if (parent()) | 146 if (parent()) |
147 result += flowObject->borderAndPaddingLogicalHeight(); | 147 result += flowObject.borderAndPaddingLogicalHeight(); |
148 return result; | 148 return result; |
149 } | 149 } |
150 | 150 |
151 int InlineBox::baselinePosition(FontBaseline baselineType) const | 151 int InlineBox::baselinePosition(FontBaseline baselineType) const |
152 { | 152 { |
153 return boxModelObject()->baselinePosition(baselineType, m_bitfields.firstLin
e(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); | 153 return boxModelObject().baselinePosition(baselineType, m_bitfields.firstLine
(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); |
154 } | 154 } |
155 | 155 |
156 LayoutUnit InlineBox::lineHeight() const | 156 LayoutUnit InlineBox::lineHeight() const |
157 { | 157 { |
158 return boxModelObject()->lineHeight(m_bitfields.firstLine(), isHorizontal()
? HorizontalLine : VerticalLine, PositionOnContainingLine); | 158 return boxModelObject().lineHeight(m_bitfields.firstLine(), isHorizontal() ?
HorizontalLine : VerticalLine, PositionOnContainingLine); |
159 } | 159 } |
160 | 160 |
161 int InlineBox::caretMinOffset() const | 161 int InlineBox::caretMinOffset() const |
162 { | 162 { |
163 return lineLayoutItem().caretMinOffset(); | 163 return lineLayoutItem().caretMinOffset(); |
164 } | 164 } |
165 | 165 |
166 int InlineBox::caretMaxOffset() const | 166 int InlineBox::caretMaxOffset() const |
167 { | 167 { |
168 return lineLayoutItem().caretMaxOffset(); | 168 return lineLayoutItem().caretMaxOffset(); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 void showLineTree(const blink::InlineBox* b) | 396 void showLineTree(const blink::InlineBox* b) |
397 { | 397 { |
398 if (b) | 398 if (b) |
399 b->showLineTreeForThis(); | 399 b->showLineTreeForThis(); |
400 else | 400 else |
401 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); | 401 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); |
402 } | 402 } |
403 | 403 |
404 #endif | 404 #endif |
OLD | NEW |