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

Side by Side Diff: third_party/WebKit/Source/core/input/MouseEventManager.cpp

Issue 2759603002: Check detached status before attempting to clear drag transfer state (reland.) (Closed)
Patch Set: rebased upto r458127 Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/resources/iframe-drag-dragend-detaches.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 MouseEvent::webInputEventModifiersToButtons(event.modifiers()), nullptr, 938 MouseEvent::webInputEventModifiersToButtons(event.modifiers()), nullptr,
939 TimeTicks::FromSeconds(event.timeStampSeconds()), dataTransfer, 939 TimeTicks::FromSeconds(event.timeStampSeconds()), dataTransfer,
940 event.fromTouch() ? MouseEvent::FromTouch 940 event.fromTouch() ? MouseEvent::FromTouch
941 : MouseEvent::RealOrIndistinguishable); 941 : MouseEvent::RealOrIndistinguishable);
942 942
943 return EventHandlingUtil::toWebInputEventResult( 943 return EventHandlingUtil::toWebInputEventResult(
944 dragTarget->dispatchEvent(me)); 944 dragTarget->dispatchEvent(me));
945 } 945 }
946 946
947 void MouseEventManager::clearDragDataTransfer() { 947 void MouseEventManager::clearDragDataTransfer() {
948 if (!m_frame->page())
949 return;
948 if (dragState().m_dragDataTransfer) { 950 if (dragState().m_dragDataTransfer) {
949 dragState().m_dragDataTransfer->clearDragImage(); 951 dragState().m_dragDataTransfer->clearDragImage();
950 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb); 952 dragState().m_dragDataTransfer->setAccessPolicy(DataTransferNumb);
951 } 953 }
952 } 954 }
953 955
954 void MouseEventManager::dragSourceEndedAt(const WebMouseEvent& event, 956 void MouseEventManager::dragSourceEndedAt(const WebMouseEvent& event,
955 DragOperation operation) { 957 DragOperation operation) {
956 if (dragState().m_dragSrc) { 958 if (dragState().m_dragSrc) {
957 dragState().m_dragDataTransfer->setDestinationOperation(operation); 959 dragState().m_dragDataTransfer->setDestinationOperation(operation);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 1048
1047 void MouseEventManager::setClickCount(int clickCount) { 1049 void MouseEventManager::setClickCount(int clickCount) {
1048 m_clickCount = clickCount; 1050 m_clickCount = clickCount;
1049 } 1051 }
1050 1052
1051 bool MouseEventManager::mouseDownMayStartDrag() { 1053 bool MouseEventManager::mouseDownMayStartDrag() {
1052 return m_mouseDownMayStartDrag; 1054 return m_mouseDownMayStartDrag;
1053 } 1055 }
1054 1056
1055 } // namespace blink 1057 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/resources/iframe-drag-dragend-detaches.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698