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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 #endif | 118 #endif |
119 | 119 |
120 FloatWillBeLayoutUnit InlineBox::logicalHeight() const | 120 FloatWillBeLayoutUnit InlineBox::logicalHeight() const |
121 { | 121 { |
122 if (hasVirtualLogicalHeight()) | 122 if (hasVirtualLogicalHeight()) |
123 return virtualLogicalHeight(); | 123 return virtualLogicalHeight(); |
124 | 124 |
125 if (renderer().isText()) | 125 if (renderer().isText()) |
126 return m_bitfields.isText() ? FloatWillBeLayoutUnit(renderer().style(isF
irstLineStyle())->fontMetrics().height()) : FloatWillBeLayoutUnit(); | 126 return m_bitfields.isText() ? FloatWillBeLayoutUnit(renderer().style(isF
irstLineStyle())->fontMetrics().height()) : FloatWillBeLayoutUnit(); |
127 if (renderer().isBox() && parent()) | 127 if (renderer().isBox() && parent()) |
128 return isHorizontal() ? toRenderBox(renderer()).size().height() : toRend
erBox(renderer()).size().width(); | 128 return isHorizontal() ? toLayoutBox(renderer()).size().height() : toLayo
utBox(renderer()).size().width(); |
129 | 129 |
130 ASSERT(isInlineFlowBox()); | 130 ASSERT(isInlineFlowBox()); |
131 LayoutBoxModelObject* flowObject = boxModelObject(); | 131 LayoutBoxModelObject* flowObject = boxModelObject(); |
132 const FontMetrics& fontMetrics = renderer().style(isFirstLineStyle())->fontM
etrics(); | 132 const FontMetrics& fontMetrics = renderer().style(isFirstLineStyle())->fontM
etrics(); |
133 FloatWillBeLayoutUnit result = fontMetrics.height(); | 133 FloatWillBeLayoutUnit result = fontMetrics.height(); |
134 if (parent()) | 134 if (parent()) |
135 result += flowObject->borderAndPaddingLogicalHeight(); | 135 result += flowObject->borderAndPaddingLogicalHeight(); |
136 return result; | 136 return result; |
137 } | 137 } |
138 | 138 |
(...skipping 20 matching lines...) Expand all Loading... |
159 void InlineBox::dirtyLineBoxes() | 159 void InlineBox::dirtyLineBoxes() |
160 { | 160 { |
161 markDirty(); | 161 markDirty(); |
162 for (InlineFlowBox* curr = parent(); curr && !curr->isDirty(); curr = curr->
parent()) | 162 for (InlineFlowBox* curr = parent(); curr && !curr->isDirty(); curr = curr->
parent()) |
163 curr->markDirty(); | 163 curr->markDirty(); |
164 } | 164 } |
165 | 165 |
166 void InlineBox::deleteLine() | 166 void InlineBox::deleteLine() |
167 { | 167 { |
168 if (!m_bitfields.extracted() && renderer().isBox()) | 168 if (!m_bitfields.extracted() && renderer().isBox()) |
169 toRenderBox(renderer()).setInlineBoxWrapper(0); | 169 toLayoutBox(renderer()).setInlineBoxWrapper(0); |
170 destroy(); | 170 destroy(); |
171 } | 171 } |
172 | 172 |
173 void InlineBox::extractLine() | 173 void InlineBox::extractLine() |
174 { | 174 { |
175 m_bitfields.setExtracted(true); | 175 m_bitfields.setExtracted(true); |
176 if (renderer().isBox()) | 176 if (renderer().isBox()) |
177 toRenderBox(renderer()).setInlineBoxWrapper(0); | 177 toLayoutBox(renderer()).setInlineBoxWrapper(0); |
178 } | 178 } |
179 | 179 |
180 void InlineBox::attachLine() | 180 void InlineBox::attachLine() |
181 { | 181 { |
182 m_bitfields.setExtracted(false); | 182 m_bitfields.setExtracted(false); |
183 if (renderer().isBox()) | 183 if (renderer().isBox()) |
184 toRenderBox(renderer()).setInlineBoxWrapper(this); | 184 toLayoutBox(renderer()).setInlineBoxWrapper(this); |
185 } | 185 } |
186 | 186 |
187 void InlineBox::adjustPosition(FloatWillBeLayoutUnit dx, FloatWillBeLayoutUnit d
y) | 187 void InlineBox::adjustPosition(FloatWillBeLayoutUnit dx, FloatWillBeLayoutUnit d
y) |
188 { | 188 { |
189 m_topLeft.move(dx, dy); | 189 m_topLeft.move(dx, dy); |
190 | 190 |
191 if (renderer().isReplaced()) | 191 if (renderer().isReplaced()) |
192 toRenderBox(renderer()).move(dx, dy); | 192 toLayoutBox(renderer()).move(dx, dy); |
193 } | 193 } |
194 | 194 |
195 void InlineBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset
, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) | 195 void InlineBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset
, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) |
196 { | 196 { |
197 // Text clips are painted only for the direct inline children of the object
that has a text clip style on it, not block children. | 197 // Text clips are painted only for the direct inline children of the object
that has a text clip style on it, not block children. |
198 if (paintInfo.phase != PaintPhaseTextClip) | 198 if (paintInfo.phase != PaintPhaseTextClip) |
199 BlockPainter::paintInlineBox(*this, paintInfo, paintOffset); | 199 BlockPainter::paintInlineBox(*this, paintInfo, paintOffset); |
200 } | 200 } |
201 | 201 |
202 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) | 202 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/) |
203 { | 203 { |
204 // Hit test all phases of replaced elements atomically, as though the replac
ed element established its | 204 // Hit test all phases of replaced elements atomically, as though the replac
ed element established its |
205 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab
le elements in the CSS2.1 | 205 // own stacking context. (See Appendix E.2, section 6.4 on inline block/tab
le elements in the CSS2.1 |
206 // specification.) | 206 // specification.) |
207 LayoutPoint childPoint = accumulatedOffset; | 207 LayoutPoint childPoint = accumulatedOffset; |
208 if (parent()->renderer().hasFlippedBlocksWritingMode()) // Faster than calli
ng containingBlock(). | 208 if (parent()->renderer().hasFlippedBlocksWritingMode()) // Faster than calli
ng containingBlock(). |
209 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t
oRenderBox(renderer()), childPoint); | 209 childPoint = renderer().containingBlock()->flipForWritingModeForChild(&t
oLayoutBox(renderer()), childPoint); |
210 | 210 |
211 return renderer().hitTest(request, result, locationInContainer, childPoint); | 211 return renderer().hitTest(request, result, locationInContainer, childPoint); |
212 } | 212 } |
213 | 213 |
214 const RootInlineBox& InlineBox::root() const | 214 const RootInlineBox& InlineBox::root() const |
215 { | 215 { |
216 if (m_parent) | 216 if (m_parent) |
217 return m_parent->root(); | 217 return m_parent->root(); |
218 ASSERT(isRootInlineBox()); | 218 ASSERT(isRootInlineBox()); |
219 return static_cast<const RootInlineBox&>(*this); | 219 return static_cast<const RootInlineBox&>(*this); |
(...skipping 138 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 |