OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/events/PointerEvent.h" | 5 #include "core/events/PointerEvent.h" |
6 | 6 |
7 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
8 #include "core/events/EventDispatcher.h" | 8 #include "core/events/EventDispatcher.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 PointerEventDispatchMediator::PointerEventDispatchMediator( | 76 PointerEventDispatchMediator::PointerEventDispatchMediator( |
77 PointerEvent* pointerEvent) | 77 PointerEvent* pointerEvent) |
78 : EventDispatchMediator(pointerEvent) {} | 78 : EventDispatchMediator(pointerEvent) {} |
79 | 79 |
80 PointerEvent& PointerEventDispatchMediator::event() const { | 80 PointerEvent& PointerEventDispatchMediator::event() const { |
81 return toPointerEvent(EventDispatchMediator::event()); | 81 return toPointerEvent(EventDispatchMediator::event()); |
82 } | 82 } |
83 | 83 |
84 DispatchEventResult PointerEventDispatchMediator::dispatchEvent( | 84 DispatchEventResult PointerEventDispatchMediator::dispatchEvent( |
85 EventDispatcher& dispatcher) const { | 85 EventDispatcher& dispatcher) const { |
86 if (isDisabledFormControl(&dispatcher.node())) | |
87 return DispatchEventResult::CanceledBeforeDispatch; | |
88 | |
89 if (event().type().isEmpty()) | 86 if (event().type().isEmpty()) |
90 return DispatchEventResult::NotCanceled; // Shouldn't happen. | 87 return DispatchEventResult::NotCanceled; // Shouldn't happen. |
91 | 88 |
92 DCHECK(!event().target() || event().target() != event().relatedTarget()); | 89 DCHECK(!event().target() || event().target() != event().relatedTarget()); |
93 | 90 |
94 event().eventPath().adjustForRelatedTarget(dispatcher.node(), | 91 event().eventPath().adjustForRelatedTarget(dispatcher.node(), |
95 event().relatedTarget()); | 92 event().relatedTarget()); |
96 | 93 |
97 return dispatcher.dispatch(); | 94 return dispatcher.dispatch(); |
98 } | 95 } |
99 | 96 |
100 } // namespace blink | 97 } // namespace blink |
OLD | NEW |