Index: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
index f30d629d300f88ce4147923ef6bf401a71e1a127..a004f804d8a26e23b0ac3d7015c1b275bcaf642d 100644 |
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
@@ -815,16 +815,26 @@ void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event) { |
case TouchEventRequestTypeNone: |
return; |
case TouchEventRequestTypeRaw: { |
- WebTouchEventBuilder webEvent(LayoutItem(m_element->layoutObject()), |
- *event); |
- if (webEvent.type() == WebInputEvent::Undefined) |
+ if (!event->nativeEvent()) |
return; |
if (event->type() == EventTypeNames::touchstart) |
focusPlugin(); |
+ WebTouchEvent transformedEvent = event->nativeEvent()->flattenTransform(); |
+ |
+ for (unsigned i = 0; i < transformedEvent.touchesLength; ++i) { |
+ WebFloatPoint absoluteRootFrameLocation = |
+ event->nativeEvent()->touchPointInRootFrame(i).position; |
bokan
2017/01/25 15:19:48
I think this can just be transformedEvent->touches
dtapuska
2017/01/25 17:59:17
yes; done
|
+ IntPoint localPoint = |
+ roundedIntPoint(m_element->layoutObject()->absoluteToLocal( |
+ absoluteRootFrameLocation, UseTransforms)); |
+ transformedEvent.touches[i].position.x = localPoint.x(); |
+ transformedEvent.touches[i].position.y = localPoint.y(); |
+ } |
+ |
WebCursorInfo cursorInfo; |
- if (m_webPlugin->handleInputEvent(webEvent, cursorInfo) != |
+ if (m_webPlugin->handleInputEvent(transformedEvent, cursorInfo) != |
WebInputEventResult::NotHandled) |
event->setDefaultHandled(); |
// FIXME: Can a plugin change the cursor from a touch-event callback? |