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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2471843005: Delegate dragend to the correct frame's EventHandler. (Closed)
Patch Set: The LSAN-reported leak was actually a failure to reset the drag state in MouseEventHandler. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index a40a5bc065dff8cd721b95a119fcf4bc36e0dad3..ebf0f6bf20e7194bf30fd532563885dad1344a7f 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -1967,6 +1967,20 @@ void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event) {
void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event,
DragOperation operation) {
+ // Asides from routing the event to the correct frame, the hit test is also an
Navid Zolghadr 2016/11/04 15:29:06 Can we have this whole block of code in MouseEvent
pwnall 2016/11/04 18:24:29 This kind of code also exists in EventHandler::upd
Navid Zolghadr 2016/11/04 18:33:22 MouseEventManager was intended to contain this and
pwnall 2016/11/04 22:40:39 Thank you very much for understanding! This is a
+ // opportunity for Layer to update the :hover and :active pseudoclasses.
+ HitTestRequest request(HitTestRequest::Release);
+ MouseEventWithHitTestResults mev =
+ EventHandlingUtil::performMouseEventHitTest(m_frame, request, event);
+
+ LocalFrame* targetFrame;
+ if (targetIsFrame(mev.innerNode(), targetFrame)) {
+ if (targetFrame)
+ targetFrame->eventHandler().dragSourceEndedAt(event, operation);
+ }
+
+ // This has to be called even if the dragend event is fired in another frame,
+ // in order to clean up the event manager's drag state.
m_mouseEventManager->dragSourceEndedAt(event, operation);
dcheng 2016/11/04 15:12:15 Hmm... that means this actually gets called twice
pwnall 2016/11/04 18:24:29 I think that each LocalFrame (including subframes)
Navid Zolghadr 2016/11/04 18:33:22 that is correct. Each frame has its own EventHandl
pwnall 2016/11/04 22:40:39 Thank you very much for explaining! I put togethe
}

Powered by Google App Engine
This is Rietveld 408576698