| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/editing/GranularityStrategy.h" | 5 #include "core/editing/GranularityStrategy.h" |
| 6 | 6 |
| 7 #include "core/editing/EditingUtilities.h" | 7 #include "core/editing/EditingUtilities.h" |
| 8 #include "core/editing/FrameSelection.h" | 8 #include "core/editing/FrameSelection.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 // Only update the state if the selection actually changed as a result of | 262 // Only update the state if the selection actually changed as a result of |
| 263 // this move. | 263 // this move. |
| 264 if (newSelectionExtent.deepEquivalent() != | 264 if (newSelectionExtent.deepEquivalent() != |
| 265 selection.visibleExtent().deepEquivalent()) | 265 selection.visibleExtent().deepEquivalent()) |
| 266 m_state = thisMoveShrunkSelection ? StrategyState::Shrinking | 266 m_state = thisMoveShrunkSelection ? StrategyState::Shrinking |
| 267 : StrategyState::Expanding; | 267 : StrategyState::Expanding; |
| 268 | 268 |
| 269 m_diffExtentPointFromExtentPosition = | 269 m_diffExtentPointFromExtentPosition = |
| 270 extentPoint + IntSize(m_offset, 0) - positionLocation(newSelectionExtent); | 270 extentPoint + IntSize(m_offset, 0) - positionLocation(newSelectionExtent); |
| 271 VisibleSelection newSelection = selection; | 271 return createVisibleSelection( |
| 272 newSelection.setExtent(newSelectionExtent); | 272 SelectionInDOMTree::Builder(selection.asSelection()) |
| 273 return newSelection; | 273 .collapse(selection.base()) |
| 274 .extend(newSelectionExtent.deepEquivalent()) |
| 275 .build()); |
| 274 } | 276 } |
| 275 | 277 |
| 276 } // namespace blink | 278 } // namespace blink |
| OLD | NEW |