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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 return selectionTop; | 421 return selectionTop; |
422 } | 422 } |
423 | 423 |
424 return prevBottom; | 424 return prevBottom; |
425 } | 425 } |
426 | 426 |
427 LayoutUnit RootInlineBox::selectionTopAdjustedForPrecedingBlock() const | 427 LayoutUnit RootInlineBox::selectionTopAdjustedForPrecedingBlock() const |
428 { | 428 { |
429 LayoutUnit top = selectionTop(); | 429 LayoutUnit top = selectionTop(); |
430 | 430 |
431 RenderObject::SelectionState blockSelectionState = root()->block().selection
State(); | 431 RenderObject::SelectionState blockSelectionState = root().block().selectionS
tate(); |
432 if (blockSelectionState != RenderObject::SelectionInside && blockSelectionSt
ate != RenderObject::SelectionEnd) | 432 if (blockSelectionState != RenderObject::SelectionInside && blockSelectionSt
ate != RenderObject::SelectionEnd) |
433 return top; | 433 return top; |
434 | 434 |
435 LayoutSize offsetToBlockBefore; | 435 LayoutSize offsetToBlockBefore; |
436 if (RenderBlock* block = root()->block().blockBeforeWithinSelectionRoot(offs
etToBlockBefore)) { | 436 if (RenderBlock* block = root().block().blockBeforeWithinSelectionRoot(offse
tToBlockBefore)) { |
437 if (RootInlineBox* lastLine = block->lastRootBox()) { | 437 if (RootInlineBox* lastLine = block->lastRootBox()) { |
438 RenderObject::SelectionState lastLineSelectionState = lastLine->sele
ctionState(); | 438 RenderObject::SelectionState lastLineSelectionState = lastLine->sele
ctionState(); |
439 if (lastLineSelectionState != RenderObject::SelectionInside && lastL
ineSelectionState != RenderObject::SelectionStart) | 439 if (lastLineSelectionState != RenderObject::SelectionInside && lastL
ineSelectionState != RenderObject::SelectionStart) |
440 return top; | 440 return top; |
441 | 441 |
442 LayoutUnit lastLineSelectionBottom = lastLine->selectionBottom() + o
ffsetToBlockBefore.height(); | 442 LayoutUnit lastLineSelectionBottom = lastLine->selectionBottom() + o
ffsetToBlockBefore.height(); |
443 top = max(top, lastLineSelectionBottom); | 443 top = max(top, lastLineSelectionBottom); |
444 } | 444 } |
445 } | 445 } |
446 | 446 |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 } | 871 } |
872 | 872 |
873 #ifndef NDEBUG | 873 #ifndef NDEBUG |
874 const char* RootInlineBox::boxName() const | 874 const char* RootInlineBox::boxName() const |
875 { | 875 { |
876 return "RootInlineBox"; | 876 return "RootInlineBox"; |
877 } | 877 } |
878 #endif | 878 #endif |
879 | 879 |
880 } // namespace WebCore | 880 } // namespace WebCore |
OLD | NEW |