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 { |
11 | 11 |
12 PointerEvent::PointerEvent(const AtomicString& type, | 12 PointerEvent::PointerEvent(const AtomicString& type, |
13 const PointerEventInit& initializer) | 13 const PointerEventInit& initializer) |
14 : MouseEvent(type, initializer), | 14 : MouseEvent(type, initializer), |
15 m_pointerId(0), | 15 m_pointerId(0), |
16 m_width(0), | 16 m_width(0), |
17 m_height(0), | 17 m_height(0), |
18 m_pressure(0), | 18 m_pressure(0), |
19 m_tiltX(0), | 19 m_tiltX(0), |
20 m_tiltY(0), | 20 m_tiltY(0), |
| 21 m_tangentialPressure(0), |
| 22 m_twist(0), |
21 m_isPrimary(false) { | 23 m_isPrimary(false) { |
22 if (initializer.hasPointerId()) | 24 if (initializer.hasPointerId()) |
23 m_pointerId = initializer.pointerId(); | 25 m_pointerId = initializer.pointerId(); |
24 if (initializer.hasWidth()) | 26 if (initializer.hasWidth()) |
25 m_width = initializer.width(); | 27 m_width = initializer.width(); |
26 if (initializer.hasHeight()) | 28 if (initializer.hasHeight()) |
27 m_height = initializer.height(); | 29 m_height = initializer.height(); |
28 if (initializer.hasPressure()) | 30 if (initializer.hasPressure()) |
29 m_pressure = initializer.pressure(); | 31 m_pressure = initializer.pressure(); |
30 if (initializer.hasTiltX()) | 32 if (initializer.hasTiltX()) |
31 m_tiltX = initializer.tiltX(); | 33 m_tiltX = initializer.tiltX(); |
32 if (initializer.hasTiltY()) | 34 if (initializer.hasTiltY()) |
33 m_tiltY = initializer.tiltY(); | 35 m_tiltY = initializer.tiltY(); |
| 36 if (initializer.hasTangentialPressure()) |
| 37 m_tangentialPressure = initializer.tangentialPressure(); |
| 38 if (initializer.hasTwist()) |
| 39 m_twist = initializer.twist(); |
34 if (initializer.hasPointerType()) | 40 if (initializer.hasPointerType()) |
35 m_pointerType = initializer.pointerType(); | 41 m_pointerType = initializer.pointerType(); |
36 if (initializer.hasIsPrimary()) | 42 if (initializer.hasIsPrimary()) |
37 m_isPrimary = initializer.isPrimary(); | 43 m_isPrimary = initializer.isPrimary(); |
38 if (initializer.hasCoalescedEvents()) { | 44 if (initializer.hasCoalescedEvents()) { |
39 for (auto coalescedEvent : initializer.coalescedEvents()) | 45 for (auto coalescedEvent : initializer.coalescedEvents()) |
40 m_coalescedEvents.push_back(coalescedEvent); | 46 m_coalescedEvents.push_back(coalescedEvent); |
41 } | 47 } |
42 } | 48 } |
43 | 49 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 91 |
86 DCHECK(!event().target() || event().target() != event().relatedTarget()); | 92 DCHECK(!event().target() || event().target() != event().relatedTarget()); |
87 | 93 |
88 event().eventPath().adjustForRelatedTarget(dispatcher.node(), | 94 event().eventPath().adjustForRelatedTarget(dispatcher.node(), |
89 event().relatedTarget()); | 95 event().relatedTarget()); |
90 | 96 |
91 return dispatcher.dispatch(); | 97 return dispatcher.dispatch(); |
92 } | 98 } |
93 | 99 |
94 } // namespace blink | 100 } // namespace blink |
OLD | NEW |