| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 baselinePosition(IdeographicBaseline)); | 116 baselinePosition(IdeographicBaseline)); |
| 117 } | 117 } |
| 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() ? INT_TO_LAYOUT_UNIT(renderer().style(isFirs
tLineStyle())->fontMetrics().height()) : ZERO_LAYOUT_UNIT; | 126 return m_bitfields.isText() ? renderer().style(isFirstLineStyle())->font
Metrics().height() : 0; |
| 127 if (renderer().isBox() && parent()) | 127 if (renderer().isBox() && parent()) |
| 128 return isHorizontal() ? LAYOUT_UNIT_TO_FLOAT(toRenderBox(renderer()).hei
ght()) : LAYOUT_UNIT_TO_FLOAT(toRenderBox(renderer()).width()); | 128 return isHorizontal() ? toRenderBox(renderer()).height().toFloat() : toR
enderBox(renderer()).width().toFloat(); |
| 129 | 129 |
| 130 ASSERT(isInlineFlowBox()); | 130 ASSERT(isInlineFlowBox()); |
| 131 RenderBoxModelObject* flowObject = boxModelObject(); | 131 RenderBoxModelObject* 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 IntRect boxRect(left(), 0, m_logicalWidth, 10); | 290 IntRect boxRect(left(), 0, m_logicalWidth, 10); |
| 291 IntRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsi
sWidth, 10); | 291 IntRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsi
sWidth, 10); |
| 292 return !(boxRect.intersects(ellipsisRect)); | 292 return !(boxRect.intersects(ellipsisRect)); |
| 293 } | 293 } |
| 294 | 294 |
| 295 FloatWillBeLayoutUnit InlineBox::placeEllipsisBox(bool, FloatWillBeLayoutUnit, F
loatWillBeLayoutUnit, FloatWillBeLayoutUnit, FloatWillBeLayoutUnit& truncatedWid
th, bool&) | 295 FloatWillBeLayoutUnit InlineBox::placeEllipsisBox(bool, FloatWillBeLayoutUnit, F
loatWillBeLayoutUnit, FloatWillBeLayoutUnit, FloatWillBeLayoutUnit& truncatedWid
th, bool&) |
| 296 { | 296 { |
| 297 // Use -1 to mean "we didn't set the position." | 297 // Use -1 to mean "we didn't set the position." |
| 298 truncatedWidth += logicalWidth(); | 298 truncatedWidth += logicalWidth(); |
| 299 return MINUS_ONE_LAYOUT_UNIT; | 299 return -1; |
| 300 } | 300 } |
| 301 | 301 |
| 302 void InlineBox::clearKnownToHaveNoOverflow() | 302 void InlineBox::clearKnownToHaveNoOverflow() |
| 303 { | 303 { |
| 304 m_bitfields.setKnownToHaveNoOverflow(false); | 304 m_bitfields.setKnownToHaveNoOverflow(false); |
| 305 if (parent() && parent()->knownToHaveNoOverflow()) | 305 if (parent() && parent()->knownToHaveNoOverflow()) |
| 306 parent()->clearKnownToHaveNoOverflow(); | 306 parent()->clearKnownToHaveNoOverflow(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 FloatPointWillBeLayoutPoint InlineBox::locationIncludingFlipping() | 309 FloatPointWillBeLayoutPoint InlineBox::locationIncludingFlipping() |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 b->showTreeForThis(); | 356 b->showTreeForThis(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void showLineTree(const blink::InlineBox* b) | 359 void showLineTree(const blink::InlineBox* b) |
| 360 { | 360 { |
| 361 if (b) | 361 if (b) |
| 362 b->showLineTreeForThis(); | 362 b->showLineTreeForThis(); |
| 363 } | 363 } |
| 364 | 364 |
| 365 #endif | 365 #endif |
| OLD | NEW |