[chromium] Make sure events are transformed correctly for plugins.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2012 15:13:30 +0000 (15:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Oct 2012 15:13:30 +0000 (15:13 +0000)
commit6f8b3505f897f11e1ad9acb5cc966986d6ca48a6
tree7bb4b0c611e424aef9dfdb7b33799c7b562d9371
parenta4a385978323f0c42988cc8b3ef4899af70a0753
[chromium] Make sure events are transformed correctly for plugins.
https://bugs.webkit.org/show_bug.cgi?id=89250

Patch by Sadrul Habib Chowdhury <sadrul@chromium.org> on 2012-10-09
Reviewed by Tony Chang.

Source/WebKit/chromium:

The events arriving in WebPluginContainerImpl are in the coordinate
space of the page containing the plugin. Before the events are
dispatched to the plugin, it is necessary to convert them into the
plugin's own coordinate system.

* src/WebInputEventConversion.cpp:
(WebKit::convertLocationForRenderObject): Transforms an event location for the specified RenderObject.
(WebKit):
(WebKit::updateWebMouseEventFromWebCoreMouseEvent): Refactored code to reduce code-duplication for mouse and wheel events.
(WebKit::WebMouseEventBuilder::WebMouseEventBuilder):
(WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):
(WebKit::addTouchPoints):
(WebKit::WebTouchEventBuilder::WebTouchEventBuilder):
(WebKit::WebGestureEventBuilder::WebGestureEventBuilder):
* src/WebInputEventConversion.h:
(WebCore):
(WebKit):
(WebMouseEventBuilder):
(WebMouseWheelEventBuilder):
(WebTouchEventBuilder):
(WebGestureEventBuilder):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::handleMouseEvent):
(WebKit::WebPluginContainerImpl::handleWheelEvent):

Tools:

Update the test plugin to print event details for mouse and gesture events.

* DumpRenderTree/chromium/TestWebPlugin.cpp:
(printEventDetails):

LayoutTests:

Added tests to make sure that events are transformed properly. Note that
for touch-events, each point in the three touch-point lists in the
touch-event is printed, so the same touch-point is printed out three
times.

* platform/chromium/plugins/transformed-events-expected.txt: Added.
* platform/chromium/plugins/transformed-events.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium/plugins/transformed-events-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/plugins/transformed-events.html [new file with mode: 0644]
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebInputEventConversion.cpp
Source/WebKit/chromium/src/WebInputEventConversion.h
Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestWebPlugin.cpp