OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2008 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 return 0; | 396 return 0; |
397 } | 397 } |
398 | 398 |
399 LayoutUnit RootInlineBox::selectionTop() const | 399 LayoutUnit RootInlineBox::selectionTop() const |
400 { | 400 { |
401 LayoutUnit selectionTop = m_lineTop; | 401 LayoutUnit selectionTop = m_lineTop; |
402 | 402 |
403 if (m_hasAnnotationsBefore) | 403 if (m_hasAnnotationsBefore) |
404 selectionTop -= !renderer()->style()->isFlippedLinesWritingMode() ? comp
uteOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m_line
Top); | 404 selectionTop -= !renderer()->style()->isFlippedLinesWritingMode() ? comp
uteOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m_line
Top); |
405 | 405 |
406 if (renderer()->style()->isFlippedLinesWritingMode()) | 406 if (renderer()->style()->isFlippedLinesWritingMode() || !prevRootBox()) |
407 return selectionTop; | 407 return selectionTop; |
408 | 408 |
409 LayoutUnit prevBottom = prevRootBox() ? prevRootBox()->selectionBottom() : b
lock()->borderBefore() + block()->paddingBefore(); | 409 LayoutUnit prevBottom = prevRootBox()->selectionBottom(); |
410 if (prevBottom < selectionTop && block()->containsFloats()) { | 410 if (prevBottom < selectionTop && block()->containsFloats()) { |
411 // This line has actually been moved further down, probably from a large
line-height, but possibly because the | 411 // This line has actually been moved further down, probably from a large
line-height, but possibly because the |
412 // line was forced to clear floats. If so, let's check the offsets, and
only be willing to use the previous | 412 // line was forced to clear floats. If so, let's check the offsets, and
only be willing to use the previous |
413 // line's bottom if the offsets are greater on both sides. | 413 // line's bottom if the offsets are greater on both sides. |
414 LayoutUnit prevLeft = block()->logicalLeftOffsetForLine(prevBottom, fals
e); | 414 LayoutUnit prevLeft = block()->logicalLeftOffsetForLine(prevBottom, fals
e); |
415 LayoutUnit prevRight = block()->logicalRightOffsetForLine(prevBottom, fa
lse); | 415 LayoutUnit prevRight = block()->logicalRightOffsetForLine(prevBottom, fa
lse); |
416 LayoutUnit newLeft = block()->logicalLeftOffsetForLine(selectionTop, fal
se); | 416 LayoutUnit newLeft = block()->logicalLeftOffsetForLine(selectionTop, fal
se); |
417 LayoutUnit newRight = block()->logicalRightOffsetForLine(selectionTop, f
alse); | 417 LayoutUnit newRight = block()->logicalRightOffsetForLine(selectionTop, f
alse); |
418 if (prevLeft > newLeft || prevRight < newRight) | 418 if (prevLeft > newLeft || prevRight < newRight) |
419 return selectionTop; | 419 return selectionTop; |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 } | 869 } |
870 | 870 |
871 #ifndef NDEBUG | 871 #ifndef NDEBUG |
872 const char* RootInlineBox::boxName() const | 872 const char* RootInlineBox::boxName() const |
873 { | 873 { |
874 return "RootInlineBox"; | 874 return "RootInlineBox"; |
875 } | 875 } |
876 #endif | 876 #endif |
877 | 877 |
878 } // namespace WebCore | 878 } // namespace WebCore |
OLD | NEW |