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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 selectionTop -= !lineLayoutItem().style()->isFlippedLinesWritingMode() ?
computeOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m
_lineTop); | 382 selectionTop -= !lineLayoutItem().style()->isFlippedLinesWritingMode() ?
computeOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m
_lineTop); |
383 | 383 |
384 if (lineLayoutItem().style()->isFlippedLinesWritingMode() || !prevRootBox()) | 384 if (lineLayoutItem().style()->isFlippedLinesWritingMode() || !prevRootBox()) |
385 return selectionTop; | 385 return selectionTop; |
386 | 386 |
387 LayoutUnit prevBottom = prevRootBox()->selectionBottom(); | 387 LayoutUnit prevBottom = prevRootBox()->selectionBottom(); |
388 if (prevBottom < selectionTop && block().containsFloats()) { | 388 if (prevBottom < selectionTop && block().containsFloats()) { |
389 // This line has actually been moved further down, probably from a large
line-height, but possibly because the | 389 // This line has actually been moved further down, probably from a large
line-height, but possibly because the |
390 // line was forced to clear floats. If so, let's check the offsets, and
only be willing to use the previous | 390 // line was forced to clear floats. If so, let's check the offsets, and
only be willing to use the previous |
391 // line's bottom if the offsets are greater on both sides. | 391 // line's bottom if the offsets are greater on both sides. |
392 LayoutUnit prevLeft = block().logicalLeftOffsetForLine(prevBottom, false
); | 392 LayoutUnit prevLeft = block().logicalLeftOffsetForLine(prevBottom, DoNot
IndentText); |
393 LayoutUnit prevRight = block().logicalRightOffsetForLine(prevBottom, fal
se); | 393 LayoutUnit prevRight = block().logicalRightOffsetForLine(prevBottom, DoN
otIndentText); |
394 LayoutUnit newLeft = block().logicalLeftOffsetForLine(selectionTop, fals
e); | 394 LayoutUnit newLeft = block().logicalLeftOffsetForLine(selectionTop, DoNo
tIndentText); |
395 LayoutUnit newRight = block().logicalRightOffsetForLine(selectionTop, fa
lse); | 395 LayoutUnit newRight = block().logicalRightOffsetForLine(selectionTop, Do
NotIndentText); |
396 if (prevLeft > newLeft || prevRight < newRight) | 396 if (prevLeft > newLeft || prevRight < newRight) |
397 return selectionTop; | 397 return selectionTop; |
398 } | 398 } |
399 | 399 |
400 return prevBottom; | 400 return prevBottom; |
401 } | 401 } |
402 | 402 |
403 LayoutUnit RootInlineBox::selectionTopAdjustedForPrecedingBlock() const | 403 LayoutUnit RootInlineBox::selectionTopAdjustedForPrecedingBlock() const |
404 { | 404 { |
405 LayoutUnit top = selectionTop(); | 405 LayoutUnit top = selectionTop(); |
(...skipping 27 matching lines...) Expand all Loading... |
433 selectionBottom += !lineLayoutItem().style()->isFlippedLinesWritingMode(
) ? computeUnderAnnotationAdjustment(m_lineBottom) : computeOverAnnotationAdjust
ment(m_lineBottom); | 433 selectionBottom += !lineLayoutItem().style()->isFlippedLinesWritingMode(
) ? computeUnderAnnotationAdjustment(m_lineBottom) : computeOverAnnotationAdjust
ment(m_lineBottom); |
434 | 434 |
435 if (!lineLayoutItem().style()->isFlippedLinesWritingMode() || !nextRootBox()
) | 435 if (!lineLayoutItem().style()->isFlippedLinesWritingMode() || !nextRootBox()
) |
436 return selectionBottom; | 436 return selectionBottom; |
437 | 437 |
438 LayoutUnit nextTop = nextRootBox()->selectionTop(); | 438 LayoutUnit nextTop = nextRootBox()->selectionTop(); |
439 if (nextTop > selectionBottom && block().containsFloats()) { | 439 if (nextTop > selectionBottom && block().containsFloats()) { |
440 // The next line has actually been moved further over, probably from a l
arge line-height, but possibly because the | 440 // The next line has actually been moved further over, probably from a l
arge line-height, but possibly because the |
441 // line was forced to clear floats. If so, let's check the offsets, and
only be willing to use the next | 441 // line was forced to clear floats. If so, let's check the offsets, and
only be willing to use the next |
442 // line's top if the offsets are greater on both sides. | 442 // line's top if the offsets are greater on both sides. |
443 LayoutUnit nextLeft = block().logicalLeftOffsetForLine(nextTop, false); | 443 LayoutUnit nextLeft = block().logicalLeftOffsetForLine(nextTop, DoNotInd
entText); |
444 LayoutUnit nextRight = block().logicalRightOffsetForLine(nextTop, false)
; | 444 LayoutUnit nextRight = block().logicalRightOffsetForLine(nextTop, DoNotI
ndentText); |
445 LayoutUnit newLeft = block().logicalLeftOffsetForLine(selectionBottom, f
alse); | 445 LayoutUnit newLeft = block().logicalLeftOffsetForLine(selectionBottom, D
oNotIndentText); |
446 LayoutUnit newRight = block().logicalRightOffsetForLine(selectionBottom,
false); | 446 LayoutUnit newRight = block().logicalRightOffsetForLine(selectionBottom,
DoNotIndentText); |
447 if (nextLeft > newLeft || nextRight < newRight) | 447 if (nextLeft > newLeft || nextRight < newRight) |
448 return selectionBottom; | 448 return selectionBottom; |
449 } | 449 } |
450 | 450 |
451 return nextTop; | 451 return nextTop; |
452 } | 452 } |
453 | 453 |
454 LayoutUnit RootInlineBox::blockDirectionPointInLine() const | 454 LayoutUnit RootInlineBox::blockDirectionPointInLine() const |
455 { | 455 { |
456 return !block().style()->isFlippedBlocksWritingMode() ? std::max(lineTop(),
selectionTop()) : std::min(lineBottom(), selectionBottom()); | 456 return !block().style()->isFlippedBlocksWritingMode() ? std::max(lineTop(),
selectionTop()) : std::min(lineBottom(), selectionBottom()); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 endBox = nullptr; | 753 endBox = nullptr; |
754 return nullptr; | 754 return nullptr; |
755 } | 755 } |
756 | 756 |
757 const char* RootInlineBox::boxName() const | 757 const char* RootInlineBox::boxName() const |
758 { | 758 { |
759 return "RootInlineBox"; | 759 return "RootInlineBox"; |
760 } | 760 } |
761 | 761 |
762 } // namespace blink | 762 } // namespace blink |
OLD | NEW |