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

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

Issue 2469863003: Delegate dragend to the correct frame's EventHandler. (Closed)
Patch Set: Make tests pass again. Created 4 years, 1 month 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
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 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 return m_keyboardEventManager->keyEvent(initialKeyEvent); 1960 return m_keyboardEventManager->keyEvent(initialKeyEvent);
1961 } 1961 }
1962 1962
1963 void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event) { 1963 void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event) {
1964 m_keyboardEventManager->defaultKeyboardEventHandler( 1964 m_keyboardEventManager->defaultKeyboardEventHandler(
1965 event, m_mouseEventManager->mousePressNode()); 1965 event, m_mouseEventManager->mousePressNode());
1966 } 1966 }
1967 1967
1968 void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event, 1968 void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event,
1969 DragOperation operation) { 1969 DragOperation operation) {
1970 m_mouseEventManager->dragSourceEndedAt(event, operation); 1970 HitTestRequest request(HitTestRequest::ReadOnly);
1971 MouseEventWithHitTestResults mev =
1972 EventHandlingUtil::performMouseEventHitTest(m_frame, request, event);
1973
1974 LocalFrame* targetFrame;
1975 if (targetIsFrame(mev.innerNode(), targetFrame))
1976 targetFrame->eventHandler().dragSourceEndedAt(event, operation);
dcheng 2016/11/03 03:09:59 Specifically, null-checking targetFrame here fixes
1977 else
1978 m_mouseEventManager->dragSourceEndedAt(event, operation);
1971 } 1979 }
1972 1980
1973 void EventHandler::updateDragStateAfterEditDragIfNeeded( 1981 void EventHandler::updateDragStateAfterEditDragIfNeeded(
1974 Element* rootEditableElement) { 1982 Element* rootEditableElement) {
1975 // If inserting the dragged contents removed the drag source, we still want to 1983 // If inserting the dragged contents removed the drag source, we still want to
1976 // fire dragend at the root editble element. 1984 // fire dragend at the root editble element.
1977 if (m_mouseEventManager->dragState().m_dragSrc && 1985 if (m_mouseEventManager->dragState().m_dragSrc &&
1978 !m_mouseEventManager->dragState().m_dragSrc->isConnected()) 1986 !m_mouseEventManager->dragState().m_dragSrc->isConnected())
1979 m_mouseEventManager->dragState().m_dragSrc = rootEditableElement; 1987 m_mouseEventManager->dragState().m_dragSrc = rootEditableElement;
1980 } 1988 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 } 2094 }
2087 2095
2088 FrameHost* EventHandler::frameHost() const { 2096 FrameHost* EventHandler::frameHost() const {
2089 if (!m_frame->page()) 2097 if (!m_frame->page())
2090 return nullptr; 2098 return nullptr;
2091 2099
2092 return &m_frame->page()->frameHost(); 2100 return &m_frame->page()->frameHost();
2093 } 2101 }
2094 2102
2095 } // namespace blink 2103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698