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

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

Issue 1824733006: Suppress mouseup/down when button is NoButton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to HandledSuppressed Created 4 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 | « no previous file | 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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 FrameView* view = frame->view(); 970 FrameView* view = frame->view();
971 // FIXME: Is it really OK to use the wrong coordinates here when view is 0? 971 // FIXME: Is it really OK to use the wrong coordinates here when view is 0?
972 // Historically the code would just crash; this is clearly no worse than tha t. 972 // Historically the code would just crash; this is clearly no worse than tha t.
973 return view ? view->rootFrameToContents(pointInRootFrame) : pointInRootFrame ; 973 return view ? view->rootFrameToContents(pointInRootFrame) : pointInRootFrame ;
974 } 974 }
975 975
976 WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent & mouseEvent) 976 WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent & mouseEvent)
977 { 977 {
978 TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent"); 978 TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent");
979 979
980 // For 4th/5th button in the mouse since Chrome does not yet send
981 // button value to Blink but in some cases it does send the event.
982 // This check is needed to suppress such an event (crbug.com/574959)
983 if (mouseEvent.button() == NoButton)
984 return WebInputEventResult::HandledSuppressed;
985
980 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view()); 986 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
981 987
982 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 988 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
983 m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToken = gestureIndicator.currentToken(); 989 m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToken = gestureIndicator.currentToken();
984 990
985 cancelFakeMouseMoveEvent(); 991 cancelFakeMouseMoveEvent();
986 if (m_eventHandlerWillResetCapturingMouseEventsNode) 992 if (m_eventHandlerWillResetCapturingMouseEventsNode)
987 m_capturingMouseEventsNode = nullptr; 993 m_capturingMouseEventsNode = nullptr;
988 m_mousePressed = true; 994 m_mousePressed = true;
989 m_capturesDragging = true; 995 m_capturesDragging = true;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 if (node.isHTMLElement() && toHTMLElement(node).isInteractiveContent()) 1304 if (node.isHTMLElement() && toHTMLElement(node).isInteractiveContent())
1299 return nullptr; 1305 return nullptr;
1300 1306
1301 return FlatTreeTraversal::parent(node); 1307 return FlatTreeTraversal::parent(node);
1302 } 1308 }
1303 1309
1304 WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve nt& mouseEvent) 1310 WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve nt& mouseEvent)
1305 { 1311 {
1306 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent"); 1312 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent");
1307 1313
1314 // For 4th/5th button in the mouse since Chrome does not yet send
1315 // button value to Blink but in some cases it does send the event.
1316 // This check is needed to suppress such an event (crbug.com/574959)
1317 if (mouseEvent.button() == NoButton)
1318 return WebInputEventResult::HandledSuppressed;
1319
1308 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view()); 1320 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
1309 1321
1310 m_frame->selection().setCaretBlinkingSuspended(false); 1322 m_frame->selection().setCaretBlinkingSuspended(false);
1311 1323
1312 OwnPtr<UserGestureIndicator> gestureIndicator; 1324 OwnPtr<UserGestureIndicator> gestureIndicator;
1313 1325
1314 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n) 1326 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n)
1315 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame Root()->eventHandler().m_lastMouseDownUserGestureToken.release())); 1327 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame Root()->eventHandler().m_lastMouseDownUserGestureToken.release()));
1316 else 1328 else
1317 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gUserGesture)); 1329 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gUserGesture));
(...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after
3973 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 3985 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
3974 { 3986 {
3975 #if OS(MACOSX) 3987 #if OS(MACOSX)
3976 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 3988 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
3977 #else 3989 #else
3978 return PlatformEvent::AltKey; 3990 return PlatformEvent::AltKey;
3979 #endif 3991 #endif
3980 } 3992 }
3981 3993
3982 } // namespace blink 3994 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698