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

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (Closed)
Patch Set: Created 3 years, 11 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/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 66fb351cd033a456d072da323c2dbdaf6c1a6b8e..d804244ebd5a6366712b50db4f4bc5f39f437883 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -2119,7 +2119,7 @@ DispatchEventResult Node::dispatchDOMActivateEvent(int detail,
}
void Node::createAndDispatchPointerEvent(const AtomicString& mouseEventName,
- const PlatformMouseEvent& mouseEvent,
+ const WebMouseEvent& mouseEvent,
LocalDOMWindow* view) {
AtomicString pointerEventName;
if (mouseEventName == EventTypeNames::mousemove)
@@ -2137,22 +2137,22 @@ void Node::createAndDispatchPointerEvent(const AtomicString& mouseEventName,
pointerEventInit.setPointerType("mouse");
pointerEventInit.setIsPrimary(true);
pointerEventInit.setButtons(
- MouseEvent::platformModifiersToButtons(mouseEvent.getModifiers()));
+ MouseEvent::platformModifiersToButtons(mouseEvent.modifiers()));
pointerEventInit.setBubbles(true);
pointerEventInit.setCancelable(true);
pointerEventInit.setComposed(true);
pointerEventInit.setDetail(0);
- pointerEventInit.setScreenX(mouseEvent.globalPosition().x());
- pointerEventInit.setScreenY(mouseEvent.globalPosition().y());
+ pointerEventInit.setScreenX(mouseEvent.globalX);
+ pointerEventInit.setScreenY(mouseEvent.globalY);
IntPoint locationInFrameZoomed;
if (view && view->frame() && view->frame()->view()) {
LocalFrame* frame = view->frame();
FrameView* frameView = frame->view();
- IntPoint locationInContents =
- frameView->rootFrameToContents(mouseEvent.position());
+ IntPoint locationInContents = flooredIntPoint(
mustaq 2017/01/27 16:53:44 Let's floor the coord first before transforming, t
dtapuska 2017/01/27 20:59:59 Done.
+ frameView->rootFrameToContents(mouseEvent.positionInRootFrame()));
locationInFrameZoomed = frameView->contentsToFrame(locationInContents);
float scaleFactor = 1 / frame->pageZoomFactor();
locationInFrameZoomed.scale(scaleFactor, scaleFactor);
@@ -2164,28 +2164,30 @@ void Node::createAndDispatchPointerEvent(const AtomicString& mouseEventName,
if (pointerEventName == EventTypeNames::pointerdown ||
pointerEventName == EventTypeNames::pointerup) {
- pointerEventInit.setButton(
- static_cast<int>(mouseEvent.pointerProperties().button));
+ pointerEventInit.setButton(static_cast<int>(mouseEvent.button));
} else {
pointerEventInit.setButton(
static_cast<int>(WebPointerProperties::Button::NoButton));
}
- UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit,
- mouseEvent.getModifiers());
+ UIEventWithKeyState::setFromWebInputEventModifiers(
+ pointerEventInit,
+ static_cast<WebInputEvent::Modifiers>(mouseEvent.modifiers()));
pointerEventInit.setView(view);
dispatchEvent(PointerEvent::create(pointerEventName, pointerEventInit));
}
-void Node::dispatchMouseEvent(const PlatformMouseEvent& nativeEvent,
+void Node::dispatchMouseEvent(const WebMouseEvent& nativeEvent,
const AtomicString& mouseEventType,
int detail,
+ const String& canvasRegionId,
Node* relatedTarget) {
createAndDispatchPointerEvent(mouseEventType, nativeEvent,
document().domWindow());
dispatchEvent(MouseEvent::create(mouseEventType, document().domWindow(),
- nativeEvent, detail, relatedTarget));
+ nativeEvent, detail, canvasRegionId,
+ relatedTarget));
}
void Node::dispatchSimulatedClick(Event* underlyingEvent,

Powered by Google App Engine
This is Rietveld 408576698