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

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

Issue 1577263004: Communicate whether passive event listeners exist to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners
Patch Set: Fix nits Created 4 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #include "platform/scroll/Scrollbar.h" 97 #include "platform/scroll/Scrollbar.h"
98 #include "wtf/Assertions.h" 98 #include "wtf/Assertions.h"
99 #include "wtf/CurrentTime.h" 99 #include "wtf/CurrentTime.h"
100 #include "wtf/StdLibExtras.h" 100 #include "wtf/StdLibExtras.h"
101 #include "wtf/TemporaryChange.h" 101 #include "wtf/TemporaryChange.h"
102 102
103 namespace blink { 103 namespace blink {
104 104
105 namespace { 105 namespace {
106 106
107 bool hasTouchHandlers(const EventHandlerRegistry& registry)
108 {
109 return registry.hasEventHandlers(EventHandlerRegistry::TouchEventBlocking)
110 || registry.hasEventHandlers(EventHandlerRegistry::TouchEventPassive);
111 }
112
107 WebInputEventResult mergeEventResult(WebInputEventResult responseA, WebInputEven tResult responseB) 113 WebInputEventResult mergeEventResult(WebInputEventResult responseA, WebInputEven tResult responseB)
108 { 114 {
109 // The ordering of the enumeration is specific. There are times that 115 // The ordering of the enumeration is specific. There are times that
110 // multiple events fire and we need to combine them into a single 116 // multiple events fire and we need to combine them into a single
111 // result code. The enumeration is based on the level of consumption that 117 // result code. The enumeration is based on the level of consumption that
112 // is most significant. The enumeration is ordered with smaller specified 118 // is most significant. The enumeration is ordered with smaller specified
113 // numbers first. Examples of merged results are: 119 // numbers first. Examples of merged results are:
114 // (HandledApplication, HandledSystem) -> HandledSystem 120 // (HandledApplication, HandledSystem) -> HandledSystem
115 // (NotHandled, HandledApplication) -> HandledApplication 121 // (NotHandled, HandledApplication) -> HandledApplication
116 static_assert(static_cast<int>(WebInputEventResult::NotHandled) == 0, "WebIn putEventResult not ordered"); 122 static_assert(static_cast<int>(WebInputEventResult::NotHandled) == 0, "WebIn putEventResult not ordered");
(...skipping 3878 matching lines...) Expand 10 before | Expand all | Expand 10 after
3995 if (effectiveTouchAction != TouchActionAuto) 4001 if (effectiveTouchAction != TouchActionAuto)
3996 m_frame->page()->chromeClient().setTouchAction(effectiveTouchAct ion); 4002 m_frame->page()->chromeClient().setTouchAction(effectiveTouchAct ion);
3997 } 4003 }
3998 } 4004 }
3999 4005
4000 m_touchPressed = !allTouchReleased; 4006 m_touchPressed = !allTouchReleased;
4001 4007
4002 // If there's no document receiving touch events, or no handlers on the 4008 // If there's no document receiving touch events, or no handlers on the
4003 // document set to receive the events, then we can skip all the rest of 4009 // document set to receive the events, then we can skip all the rest of
4004 // this work. 4010 // this work.
4005 if (!m_touchSequenceDocument || !m_touchSequenceDocument->frameHost() || !m_ touchSequenceDocument->frameHost()->eventHandlerRegistry().hasEventHandlers(Even tHandlerRegistry::TouchEvent) || !m_touchSequenceDocument->frame()) { 4011 if (!m_touchSequenceDocument || !m_touchSequenceDocument->frameHost() || !ha sTouchHandlers(m_touchSequenceDocument->frameHost()->eventHandlerRegistry()) || !m_touchSequenceDocument->frame()) {
4006 if (allTouchReleased) { 4012 if (allTouchReleased) {
4007 m_touchSequenceDocument.clear(); 4013 m_touchSequenceDocument.clear();
4008 m_touchSequenceUserGestureToken.clear(); 4014 m_touchSequenceUserGestureToken.clear();
4009 } 4015 }
4010 return WebInputEventResult::NotHandled; 4016 return WebInputEventResult::NotHandled;
4011 } 4017 }
4012 4018
4013 // Compute and store the common info used by both PointerEvent and TouchEven t. 4019 // Compute and store the common info used by both PointerEvent and TouchEven t.
4014 WillBeHeapVector<TouchInfo> touchInfos(points.size()); 4020 WillBeHeapVector<TouchInfo> touchInfos(points.size());
4015 4021
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
4169 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4175 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4170 { 4176 {
4171 #if OS(MACOSX) 4177 #if OS(MACOSX)
4172 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4178 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4173 #else 4179 #else
4174 return PlatformEvent::AltKey; 4180 return PlatformEvent::AltKey;
4175 #endif 4181 #endif
4176 } 4182 }
4177 4183
4178 } // namespace blink 4184 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698