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

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 6 years 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 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 RETURN_WHEEL_EVENT_HANDLED(); 2020 RETURN_WHEEL_EVENT_HANDLED();
2021 2021
2022 #undef RETURN_WHEEL_EVENT_HANDLED 2022 #undef RETURN_WHEEL_EVENT_HANDLED
2023 } 2023 }
2024 2024
2025 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent) 2025 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent)
2026 { 2026 {
2027 if (!startNode || !wheelEvent) 2027 if (!startNode || !wheelEvent)
2028 return; 2028 return;
2029 2029
2030 // Ctrl + scrollwheel is reserved for triggering zoom in/out actions in Chro mium. 2030 // Method suppressScroll() is reserved for triggering zoom in/out actions in Chromium.
tdresser 2014/11/27 15:06:09 Method suppressScroll() -> When scrolling is suppr
lanwei 2014/12/02 15:48:10 Done.
2031 if (wheelEvent->ctrlKey()) 2031 if (wheelEvent->suppressScroll())
2032 return; 2032 return;
2033 2033
2034 Node* stopNode = m_previousWheelScrolledNode.get(); 2034 Node* stopNode = m_previousWheelScrolledNode.get();
2035 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt->deltaMode()); 2035 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt->deltaMode());
2036 2036
2037 // Break up into two scrolls if we need to. Diagonal movement on 2037 // Break up into two scrolls if we need to. Diagonal movement on
2038 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set). 2038 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set).
2039 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta X(), roundedIntPoint(wheelEvent->absoluteLocation()))) 2039 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta X(), roundedIntPoint(wheelEvent->absoluteLocation())))
2040 wheelEvent->setDefaultHandled(); 2040 wheelEvent->setDefaultHandled();
2041 2041
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after
3859 unsigned EventHandler::accessKeyModifiers() 3859 unsigned EventHandler::accessKeyModifiers()
3860 { 3860 {
3861 #if OS(MACOSX) 3861 #if OS(MACOSX)
3862 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3862 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3863 #else 3863 #else
3864 return PlatformEvent::AltKey; 3864 return PlatformEvent::AltKey;
3865 #endif 3865 #endif
3866 } 3866 }
3867 3867
3868 } // namespace blink 3868 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698