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

Unified Diff: third_party/WebKit/Source/core/events/MouseEvent.cpp

Issue 2344693002: Support WebPointerProperties in MouseEvent (Closed)
Patch Set: fixed osx build Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/MouseEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/MouseEvent.cpp b/third_party/WebKit/Source/core/events/MouseEvent.cpp
index 5a686dd729cab3b550ac645f020008c70546ab02..6979d47a787fef93dfe945122622bda858473f0f 100644
--- a/third_party/WebKit/Source/core/events/MouseEvent.cpp
+++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp
@@ -50,7 +50,8 @@ MouseEvent* MouseEvent::create(const AtomicString& eventType, AbstractView* view
event.movementDelta().x(), event.movementDelta().y(),
event.getModifiers(), static_cast<short>(event.pointerProperties().button),
platformModifiersToButtons(event.getModifiers()),
- relatedTarget, event.timestamp(), event.getSyntheticEventType(), event.region());
+ relatedTarget, event.timestamp(), event.getSyntheticEventType(), event.region(),
+ &event);
}
MouseEvent* MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
@@ -61,12 +62,13 @@ MouseEvent* MouseEvent::create(const AtomicString& type, bool canBubble, bool ca
EventTarget* relatedTarget,
double platformTimeStamp,
PlatformMouseEvent::SyntheticEventType syntheticEventType,
- const String& region)
+ const String& region,
+ const PlatformMouseEvent* mouseEvent)
{
return new MouseEvent(type, canBubble, cancelable, view,
detail, screenX, screenY, windowX, windowY,
movementX, movementY,
- modifiers, button, buttons, relatedTarget, platformTimeStamp, syntheticEventType, region);
+ modifiers, button, buttons, relatedTarget, platformTimeStamp, syntheticEventType, region, mouseEvent);
}
MouseEvent* MouseEvent::create(const AtomicString& eventType, AbstractView* view, Event* underlyingEvent, SimulatedClickCreationScope creationScope)
@@ -89,7 +91,7 @@ MouseEvent* MouseEvent::create(const AtomicString& eventType, AbstractView* view
double timestamp = underlyingEvent ? underlyingEvent->platformTimeStamp() : monotonicallyIncreasingTime();
MouseEvent* createdEvent = MouseEvent::create(eventType, true, true, view,
0, screenX, screenY, 0, 0, 0, 0, modifiers, 0, 0, nullptr,
- timestamp, syntheticType, String());
+ timestamp, syntheticType, String(), nullptr);
createdEvent->setTrusted(creationScope == SimulatedClickCreationScope::FromUserAgent);
createdEvent->setUnderlyingEvent(underlyingEvent);
@@ -117,7 +119,8 @@ MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance
EventTarget* relatedTarget,
double platformTimeStamp,
PlatformMouseEvent::SyntheticEventType syntheticEventType,
- const String& region)
+ const String& region,
+ const PlatformMouseEvent* mouseEvent)
: MouseRelatedEvent(eventType, canBubble, cancelable, view, detail, IntPoint(screenX, screenY),
IntPoint(windowX, windowY), IntPoint(movementX, movementY), modifiers,
platformTimeStamp,
@@ -129,6 +132,8 @@ MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance
, m_syntheticEventType(syntheticEventType)
, m_region(region)
{
+ if (mouseEvent)
+ m_mouseEvent.reset(new PlatformMouseEvent(*mouseEvent));
}
MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer)
« no previous file with comments | « third_party/WebKit/Source/core/events/MouseEvent.h ('k') | third_party/WebKit/Source/core/events/WheelEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698