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

Side by Side Diff: third_party/WebKit/Source/core/events/MouseEvent.cpp

Issue 2687903002: Track constant InputDeviceCapabilities objects per-window. (Closed)
Patch Set: Created 3 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) 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
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 "platform/PlatformMouseEvent.h" 36 #include "platform/PlatformMouseEvent.h"
36 #include "public/platform/WebPointerProperties.h" 37 #include "public/platform/WebPointerProperties.h"
37 38
38 namespace blink { 39 namespace blink {
39 40
40 namespace { 41 namespace {
41 42
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const String& region, 191 const String& region,
191 const WebMouseEvent& event) 192 const WebMouseEvent& event)
192 : UIEventWithKeyState( 193 : UIEventWithKeyState(
193 eventType, 194 eventType,
194 canBubble, 195 canBubble,
195 cancelable, 196 cancelable,
196 abstractView, 197 abstractView,
197 0, 198 0,
198 static_cast<PlatformEvent::Modifiers>(event.modifiers()), 199 static_cast<PlatformEvent::Modifiers>(event.modifiers()),
199 TimeTicks::FromSeconds(event.timeStampSeconds()), 200 TimeTicks::FromSeconds(event.timeStampSeconds()),
200 syntheticEventType == PlatformMouseEvent::FromTouch 201 abstractView
201 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() 202 ? abstractView->getInputDeviceCapabilities()->firesTouchEvents(
202 : InputDeviceCapabilities:: 203 syntheticEventType == PlatformMouseEvent::FromTouch)
203 doesntFireTouchEventsSourceCapabilities()), 204 : nullptr),
204 m_screenLocation(event.globalX, event.globalY), 205 m_screenLocation(event.globalX, event.globalY),
205 m_movementDelta(flooredIntPoint(event.movementInRootFrame())), 206 m_movementDelta(flooredIntPoint(event.movementInRootFrame())),
206 m_positionType(syntheticEventType == PlatformMouseEvent::Positionless 207 m_positionType(syntheticEventType == PlatformMouseEvent::Positionless
207 ? PositionType::Positionless 208 ? PositionType::Positionless
208 : PositionType::Position), 209 : PositionType::Position),
209 m_button(0), 210 m_button(0),
210 m_buttons(platformModifiersToButtons(event.modifiers())), 211 m_buttons(platformModifiersToButtons(event.modifiers())),
211 m_syntheticEventType(syntheticEventType), 212 m_syntheticEventType(syntheticEventType),
212 m_region(region) { 213 m_region(region) {
213 IntPoint rootFrameCoordinates = flooredIntPoint(event.positionInRootFrame()); 214 IntPoint rootFrameCoordinates = flooredIntPoint(event.positionInRootFrame());
(...skipping 22 matching lines...) Expand all
236 const String& region, 237 const String& region,
237 const PlatformMouseEvent* mouseEvent) 238 const PlatformMouseEvent* mouseEvent)
238 : UIEventWithKeyState( 239 : UIEventWithKeyState(
239 eventType, 240 eventType,
240 canBubble, 241 canBubble,
241 cancelable, 242 cancelable,
242 abstractView, 243 abstractView,
243 detail, 244 detail,
244 modifiers, 245 modifiers,
245 platformTimeStamp, 246 platformTimeStamp,
246 syntheticEventType == PlatformMouseEvent::FromTouch 247 abstractView
247 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() 248 ? abstractView->getInputDeviceCapabilities()->firesTouchEvents(
248 : InputDeviceCapabilities:: 249 syntheticEventType == PlatformMouseEvent::FromTouch)
249 doesntFireTouchEventsSourceCapabilities()), 250 : nullptr),
250 m_screenLocation(screenX, screenY), 251 m_screenLocation(screenX, screenY),
251 m_movementDelta(movementX, movementY), 252 m_movementDelta(movementX, movementY),
252 m_positionType(syntheticEventType == PlatformMouseEvent::Positionless 253 m_positionType(syntheticEventType == PlatformMouseEvent::Positionless
253 ? PositionType::Positionless 254 ? PositionType::Positionless
254 : PositionType::Position), 255 : PositionType::Position),
255 m_button(button), 256 m_button(button),
256 m_buttons(buttons), 257 m_buttons(buttons),
257 m_relatedTarget(relatedTarget), 258 m_relatedTarget(relatedTarget),
258 m_syntheticEventType(syntheticEventType), 259 m_syntheticEventType(syntheticEventType),
259 m_region(region) { 260 m_region(region) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 600
600 int MouseEvent::offsetY() { 601 int MouseEvent::offsetY() {
601 if (!hasPosition()) 602 if (!hasPosition())
602 return 0; 603 return 0;
603 if (!m_hasCachedRelativePosition) 604 if (!m_hasCachedRelativePosition)
604 computeRelativePosition(); 605 computeRelativePosition();
605 return std::round(m_offsetLocation.y()); 606 return std::round(m_offsetLocation.y());
606 } 607 }
607 608
608 } // namespace blink 609 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/KeyboardEvent.cpp ('k') | third_party/WebKit/Source/core/events/TouchEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698