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

Unified Diff: content/common/input/web_input_event_traits.cc

Issue 739013008: Explicitly suppress scrolling for wheel events that will trigger zooming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit tests 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 side-by-side diff with in-line comments
Download patch
Index: content/common/input/web_input_event_traits.cc
diff --git a/content/common/input/web_input_event_traits.cc b/content/common/input/web_input_event_traits.cc
index 087cf61e0cf2e8869c73ba55f03c4af33b102489..1041019b42868b277cf5da666a3573710116b7bd 100644
--- a/content/common/input/web_input_event_traits.cc
+++ b/content/common/input/web_input_event_traits.cc
@@ -58,7 +58,7 @@ void ApppendEventDetails(const WebMouseWheelEvent& event, std::string* result) {
StringAppendF(result,
"{\n Delta: (%f, %f)\n WheelTicks: (%f, %f)\n Accel: (%f, %f)\n"
" ScrollByPage: %d\n HasPreciseScrollingDeltas: %d\n"
- " Phase: (%d, %d)\n CanRubberband: (%d, %d)\n}",
+ " Phase: (%d, %d)\n CanRubberband: (%d, %d)\n CanScroll: %d\n}",
event.deltaX,
event.deltaY,
event.wheelTicksX,
@@ -70,7 +70,8 @@ void ApppendEventDetails(const WebMouseWheelEvent& event, std::string* result) {
event.phase,
event.momentumPhase,
event.canRubberbandLeft,
- event.canRubberbandRight);
+ event.canRubberbandRight,
+ event.canScroll);
}
void ApppendEventDetails(const WebGestureEvent& event, std::string* result) {
@@ -149,7 +150,8 @@ bool CanCoalesce(const WebMouseWheelEvent& event_to_coalesce,
event.phase == event_to_coalesce.phase &&
event.momentumPhase == event_to_coalesce.momentumPhase &&
event.hasPreciseScrollingDeltas ==
- event_to_coalesce.hasPreciseScrollingDeltas;
+ event_to_coalesce.hasPreciseScrollingDeltas &&
+ event.canScroll == event_to_coalesce.canScroll;
}
float GetUnacceleratedDelta(float accelerated_delta, float acceleration_ratio) {

Powered by Google App Engine
This is Rietveld 408576698