OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 480 } |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
484 os = os->nextInPreOrder(); | 484 os = os->nextInPreOrder(); |
485 } | 485 } |
486 | 486 |
487 // Now clear the selection. | 487 // Now clear the selection. |
488 SelectedObjectMap::iterator oldObjectsEnd = oldSelectedObjects.end(); | 488 SelectedObjectMap::iterator oldObjectsEnd = oldSelectedObjects.end(); |
489 for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObj
ectsEnd; ++i) | 489 for (SelectedObjectMap::iterator i = oldSelectedObjects.begin(); i != oldObj
ectsEnd; ++i) |
490 i->first->setSelectionState(SelectionNone); | 490 i->first->setSelectionStateIfNeeded(SelectionNone); |
491 | 491 |
492 // set selection start and end | 492 // set selection start and end |
493 m_selectionStart = start; | 493 m_selectionStart = start; |
494 m_selectionStartPos = startPos; | 494 m_selectionStartPos = startPos; |
495 m_selectionEnd = end; | 495 m_selectionEnd = end; |
496 m_selectionEndPos = endPos; | 496 m_selectionEndPos = endPos; |
497 | 497 |
498 // Update the selection status of all objects between m_selectionStart and m
_selectionEnd | 498 // Update the selection status of all objects between m_selectionStart and m
_selectionEnd |
499 if (start && start == end) | 499 if (start && start == end) |
500 start->setSelectionState(SelectionBoth); | 500 start->setSelectionStateIfNeeded(SelectionBoth); |
501 else { | 501 else { |
502 if (start) | 502 if (start) |
503 start->setSelectionState(SelectionStart); | 503 start->setSelectionStateIfNeeded(SelectionStart); |
504 if (end) | 504 if (end) |
505 end->setSelectionState(SelectionEnd); | 505 end->setSelectionStateIfNeeded(SelectionEnd); |
506 } | 506 } |
507 | 507 |
508 RenderObject* o = start; | 508 RenderObject* o = start; |
509 stop = rendererAfterPosition(end, endPos); | 509 stop = rendererAfterPosition(end, endPos); |
510 | 510 |
511 while (o && o != stop) { | 511 while (o && o != stop) { |
512 if (o != start && o != end && o->canBeSelectionLeaf()) | 512 if (o != start && o != end && o->canBeSelectionLeaf()) |
513 o->setSelectionState(SelectionInside); | 513 o->setSelectionStateIfNeeded(SelectionInside); |
514 o = o->nextInPreOrder(); | 514 o = o->nextInPreOrder(); |
515 } | 515 } |
516 | 516 |
517 if (blockRepaintMode != RepaintNothing) | 517 if (blockRepaintMode != RepaintNothing) |
518 m_layer->clearBlockSelectionGapsBounds(); | 518 m_layer->clearBlockSelectionGapsBounds(); |
519 | 519 |
520 // Now that the selection state has been updated for the new objects, walk t
hem again and | 520 // Now that the selection state has been updated for the new objects, walk t
hem again and |
521 // put them in the new objects list. | 521 // put them in the new objects list. |
522 o = start; | 522 o = start; |
523 while (o && o != stop) { | 523 while (o && o != stop) { |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 setIsRenderFlowThreadOrderDirty(false); | 918 setIsRenderFlowThreadOrderDirty(false); |
919 } | 919 } |
920 | 920 |
921 for (RenderFlowThreadList::iterator iter = m_renderFlowThreadList->begin();
iter != m_renderFlowThreadList->end(); ++iter) { | 921 for (RenderFlowThreadList::iterator iter = m_renderFlowThreadList->begin();
iter != m_renderFlowThreadList->end(); ++iter) { |
922 RenderFlowThread* flowRenderer = *iter; | 922 RenderFlowThread* flowRenderer = *iter; |
923 flowRenderer->layoutIfNeeded(); | 923 flowRenderer->layoutIfNeeded(); |
924 } | 924 } |
925 } | 925 } |
926 | 926 |
927 } // namespace WebCore | 927 } // namespace WebCore |
OLD | NEW |