OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #include "core/events/MouseEvent.h" | 23 #include "core/events/MouseEvent.h" |
24 | 24 |
25 #include "bindings/core/v8/DOMWrapperWorld.h" | 25 #include "bindings/core/v8/DOMWrapperWorld.h" |
26 #include "bindings/core/v8/ScriptState.h" | 26 #include "bindings/core/v8/ScriptState.h" |
27 #include "core/dom/Element.h" | 27 #include "core/dom/Element.h" |
28 #include "core/events/EventDispatcher.h" | 28 #include "core/events/EventDispatcher.h" |
29 #include "core/frame/FrameView.h" | 29 #include "core/frame/FrameView.h" |
30 #include "core/frame/LocalDOMWindow.h" | 30 #include "core/frame/LocalDOMWindow.h" |
31 #include "core/frame/LocalFrame.h" | 31 #include "core/frame/LocalFrame.h" |
| 32 #include "core/input/InputDeviceCapabilities.h" |
32 #include "core/layout/LayoutObject.h" | 33 #include "core/layout/LayoutObject.h" |
33 #include "core/paint/PaintLayer.h" | 34 #include "core/paint/PaintLayer.h" |
34 #include "core/svg/SVGElement.h" | 35 #include "core/svg/SVGElement.h" |
35 #include "public/platform/WebPointerProperties.h" | 36 #include "public/platform/WebPointerProperties.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
41 LayoutSize contentsScrollOffset(AbstractView* abstractView) { | 42 LayoutSize contentsScrollOffset(AbstractView* abstractView) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 const String& region, | 157 const String& region, |
157 EventTarget* relatedTarget) | 158 EventTarget* relatedTarget) |
158 : UIEventWithKeyState( | 159 : UIEventWithKeyState( |
159 eventType, | 160 eventType, |
160 canBubble, | 161 canBubble, |
161 cancelable, | 162 cancelable, |
162 abstractView, | 163 abstractView, |
163 detail, | 164 detail, |
164 static_cast<PlatformEvent::Modifiers>(event.modifiers()), | 165 static_cast<PlatformEvent::Modifiers>(event.modifiers()), |
165 TimeTicks::FromSeconds(event.timeStampSeconds()), | 166 TimeTicks::FromSeconds(event.timeStampSeconds()), |
166 event.fromTouch() | 167 abstractView |
167 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() | 168 ? abstractView->getInputDeviceCapabilities()->firesTouchEvents( |
168 : InputDeviceCapabilities:: | 169 event.fromTouch()) |
169 doesntFireTouchEventsSourceCapabilities()), | 170 : nullptr), |
170 m_screenLocation(event.globalX, event.globalY), | 171 m_screenLocation(event.globalX, event.globalY), |
171 m_movementDelta(flooredIntPoint(event.movementInRootFrame())), | 172 m_movementDelta(flooredIntPoint(event.movementInRootFrame())), |
172 m_positionType(PositionType::Position), | 173 m_positionType(PositionType::Position), |
173 m_button(static_cast<short>(event.button)), | 174 m_button(static_cast<short>(event.button)), |
174 m_buttons(platformModifiersToButtons(event.modifiers())), | 175 m_buttons(platformModifiersToButtons(event.modifiers())), |
175 m_relatedTarget(relatedTarget), | 176 m_relatedTarget(relatedTarget), |
176 m_syntheticEventType(event.fromTouch() ? FromTouch | 177 m_syntheticEventType(event.fromTouch() ? FromTouch |
177 : RealOrIndistinguishable), | 178 : RealOrIndistinguishable), |
178 m_region(region) { | 179 m_region(region) { |
179 IntPoint rootFrameCoordinates = flooredIntPoint(event.positionInRootFrame()); | 180 IntPoint rootFrameCoordinates = flooredIntPoint(event.positionInRootFrame()); |
(...skipping 20 matching lines...) Expand all Loading... |
200 SyntheticEventType syntheticEventType, | 201 SyntheticEventType syntheticEventType, |
201 const String& region) | 202 const String& region) |
202 : UIEventWithKeyState( | 203 : UIEventWithKeyState( |
203 eventType, | 204 eventType, |
204 canBubble, | 205 canBubble, |
205 cancelable, | 206 cancelable, |
206 abstractView, | 207 abstractView, |
207 detail, | 208 detail, |
208 modifiers, | 209 modifiers, |
209 platformTimeStamp, | 210 platformTimeStamp, |
210 syntheticEventType == FromTouch | 211 abstractView |
211 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() | 212 ? abstractView->getInputDeviceCapabilities()->firesTouchEvents( |
212 : InputDeviceCapabilities:: | 213 syntheticEventType == FromTouch) |
213 doesntFireTouchEventsSourceCapabilities()), | 214 : nullptr), |
214 m_screenLocation(screenX, screenY), | 215 m_screenLocation(screenX, screenY), |
215 m_movementDelta(movementX, movementY), | 216 m_movementDelta(movementX, movementY), |
216 m_positionType(syntheticEventType == Positionless | 217 m_positionType(syntheticEventType == Positionless |
217 ? PositionType::Positionless | 218 ? PositionType::Positionless |
218 : PositionType::Position), | 219 : PositionType::Position), |
219 m_button(button), | 220 m_button(button), |
220 m_buttons(buttons), | 221 m_buttons(buttons), |
221 m_relatedTarget(relatedTarget), | 222 m_relatedTarget(relatedTarget), |
222 m_syntheticEventType(syntheticEventType), | 223 m_syntheticEventType(syntheticEventType), |
223 m_region(region) { | 224 m_region(region) { |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 | 562 |
562 int MouseEvent::offsetY() { | 563 int MouseEvent::offsetY() { |
563 if (!hasPosition()) | 564 if (!hasPosition()) |
564 return 0; | 565 return 0; |
565 if (!m_hasCachedRelativePosition) | 566 if (!m_hasCachedRelativePosition) |
566 computeRelativePosition(); | 567 computeRelativePosition(); |
567 return std::round(m_offsetLocation.y()); | 568 return std::round(m_offsetLocation.y()); |
568 } | 569 } |
569 | 570 |
570 } // namespace blink | 571 } // namespace blink |
OLD | NEW |