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

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

Issue 705733002: Make sure that selection is cleared after tapping. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 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 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after
2256 m_clickNode = currentHitTest.innerNode(); 2256 m_clickNode = currentHitTest.innerNode();
2257 if (m_clickNode && m_clickNode->isTextNode()) 2257 if (m_clickNode && m_clickNode->isTextNode())
2258 m_clickNode = NodeRenderingTraversal::parent(m_clickNode.get()); 2258 m_clickNode = NodeRenderingTraversal::parent(m_clickNode.get());
2259 2259
2260 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(), 2260 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(),
2261 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), 2261 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(),
2262 modifiers, PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); 2262 modifiers, PlatformMouseEvent::FromTouch, gestureEvent.timestamp());
2263 bool swallowMouseDownEvent = !dispatchMouseEvent(EventTypeNames::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown, true); 2263 bool swallowMouseDownEvent = !dispatchMouseEvent(EventTypeNames::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown, true);
2264 if (!swallowMouseDownEvent) 2264 if (!swallowMouseDownEvent)
2265 swallowMouseDownEvent = handleMouseFocus(MouseEventWithHitTestResults(fa keMouseDown, currentHitTest)); 2265 swallowMouseDownEvent = handleMouseFocus(MouseEventWithHitTestResults(fa keMouseDown, currentHitTest));
2266 if (!swallowMouseDownEvent) 2266 if (!swallowMouseDownEvent) {
2267 swallowMouseDownEvent = handleMousePressEvent(MouseEventWithHitTestResul ts(fakeMouseDown, currentHitTest)); 2267 swallowMouseDownEvent = handleMousePressEvent(MouseEventWithHitTestResul ts(fakeMouseDown, currentHitTest));
2268 // m_selectionInitiationState is initialized after dispatching mousedown event.
2269 m_selectionInitiationState = HaveNotStartedSelection;
2270 }
2268 2271
2269 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 2272 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920
2270 if (currentHitTest.innerNode()) 2273 if (currentHitTest.innerNode())
2271 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); 2274 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType);
2272 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), 2275 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(),
2273 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), 2276 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(),
2274 modifiers, PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); 2277 modifiers, PlatformMouseEvent::FromTouch, gestureEvent.timestamp());
2275 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false); 2278 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false);
2276 2279
2277 bool swallowClickEvent = false; 2280 bool swallowClickEvent = false;
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 unsigned EventHandler::accessKeyModifiers() 3869 unsigned EventHandler::accessKeyModifiers()
3867 { 3870 {
3868 #if OS(MACOSX) 3871 #if OS(MACOSX)
3869 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3872 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3870 #else 3873 #else
3871 return PlatformEvent::AltKey; 3874 return PlatformEvent::AltKey;
3872 #endif 3875 #endif
3873 } 3876 }
3874 3877
3875 } // namespace blink 3878 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698