- Revision
- 136349
- Author
- [email protected]
- Date
- 2012-12-02 11:56:07 -0800 (Sun, 02 Dec 2012)
Log Message
[chromium] Correct the location of synthetic mouse events when page is zoomed
https://bugs.webkit.org/show_bug.cgi?id=103823
Patch by Sadrul Habib Chowdhury <[email protected]> on 2012-12-02
Reviewed by Adam Barth.
Source/WebKit/chromium:
The event-location conversion function expects absolute locations. Change the
function name to reflect that, and use the absolute location of the touch-points
when converting from touch events.
* src/WebInputEventConversion.cpp:
(WebKit::convertAbsoluteLocationForRenderObject):
(WebKit::updateWebMouseEventFromWebCoreMouseEvent):
(WebKit::WebMouseEventBuilder::WebMouseEventBuilder):
(WebKit::addTouchPoints):
(WebKit::WebGestureEventBuilder::WebGestureEventBuilder):
LayoutTests:
* platform/chromium/plugins/touch-events-synthesized-expected.txt:
* platform/chromium/plugins/touch-events-synthesized.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (136348 => 136349)
--- trunk/LayoutTests/ChangeLog 2012-12-02 18:49:57 UTC (rev 136348)
+++ trunk/LayoutTests/ChangeLog 2012-12-02 19:56:07 UTC (rev 136349)
@@ -1,3 +1,13 @@
+2012-12-02 Sadrul Habib Chowdhury <[email protected]>
+
+ [chromium] Correct the location of synthetic mouse events when page is zoomed
+ https://bugs.webkit.org/show_bug.cgi?id=103823
+
+ Reviewed by Adam Barth.
+
+ * platform/chromium/plugins/touch-events-synthesized-expected.txt:
+ * platform/chromium/plugins/touch-events-synthesized.html:
+
2012-12-02 Robert Hogan <[email protected]>
Bad rendering of web page because of image's height is set to 100%
Modified: trunk/LayoutTests/platform/chromium/plugins/touch-events-synthesized-expected.txt (136348 => 136349)
--- trunk/LayoutTests/platform/chromium/plugins/touch-events-synthesized-expected.txt 2012-12-02 18:49:57 UTC (rev 136348)
+++ trunk/LayoutTests/platform/chromium/plugins/touch-events-synthesized-expected.txt 2012-12-02 19:56:07 UTC (rev 136349)
@@ -4,4 +4,16 @@
* 20, 15
Plugin received event: MouseUp
* 20, 15
+Plugin received event: MouseDown
+* 8, 8
+Plugin received event: MouseMove
+* 18, 13
+Plugin received event: MouseUp
+* 18, 13
+Plugin received event: MouseDown
+* 10, 10
+Plugin received event: MouseMove
+* 20, 15
+Plugin received event: MouseUp
+* 20, 15
Modified: trunk/LayoutTests/platform/chromium/plugins/touch-events-synthesized.html (136348 => 136349)
--- trunk/LayoutTests/platform/chromium/plugins/touch-events-synthesized.html 2012-12-02 18:49:57 UTC (rev 136348)
+++ trunk/LayoutTests/platform/chromium/plugins/touch-events-synthesized.html 2012-12-02 19:56:07 UTC (rev 136349)
@@ -32,6 +32,22 @@
eventSender.touchMove();
eventSender.releaseTouchPoint(0);
eventSender.touchEnd();
+
+ eventSender.zoomPageIn();
+ eventSender.addTouchPoint(positionX, positionY);
+ eventSender.touchStart();
+ eventSender.updateTouchPoint(0, positionX + 10, positionY + 5);
+ eventSender.touchMove();
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+
+ eventSender.zoomPageOut();
+ eventSender.addTouchPoint(positionX, positionY);
+ eventSender.touchStart();
+ eventSender.updateTouchPoint(0, positionX + 10, positionY + 5);
+ eventSender.touchMove();
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
}
</script>
Modified: trunk/Source/WebKit/chromium/ChangeLog (136348 => 136349)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-12-02 18:49:57 UTC (rev 136348)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-12-02 19:56:07 UTC (rev 136349)
@@ -1,3 +1,21 @@
+2012-12-02 Sadrul Habib Chowdhury <[email protected]>
+
+ [chromium] Correct the location of synthetic mouse events when page is zoomed
+ https://bugs.webkit.org/show_bug.cgi?id=103823
+
+ Reviewed by Adam Barth.
+
+ The event-location conversion function expects absolute locations. Change the
+ function name to reflect that, and use the absolute location of the touch-points
+ when converting from touch events.
+
+ * src/WebInputEventConversion.cpp:
+ (WebKit::convertAbsoluteLocationForRenderObject):
+ (WebKit::updateWebMouseEventFromWebCoreMouseEvent):
+ (WebKit::WebMouseEventBuilder::WebMouseEventBuilder):
+ (WebKit::addTouchPoints):
+ (WebKit::WebGestureEventBuilder::WebGestureEventBuilder):
+
2012-12-02 Miguel Garcia <[email protected]>
[Chromium] Create an enum for the kind of date input and use that on WebDateTimeChooserParams instead of a bare WebString
Modified: trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp (136348 => 136349)
--- trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp 2012-12-02 18:49:57 UTC (rev 136348)
+++ trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp 2012-12-02 19:56:07 UTC (rev 136349)
@@ -402,7 +402,7 @@
return modifiers;
}
-static IntPoint convertLocationForRenderObject(const LayoutPoint& location, const WebCore::RenderObject& renderObject)
+static IntPoint convertAbsoluteLocationForRenderObject(const LayoutPoint& location, const WebCore::RenderObject& renderObject)
{
return roundedIntPoint(renderObject.absoluteToLocal(location, UseTransforms | SnapOffsetForTransforms));
}
@@ -418,7 +418,7 @@
webEvent.globalY = event.screenY();
webEvent.windowX = windowPoint.x();
webEvent.windowY = windowPoint.y();
- IntPoint localPoint = convertLocationForRenderObject(event.absoluteLocation(), renderObject);
+ IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteLocation(), renderObject);
webEvent.x = localPoint.x();
webEvent.y = localPoint.y();
}
@@ -499,7 +499,7 @@
modifiers |= WebInputEvent::LeftButtonDown;
clickCount = (type == MouseDown || type == MouseUp);
- IntPoint localPoint = convertLocationForRenderObject(LayoutPoint(touch->pageX(), touch->pageY()), *renderObject);
+ IntPoint localPoint = convertAbsoluteLocationForRenderObject(touch->absoluteLocation(), *renderObject);
x = localPoint.x();
y = localPoint.y();
}
@@ -564,7 +564,7 @@
WebTouchPoint point;
point.id = touch->identifier();
point.screenPosition = WebPoint(touch->screenX(), touch->screenY());
- point.position = convertLocationForRenderObject(LayoutPoint(IntPoint(touch->pageX(), touch->pageY())), *renderObject);
+ point.position = convertAbsoluteLocationForRenderObject(touch->absoluteLocation(), *renderObject);
point.radiusX = touch->webkitRadiusX();
point.radiusY = touch->webkitRadiusY();
point.rotationAngle = touch->webkitRotationAngle();
@@ -624,7 +624,7 @@
globalX = event.screenX();
globalY = event.screenY();
- IntPoint localPoint = convertLocationForRenderObject(event.absoluteLocation(), *renderObject);
+ IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteLocation(), *renderObject);
x = localPoint.x();
y = localPoint.y();
}