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

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

Issue 2049323002: [Mac] Don't dispatch wheel events for PhaseMayBegin|Cancelled|Ended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use == instead of strcmp() Created 4 years, 5 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 | « third_party/WebKit/LayoutTests/fast/events/mouse-wheel-main-frame-event.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 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided. 1586 // Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided.
1587 found->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTy peForward, nullptr)); 1587 found->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTy peForward, nullptr));
1588 return true; 1588 return true;
1589 } 1589 }
1590 } 1590 }
1591 return false; 1591 return false;
1592 } 1592 }
1593 1593
1594 WebInputEventResult EventHandler::handleWheelEvent(const PlatformWheelEvent& eve nt) 1594 WebInputEventResult EventHandler::handleWheelEvent(const PlatformWheelEvent& eve nt)
1595 { 1595 {
1596 #if OS(MACOSX)
1597 // Filter Mac OS specific phases, usually with a zero-delta.
1598 // https://crbug.com/553732
1599 // TODO(chongz): EventSender sends events with |PlatformWheelEventPhaseNone| , but it shouldn't.
1600 const int kPlatformWheelEventPhaseNoEventMask = PlatformWheelEventPhaseEnded | PlatformWheelEventPhaseCancelled | PlatformWheelEventPhaseMayBegin;
1601 if ((event.phase() & kPlatformWheelEventPhaseNoEventMask) || (event.momentum Phase() & kPlatformWheelEventPhaseNoEventMask))
1602 return WebInputEventResult::NotHandled;
1603 #endif
1596 Document* doc = m_frame->document(); 1604 Document* doc = m_frame->document();
1597 1605
1598 if (doc->layoutViewItem().isNull()) 1606 if (doc->layoutViewItem().isNull())
1599 return WebInputEventResult::NotHandled; 1607 return WebInputEventResult::NotHandled;
1600 1608
1601 FrameView* view = m_frame->view(); 1609 FrameView* view = m_frame->view();
1602 if (!view) 1610 if (!view)
1603 return WebInputEventResult::NotHandled; 1611 return WebInputEventResult::NotHandled;
1604 1612
1605 LayoutPoint vPoint = view->rootFrameToContents(event.position()); 1613 LayoutPoint vPoint = view->rootFrameToContents(event.position());
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2839 2847
2840 FrameHost* EventHandler::frameHost() const 2848 FrameHost* EventHandler::frameHost() const
2841 { 2849 {
2842 if (!m_frame->page()) 2850 if (!m_frame->page())
2843 return nullptr; 2851 return nullptr;
2844 2852
2845 return &m_frame->page()->frameHost(); 2853 return &m_frame->page()->frameHost();
2846 } 2854 }
2847 2855
2848 } // namespace blink 2856 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/mouse-wheel-main-frame-event.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698