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

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

Issue 768443002: Honor the wheel event canScroll bit instead of trying to infer it from the ctrl modifier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
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 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 2055
2056 return false; 2056 return false;
2057 #undef RETURN_WHEEL_EVENT_HANDLED 2057 #undef RETURN_WHEEL_EVENT_HANDLED
2058 } 2058 }
2059 2059
2060 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent) 2060 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent)
2061 { 2061 {
2062 if (!startNode || !wheelEvent) 2062 if (!startNode || !wheelEvent)
2063 return; 2063 return;
2064 2064
2065 // Ctrl + scrollwheel is reserved for triggering zoom in/out actions in Chro mium. 2065 // When the wheelEvent do not scroll, we trigger zoom in/out instead.
2066 if (wheelEvent->ctrlKey()) 2066 if (!wheelEvent->canScroll())
2067 return; 2067 return;
2068 2068
2069 Node* stopNode = m_previousWheelScrolledNode.get(); 2069 Node* stopNode = m_previousWheelScrolledNode.get();
2070 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt); 2070 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt);
2071 2071
2072 // Break up into two scrolls if we need to. Diagonal movement on 2072 // Break up into two scrolls if we need to. Diagonal movement on
2073 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set). 2073 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set).
2074 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta X(), roundedIntPoint(wheelEvent->absoluteLocation()))) 2074 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta X(), roundedIntPoint(wheelEvent->absoluteLocation())))
2075 wheelEvent->setDefaultHandled(); 2075 wheelEvent->setDefaultHandled();
2076 2076
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after
3906 unsigned EventHandler::accessKeyModifiers() 3906 unsigned EventHandler::accessKeyModifiers()
3907 { 3907 {
3908 #if OS(MACOSX) 3908 #if OS(MACOSX)
3909 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3909 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3910 #else 3910 #else
3911 return PlatformEvent::AltKey; 3911 return PlatformEvent::AltKey;
3912 #endif 3912 #endif
3913 } 3913 }
3914 3914
3915 } // namespace blink 3915 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/wheelevent-ctrl-expected.txt ('k') | Source/platform/scroll/ScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698