| 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 | 715 |
| 716 LayoutObject* o = start; | 716 LayoutObject* o = start; |
| 717 stop = layoutObjectAfterPosition(end, endPos); | 717 stop = layoutObjectAfterPosition(end, endPos); |
| 718 | 718 |
| 719 while (o && o != stop) { | 719 while (o && o != stop) { |
| 720 if (o != start && o != end && o->canBeSelectionLeaf()) | 720 if (o != start && o != end && o->canBeSelectionLeaf()) |
| 721 o->setSelectionStateIfNeeded(SelectionInside); | 721 o->setSelectionStateIfNeeded(SelectionInside); |
| 722 o = o->nextInPreOrder(); | 722 o = o->nextInPreOrder(); |
| 723 } | 723 } |
| 724 | 724 |
| 725 layer()->clearBlockSelectionGapsBounds(); | |
| 726 | |
| 727 // Now that the selection state has been updated for the new objects, walk t
hem again and | 725 // Now that the selection state has been updated for the new objects, walk t
hem again and |
| 728 // put them in the new objects list. | 726 // put them in the new objects list. |
| 729 o = start; | 727 o = start; |
| 730 exploringBackwards = false; | 728 exploringBackwards = false; |
| 731 continueExploring = o && (o != stop); | 729 continueExploring = o && (o != stop); |
| 732 while (continueExploring) { | 730 while (continueExploring) { |
| 733 if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionS
tate() != SelectionNone) { | 731 if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionS
tate() != SelectionNone) { |
| 734 newSelectedObjects.set(o, o->selectionState()); | 732 newSelectedObjects.set(o, o->selectionState()); |
| 735 LayoutBlock* cb = o->containingBlock(); | 733 LayoutBlock* cb = o->containingBlock(); |
| 736 while (cb && !cb->isLayoutView()) { | 734 while (cb && !cb->isLayoutView()) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 for (SelectedBlockMap::iterator i = newSelectedBlocks.begin(); i != newBlock
sEnd; ++i) | 780 for (SelectedBlockMap::iterator i = newSelectedBlocks.begin(); i != newBlock
sEnd; ++i) |
| 783 i->key->setShouldInvalidateSelection(); | 781 i->key->setShouldInvalidateSelection(); |
| 784 } | 782 } |
| 785 | 783 |
| 786 void LayoutView::clearSelection() | 784 void LayoutView::clearSelection() |
| 787 { | 785 { |
| 788 // For querying Layer::compositingState() | 786 // For querying Layer::compositingState() |
| 789 // This is correct, since destroying layout objects needs to cause eager pai
nt invalidations. | 787 // This is correct, since destroying layout objects needs to cause eager pai
nt invalidations. |
| 790 DisableCompositingQueryAsserts disabler; | 788 DisableCompositingQueryAsserts disabler; |
| 791 | 789 |
| 792 layer()->invalidatePaintForBlockSelectionGaps(); | |
| 793 setSelection(0, -1, 0, -1, PaintInvalidationNewMinusOld); | 790 setSelection(0, -1, 0, -1, PaintInvalidationNewMinusOld); |
| 794 } | 791 } |
| 795 | 792 |
| 796 bool LayoutView::hasPendingSelection() const | 793 bool LayoutView::hasPendingSelection() const |
| 797 { | 794 { |
| 798 return m_frameView->frame().selection().isAppearanceDirty(); | 795 return m_frameView->frame().selection().isAppearanceDirty(); |
| 799 } | 796 } |
| 800 | 797 |
| 801 void LayoutView::commitPendingSelection() | 798 void LayoutView::commitPendingSelection() |
| 802 { | 799 { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 } | 988 } |
| 992 | 989 |
| 993 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect
) | 990 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect
) |
| 994 { | 991 { |
| 995 for (auto& media : m_mediaForPositionNotification) { | 992 for (auto& media : m_mediaForPositionNotification) { |
| 996 media->notifyPositionMayHaveChanged(visibleRect); | 993 media->notifyPositionMayHaveChanged(visibleRect); |
| 997 } | 994 } |
| 998 } | 995 } |
| 999 | 996 |
| 1000 } // namespace blink | 997 } // namespace blink |
| OLD | NEW |