| 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 |
| 4 * reserved. |
| 4 * | 5 * |
| 5 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 9 * | 10 * |
| 10 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 DCHECK(!layoutView.needsLayout()); | 101 DCHECK(!layoutView.needsLayout()); |
| 101 m_hasPendingSelection = false; | 102 m_hasPendingSelection = false; |
| 102 | 103 |
| 103 const VisibleSelectionInFlatTree& originalSelection = | 104 const VisibleSelectionInFlatTree& originalSelection = |
| 104 m_frameSelection->visibleSelection<EditingInFlatTreeStrategy>(); | 105 m_frameSelection->visibleSelection<EditingInFlatTreeStrategy>(); |
| 105 | 106 |
| 106 // Skip if pending VisibilePositions became invalid before we reach here. | 107 // Skip if pending VisibilePositions became invalid before we reach here. |
| 107 if (!isSelectionInDocument(originalSelection, layoutView.document())) | 108 if (!isSelectionInDocument(originalSelection, layoutView.document())) |
| 108 return; | 109 return; |
| 109 | 110 |
| 110 // Construct a new VisibleSolution, since visibleSelection() is not necessaril
y | 111 // Construct a new VisibleSolution, since visibleSelection() is not |
| 111 // valid, and the following steps assume a valid selection. | 112 // necessarily valid, and the following steps assume a valid selection. See |
| 112 // See <https://bugs.webkit.org/show_bug.cgi?id=69563> and | 113 // <https://bugs.webkit.org/show_bug.cgi?id=69563> and |
| 113 // <rdar://problem/10232866>. | 114 // <rdar://problem/10232866>. |
| 114 const VisibleSelectionInFlatTree& selection = | 115 const VisibleSelectionInFlatTree& selection = |
| 115 calcVisibleSelection(originalSelection); | 116 calcVisibleSelection(originalSelection); |
| 116 | 117 |
| 117 if (!selection.isRange()) { | 118 if (!selection.isRange()) { |
| 118 layoutView.clearSelection(); | 119 layoutView.clearSelection(); |
| 119 return; | 120 return; |
| 120 } | 121 } |
| 121 | 122 |
| 122 // Use the rightmost candidate for the start of the selection, and the | 123 // Use the rightmost candidate for the start of the selection, and the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 149 DCHECK(layoutView == endLayoutObject->view()); | 150 DCHECK(layoutView == endLayoutObject->view()); |
| 150 layoutView.setSelection(startLayoutObject, startPos.computeEditingOffset(), | 151 layoutView.setSelection(startLayoutObject, startPos.computeEditingOffset(), |
| 151 endLayoutObject, endPos.computeEditingOffset()); | 152 endLayoutObject, endPos.computeEditingOffset()); |
| 152 } | 153 } |
| 153 | 154 |
| 154 DEFINE_TRACE(PendingSelection) { | 155 DEFINE_TRACE(PendingSelection) { |
| 155 visitor->trace(m_frameSelection); | 156 visitor->trace(m_frameSelection); |
| 156 } | 157 } |
| 157 | 158 |
| 158 } // namespace blink | 159 } // namespace blink |
| OLD | NEW |