Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2022723002: Move VisibleSelection::positionRespectingEditingBoundary() to EditingUtilities.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-30T17:10:26 Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * Copyright (C) 2015 Google Inc. All rights reserved. 5 * Copyright (C) 2015 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 void SelectionController::updateSelectionForMouseDrag(const HitTestResult& hitTe stResult, Node* mousePressNode, const LayoutPoint& dragStartPos, const IntPoint& lastKnownMousePosition) 191 void SelectionController::updateSelectionForMouseDrag(const HitTestResult& hitTe stResult, Node* mousePressNode, const LayoutPoint& dragStartPos, const IntPoint& lastKnownMousePosition)
192 { 192 {
193 if (!m_mouseDownMayStartSelect) 193 if (!m_mouseDownMayStartSelect)
194 return; 194 return;
195 195
196 Node* target = hitTestResult.innerNode(); 196 Node* target = hitTestResult.innerNode();
197 if (!target) 197 if (!target)
198 return; 198 return;
199 199
200 PositionWithAffinity rawTargetPosition = selection().selection().positionRes pectingEditingBoundary(hitTestResult.localPoint(), target); 200 const PositionWithAffinity& rawTargetPosition = positionRespectingEditingBou ndary(selection().selection().start(), hitTestResult.localPoint(), target);
201 VisiblePositionInFlatTree targetPosition = createVisiblePosition(fromPositio nInDOMTree<EditingInFlatTreeStrategy>(rawTargetPosition)); 201 VisiblePositionInFlatTree targetPosition = createVisiblePosition(fromPositio nInDOMTree<EditingInFlatTreeStrategy>(rawTargetPosition));
202 // Don't modify the selection if we're not on a node. 202 // Don't modify the selection if we're not on a node.
203 if (targetPosition.isNull()) 203 if (targetPosition.isNull())
204 return; 204 return;
205 205
206 // Restart the selection if this is the first mouse move. This work is usual ly 206 // Restart the selection if this is the first mouse move. This work is usual ly
207 // done in handleMousePressEvent, but not if the mouse press was on an exist ing selection. 207 // done in handleMousePressEvent, but not if the mouse press was on an exist ing selection.
208 VisibleSelectionInFlatTree newSelection = selection().visibleSelection<Editi ngInFlatTreeStrategy>(); 208 VisibleSelectionInFlatTree newSelection = selection().visibleSelection<Editi ngInFlatTreeStrategy>();
209 209
210 // Special case to limit selection to the containing block for SVG text. 210 // Special case to limit selection to the containing block for SVG text.
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 { 629 {
630 return m_frame->selection(); 630 return m_frame->selection();
631 } 631 }
632 632
633 bool isLinkSelection(const MouseEventWithHitTestResults& event) 633 bool isLinkSelection(const MouseEventWithHitTestResults& event)
634 { 634 {
635 return event.event().altKey() && event.isOverLink(); 635 return event.event().altKey() && event.isOverLink();
636 } 636 }
637 637
638 } // namespace blink 638 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingUtilities.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698