| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/input/MouseEventManager.h" | 5 #include "core/input/MouseEventManager.h" |
| 6 | 6 |
| 7 #include "core/clipboard/DataObject.h" | 7 #include "core/clipboard/DataObject.h" |
| 8 #include "core/clipboard/DataTransfer.h" | 8 #include "core/clipboard/DataTransfer.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/ElementTraversal.h" | 10 #include "core/dom/ElementTraversal.h" |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 if (!layoutObject || !layoutObject->isListBox()) | 723 if (!layoutObject || !layoutObject->isListBox()) |
| 724 return WebInputEventResult::NotHandled; | 724 return WebInputEventResult::NotHandled; |
| 725 } | 725 } |
| 726 | 726 |
| 727 m_mouseDownMayStartDrag = false; | 727 m_mouseDownMayStartDrag = false; |
| 728 | 728 |
| 729 m_frame->eventHandler().selectionController().handleMouseDraggedEvent( | 729 m_frame->eventHandler().selectionController().handleMouseDraggedEvent( |
| 730 event, m_mouseDownPos, m_dragStartPos, m_mousePressNode.get(), | 730 event, m_mouseDownPos, m_dragStartPos, m_mousePressNode.get(), |
| 731 m_lastKnownMousePosition); | 731 m_lastKnownMousePosition); |
| 732 | 732 |
| 733 if (m_mouseDownMayStartAutoscroll && | 733 // The call into handleMouseDraggedEvent may have caused a re-layout, |
| 734 // so get the LayoutObject again. |
| 735 layoutObject = targetNode->layoutObject(); |
| 736 |
| 737 if (layoutObject && m_mouseDownMayStartAutoscroll && |
| 734 !m_scrollManager->middleClickAutoscrollInProgress() && | 738 !m_scrollManager->middleClickAutoscrollInProgress() && |
| 735 !m_frame->selection().selectedHTMLForClipboard().isEmpty()) { | 739 !m_frame->selection().selectedHTMLForClipboard().isEmpty()) { |
| 736 if (AutoscrollController* controller = | 740 if (AutoscrollController* controller = |
| 737 m_scrollManager->autoscrollController()) { | 741 m_scrollManager->autoscrollController()) { |
| 738 controller->startAutoscrollForSelection(layoutObject); | 742 controller->startAutoscrollForSelection(layoutObject); |
| 739 m_mouseDownMayStartAutoscroll = false; | 743 m_mouseDownMayStartAutoscroll = false; |
| 740 } | 744 } |
| 741 } | 745 } |
| 742 | 746 |
| 743 return WebInputEventResult::HandledSystem; | 747 return WebInputEventResult::HandledSystem; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 | 992 |
| 989 void MouseEventManager::setClickCount(int clickCount) { | 993 void MouseEventManager::setClickCount(int clickCount) { |
| 990 m_clickCount = clickCount; | 994 m_clickCount = clickCount; |
| 991 } | 995 } |
| 992 | 996 |
| 993 bool MouseEventManager::mouseDownMayStartDrag() { | 997 bool MouseEventManager::mouseDownMayStartDrag() { |
| 994 return m_mouseDownMayStartDrag; | 998 return m_mouseDownMayStartDrag; |
| 995 } | 999 } |
| 996 | 1000 |
| 997 } // namespace blink | 1001 } // namespace blink |
| OLD | NEW |