| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 return lineBottom; | 248 return lineBottom; |
| 249 } | 249 } |
| 250 LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott
om) const | 250 LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott
om) const |
| 251 { | 251 { |
| 252 LayoutRect result = visualOverflowRect(lineTop, lineBottom); | 252 LayoutRect result = visualOverflowRect(lineTop, lineBottom); |
| 253 if (!lineLayoutItem().isHorizontalWritingMode()) | 253 if (!lineLayoutItem().isHorizontalWritingMode()) |
| 254 result = result.transposedRect(); | 254 result = result.transposedRect(); |
| 255 return result; | 255 return result; |
| 256 } | 256 } |
| 257 | 257 |
| 258 void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, co
nst LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom
); | |
| 259 | |
| 260 LayoutRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineB
ottom) const | 258 LayoutRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineB
ottom) const |
| 261 { | 259 { |
| 262 if (isHorizontal()) | 260 if (isHorizontal()) |
| 263 return LayoutRect(m_topLeft.x(), lineTop, width(), lineBottom - line
Top); | 261 return LayoutRect(m_topLeft.x(), lineTop, width(), lineBottom - line
Top); |
| 264 return LayoutRect(lineTop, m_topLeft.y(), lineBottom - lineTop, height()
); | 262 return LayoutRect(lineTop, m_topLeft.y(), lineBottom - lineTop, height()
); |
| 265 } | 263 } |
| 266 | 264 |
| 267 LayoutRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUni
t lineBottom) const | 265 LayoutRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUni
t lineBottom) const |
| 268 { | 266 { |
| 269 return LayoutRect(logicalLeft(), lineTop, logicalWidth(), lineBottom - l
ineTop); | 267 return LayoutRect(logicalLeft(), lineTop, logicalWidth(), lineBottom - l
ineTop); |
| 270 } | 268 } |
| 271 | 269 |
| 272 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants
HaveSameLineHeightAndBaseline; } | 270 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants
HaveSameLineHeightAndBaseline; } |
| 273 void clearDescendantsHaveSameLineHeightAndBaseline() | 271 void clearDescendantsHaveSameLineHeightAndBaseline() |
| 274 { | 272 { |
| 275 m_descendantsHaveSameLineHeightAndBaseline = false; | 273 m_descendantsHaveSameLineHeightAndBaseline = false; |
| 276 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) | 274 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) |
| 277 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); | 275 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); |
| 278 } | 276 } |
| 279 | 277 |
| 280 bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; } | 278 bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; } |
| 281 void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { m_isFirstAfterPa
geBreak = isFirstAfterPageBreak; } | 279 void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { m_isFirstAfterPa
geBreak = isFirstAfterPageBreak; } |
| 282 | 280 |
| 281 // Some callers (LayoutListItem) needs to set extra overflow on their line b
ox. |
| 282 void overrideOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflo
w, const LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineB
ottom) |
| 283 { |
| 284 // If we are setting an overflow, then we can't pretend not to have an o
verflow. |
| 285 clearKnownToHaveNoOverflow(); |
| 286 setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow
, lineTop, lineBottom); |
| 287 } |
| 288 |
| 283 private: | 289 private: |
| 284 void placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastCh
ild, | 290 void placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastCh
ild, |
| 285 LayoutUnit& logicalLeft, LayoutUnit& minLogicalLeft, LayoutUnit& maxLogi
calRight, bool& needsWordSpacing); | 291 LayoutUnit& logicalLeft, LayoutUnit& minLogicalLeft, LayoutUnit& maxLogi
calRight, bool& needsWordSpacing); |
| 286 void beginPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft) { setLog
icalLeft(logicalLeft); } | 292 void beginPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft) { setLog
icalLeft(logicalLeft); } |
| 287 void endPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft, LayoutUnit
logicalRight, LayoutUnit minLogicalLeft, LayoutUnit maxLogicalRight) | 293 void endPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft, LayoutUnit
logicalRight, LayoutUnit minLogicalLeft, LayoutUnit maxLogicalRight) |
| 288 { | 294 { |
| 289 setLogicalWidth(logicalRight - logicalLeft); | 295 setLogicalWidth(logicalRight - logicalLeft); |
| 290 if (knownToHaveNoOverflow() && (minLogicalLeft < logicalLeft || maxLogic
alRight > logicalRight)) | 296 if (knownToHaveNoOverflow() && (minLogicalLeft < logicalLeft || maxLogic
alRight > logicalRight)) |
| 291 clearKnownToHaveNoOverflow(); | 297 clearKnownToHaveNoOverflow(); |
| 292 } | 298 } |
| 293 | 299 |
| 294 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); | 300 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); |
| 295 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); | 301 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); |
| 296 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); | 302 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); |
| 297 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM
ap&, LayoutRect& logicalVisualOverflow); | 303 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM
ap&, LayoutRect& logicalVisualOverflow); |
| 298 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve
rflow, LayoutRect& logicalVisualOverflow); | 304 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve
rflow, LayoutRect& logicalVisualOverflow); |
| 299 | 305 |
| 300 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); | 306 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); |
| 301 void setVisualOverflow(const LayoutRect&, const LayoutRect&); | 307 void setVisualOverflow(const LayoutRect&, const LayoutRect&); |
| 302 | 308 |
| 309 void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, co
nst LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom
); |
| 310 |
| 303 protected: | 311 protected: |
| 304 OwnPtr<OverflowModel> m_overflow; | 312 OwnPtr<OverflowModel> m_overflow; |
| 305 | 313 |
| 306 bool isInlineFlowBox() const final { return true; } | 314 bool isInlineFlowBox() const final { return true; } |
| 307 | 315 |
| 308 InlineBox* m_firstChild; | 316 InlineBox* m_firstChild; |
| 309 InlineBox* m_lastChild; | 317 InlineBox* m_lastChild; |
| 310 | 318 |
| 311 InlineFlowBox* m_prevLineBox; // The previous box that also uses our LayoutO
bject | 319 InlineFlowBox* m_prevLineBox; // The previous box that also uses our LayoutO
bject |
| 312 InlineFlowBox* m_nextLineBox; // The next box that also uses our LayoutObjec
t | 320 InlineFlowBox* m_nextLineBox; // The next box that also uses our LayoutObjec
t |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 370 } |
| 363 | 371 |
| 364 } // namespace blink | 372 } // namespace blink |
| 365 | 373 |
| 366 #ifndef NDEBUG | 374 #ifndef NDEBUG |
| 367 // Outside the WebCore namespace for ease of invocation from gdb. | 375 // Outside the WebCore namespace for ease of invocation from gdb. |
| 368 void showTree(const blink::InlineFlowBox*); | 376 void showTree(const blink::InlineFlowBox*); |
| 369 #endif | 377 #endif |
| 370 | 378 |
| 371 #endif // InlineFlowBox_h | 379 #endif // InlineFlowBox_h |
| OLD | NEW |