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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 14598021: Correct the (x, y) position of dragstart event initiated by touch event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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 | « LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag.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 /* 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 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 bool EventHandler::handleGestureLongPress(const PlatformGestureEvent& gestureEve nt) 2396 bool EventHandler::handleGestureLongPress(const PlatformGestureEvent& gestureEve nt)
2397 { 2397 {
2398 IntPoint adjustedPoint = gestureEvent.position(); 2398 IntPoint adjustedPoint = gestureEvent.position();
2399 adjustGesturePosition(gestureEvent, adjustedPoint); 2399 adjustGesturePosition(gestureEvent, adjustedPoint);
2400 RefPtr<Frame> subframe = getSubFrameForGestureEvent(adjustedPoint, gestureEv ent); 2400 RefPtr<Frame> subframe = getSubFrameForGestureEvent(adjustedPoint, gestureEv ent);
2401 if (subframe && subframe->eventHandler()->handleGestureLongPress(gestureEven t)) 2401 if (subframe && subframe->eventHandler()->handleGestureLongPress(gestureEven t))
2402 return true; 2402 return true;
2403 2403
2404 m_longTapShouldInvokeContextMenu = false; 2404 m_longTapShouldInvokeContextMenu = false;
2405 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) { 2405 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) {
2406 PlatformMouseEvent mouseDownEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MousePressed, 1,
2407 gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey (), gestureEvent.metaKey(), WTF::currentTime());
2408 m_mouseDown = mouseDownEvent;
2409
2406 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1, 2410 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1,
2407 gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey (), gestureEvent.metaKey(), WTF::currentTime()); 2411 gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey (), gestureEvent.metaKey(), WTF::currentTime());
2408 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Disall owShadowContent); 2412 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Disall owShadowContent);
2409 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent); 2413 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent);
2410 m_didStartDrag = false; 2414 m_didStartDrag = false;
2411 m_mouseDownMayStartDrag = true; 2415 m_mouseDownMayStartDrag = true;
2412 dragState().m_dragSrc = 0; 2416 dragState().m_dragSrc = 0;
2413 m_mouseDownPos = m_frame->view()->windowToContents(mouseDragEvent.positi on()); 2417 m_mouseDownPos = m_frame->view()->windowToContents(mouseDragEvent.positi on());
2414 handleDrag(mev, DontCheckDragHysteresis); 2418 handleDrag(mev, DontCheckDragHysteresis);
2415 if (m_didStartDrag) { 2419 if (m_didStartDrag) {
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
3920 unsigned EventHandler::accessKeyModifiers() 3924 unsigned EventHandler::accessKeyModifiers()
3921 { 3925 {
3922 #if OS(DARWIN) 3926 #if OS(DARWIN)
3923 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3927 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3924 #else 3928 #else
3925 return PlatformEvent::AltKey; 3929 return PlatformEvent::AltKey;
3926 #endif 3930 #endif
3927 } 3931 }
3928 3932
3929 } // namespace WebCore 3933 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698