OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/input/PointerEventManager.h" | 5 #include "core/input/PointerEventManager.h" |
6 | 6 |
7 #include "core/dom/ElementTraversal.h" | 7 #include "core/dom/ElementTraversal.h" |
8 #include "core/dom/ExecutionContextTask.h" | 8 #include "core/dom/ExecutionContextTask.h" |
9 #include "core/dom/shadow/FlatTreeTraversal.h" | 9 #include "core/dom/shadow/FlatTreeTraversal.h" |
10 #include "core/events/MouseEvent.h" | 10 #include "core/events/MouseEvent.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 && m_nodeUnderPointer.contains(pointerId)) { | 146 && m_nodeUnderPointer.contains(pointerId)) { |
147 EventTarget* targetUnderPointer = | 147 EventTarget* targetUnderPointer = |
148 m_nodeUnderPointer.get(pointerId).target; | 148 m_nodeUnderPointer.get(pointerId).target; |
149 if (targetUnderPointer == target) { | 149 if (targetUnderPointer == target) { |
150 m_nodeUnderPointer.set(pointerId, EventTargetAttributes | 150 m_nodeUnderPointer.set(pointerId, EventTargetAttributes |
151 (targetUnderPointer, | 151 (targetUnderPointer, |
152 eventType == EventTypeNames::pointerover)); | 152 eventType == EventTypeNames::pointerover)); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 if (pointerEvent->type() == EventTypeNames::pointermove | |
157 && m_pointerEventFactory.isActiveButtonsState(pointerEvent->pointerId()) ) { | |
158 // If we see a pointermove while a button is down, presumably the user | |
159 // is engaging in drag motion. | |
160 // TODO(ymalik): This will need to be updated to account for pointermove | |
161 // events that occur within the slop region (see crbug.com/632067). | |
162 m_frame->view()->setUserMayHaveDragged(true); | |
Navid Zolghadr
2016/08/04 18:11:00
Maybe for the events that cannot possibly cause sc
| |
163 } | |
164 | |
156 if (!RuntimeEnabledFeatures::pointerEventEnabled()) | 165 if (!RuntimeEnabledFeatures::pointerEventEnabled()) |
157 return WebInputEventResult::NotHandled; | 166 return WebInputEventResult::NotHandled; |
158 if (!checkForListener || target->hasEventListeners(eventType)) { | 167 if (!checkForListener || target->hasEventListeners(eventType)) { |
159 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispatch) ; | 168 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispatch) ; |
160 if (eventType == EventTypeNames::pointerdown) | 169 if (eventType == EventTypeNames::pointerdown) |
161 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispa tchPointerDown); | 170 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispa tchPointerDown); |
162 | 171 |
163 DispatchEventResult dispatchResult = target->dispatchEvent(pointerEvent) ; | 172 DispatchEventResult dispatchResult = target->dispatchEvent(pointerEvent) ; |
164 return EventHandler::toWebInputEventResult(dispatchResult); | 173 return EventHandler::toWebInputEventResult(dispatchResult); |
165 } | 174 } |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
878 { | 887 { |
879 visitor->trace(m_frame); | 888 visitor->trace(m_frame); |
880 visitor->trace(m_nodeUnderPointer); | 889 visitor->trace(m_nodeUnderPointer); |
881 visitor->trace(m_pointerCaptureTarget); | 890 visitor->trace(m_pointerCaptureTarget); |
882 visitor->trace(m_pendingPointerCaptureTarget); | 891 visitor->trace(m_pendingPointerCaptureTarget); |
883 visitor->trace(m_touchEventManager); | 892 visitor->trace(m_touchEventManager); |
884 } | 893 } |
885 | 894 |
886 | 895 |
887 } // namespace blink | 896 } // namespace blink |
OLD | NEW |