Title: [105104] branches/safari-534.54-branch

Diff

Modified: branches/safari-534.54-branch/LayoutTests/ChangeLog (105103 => 105104)


--- branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-17 00:16:48 UTC (rev 105103)
+++ branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-17 00:19:57 UTC (rev 105104)
@@ -1,3 +1,20 @@
+2012-01-16  Mark Rowe  <[email protected]>
+
+        Merge r102540.
+
+    2011-12-11  Andreas Kling  <[email protected]>
+
+        WK2/NetscapePlugin: Incorrect mouse event coordinates when frameScaleFactor != 1.
+        <http://webkit.org/b/74209> and <rdar://problem/10438197>
+
+        Reviewed by Anders Carlsson.
+
+        Add a test verifying that NetscapePlugins receive correctly transformed
+        mouse events with a page scale factor applied.
+
+        * platform/mac-wk2/plugins/mouse-events-scaled-expected.txt: Added.
+        * platform/mac-wk2/plugins/mouse-events-scaled.html: Added.
+
 2011-1-13  Lucas Forschler  <[email protected]>
 
     Merge 104352

Added: branches/safari-534.54-branch/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-expected.txt (0 => 105104)


--- branches/safari-534.54-branch/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-expected.txt	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-expected.txt	2012-01-17 00:19:57 UTC (rev 105104)
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: line 0: PLUGIN: mouseDown at (300, 300)
+CONSOLE MESSAGE: line 0: PLUGIN: mouseUp at (300, 300)
+CONSOLE MESSAGE: line 0: PLUGIN: mouseDown at (200, 200)
+CONSOLE MESSAGE: line 0: PLUGIN: mouseUp at (200, 200)
+CONSOLE MESSAGE: line 0: PLUGIN: mouseDown at (133, 133)
+CONSOLE MESSAGE: line 0: PLUGIN: mouseUp at (133, 133)
+

Added: branches/safari-534.54-branch/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled.html (0 => 105104)


--- branches/safari-534.54-branch/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled.html	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled.html	2012-01-17 00:19:57 UTC (rev 105104)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<body>
+<embed style="position: absolute; left: 0; top: 0;" name="plg" type="application/x-webkit-test-netscape" windowedPlugin="false" width="1000" height="1000"></embed>
+<script>
+function fakeClick(x, y) {
+    eventSender.mouseMoveTo(300, 300);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+
+if (!window.layoutTestController)
+    document.write("This test does not work in manual mode.");
+else {
+    layoutTestController.dumpAsText();
+    
+    plg.windowedPlugin = false;
+    plg.eventLoggingEnabled = true;
+
+    eventSender.scalePageBy(1, 100, 100);
+    fakeClick(300, 300);
+    eventSender.scalePageBy(2, 100, 100);
+    fakeClick(300, 300);
+    eventSender.scalePageBy(3, 100, 100);
+    fakeClick(300, 300);
+
+    plg.eventLoggingEnabled = false;
+}
+</script>
+</body>
+</html>

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (105103 => 105104)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-17 00:16:48 UTC (rev 105103)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-17 00:19:57 UTC (rev 105104)
@@ -11,6 +11,19 @@
 
 2012-01-16  Mark Rowe  <[email protected]>
 
+        Merge r102540.
+
+    2011-12-11  Andreas Kling  <[email protected]>
+
+        WK2/NetscapePlugin: Incorrect mouse event coordinates when frameScaleFactor != 1.
+        <http://webkit.org/b/74209> and <rdar://problem/10438197>
+
+        Reviewed by Anders Carlsson.
+
+        * WebCore.exp.in: Export AffineTransform::scale(double).
+
+2012-01-16  Mark Rowe  <[email protected]>
+
         Merge r104378.
 
     2012-01-06  Mark Rowe  <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in (105103 => 105104)


--- branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in	2012-01-17 00:16:48 UTC (rev 105103)
+++ branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in	2012-01-17 00:19:57 UTC (rev 105104)
@@ -395,6 +395,8 @@
 __ZN7WebCore14SecurityOrigin6createERKN3WTF6StringES4_i
 __ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
 __ZN7WebCore14endOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
+__ZN7WebCore15AffineTransform5scaleEd
+__ZN7WebCore15AffineTransform9translateEdd
 __ZN7WebCore15AffineTransformC1Edddddd
 __ZN7WebCore15AffineTransformC1Ev
 __ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS1_6StringESA_SA_RKNS_16ResourceResponseE

Modified: branches/safari-534.54-branch/Source/WebKit2/ChangeLog (105103 => 105104)


--- branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-17 00:16:48 UTC (rev 105103)
+++ branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-17 00:19:57 UTC (rev 105104)
@@ -1,5 +1,32 @@
 2012-01-16  Mark Rowe  <[email protected]>
 
+        Merge r102540.
+
+    2011-12-11  Andreas Kling  <[email protected]>
+
+        WK2/NetscapePlugin: Incorrect mouse event coordinates when frameScaleFactor != 1.
+        <http://webkit.org/b/74209> and <rdar://problem/10438197>
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/WebEvent.h:
+        * Shared/WebMouseEvent.cpp:
+
+            Remove the WebMouseEvent "copy" constructor that applied a scale factor
+            to the coordinates of an existing event.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::handleEvent):
+
+            Pass the WebMouseEvent through to the plugin unmodified.
+
+        (WebKit::PluginView::viewGeometryDidChange):
+
+            Plumb a complex translate+scale transform through to the plugin, so coordinate
+            space transformations in will behave correctly with scale factors other than 1.
+
+2012-01-16  Mark Rowe  <[email protected]>
+
         Merge r96014.
 
     2011-09-26  Alexey Proskuryakov  <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebKit2/Shared/WebEvent.h (105103 => 105104)


--- branches/safari-534.54-branch/Source/WebKit2/Shared/WebEvent.h	2012-01-17 00:16:48 UTC (rev 105103)
+++ branches/safari-534.54-branch/Source/WebKit2/Shared/WebEvent.h	2012-01-17 00:19:57 UTC (rev 105104)
@@ -124,8 +124,6 @@
 #if PLATFORM(WIN)
     WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, bool didActivateWebView);
 #endif
-    
-    WebMouseEvent(const WebMouseEvent&, float pageScaleFactor);
 
     Button button() const { return static_cast<Button>(m_button); }
     const WebCore::IntPoint& position() const { return m_position; }

Modified: branches/safari-534.54-branch/Source/WebKit2/Shared/WebMouseEvent.cpp (105103 => 105104)


--- branches/safari-534.54-branch/Source/WebKit2/Shared/WebMouseEvent.cpp	2012-01-17 00:16:48 UTC (rev 105103)
+++ branches/safari-534.54-branch/Source/WebKit2/Shared/WebMouseEvent.cpp	2012-01-17 00:19:57 UTC (rev 105104)
@@ -78,21 +78,6 @@
 }
 #endif
 
-WebMouseEvent::WebMouseEvent(const WebMouseEvent& event, float pageScaleFactor)
-    : WebEvent(event.type(), event.modifiers(), event.timestamp())
-    , m_button(event.button())
-    , m_position(WebCore::IntPoint(event.position().x() / pageScaleFactor, event.position().y() / pageScaleFactor))
-    , m_globalPosition(m_position + (event.globalPosition() - event.position()))
-    , m_deltaX(event.deltaX())
-    , m_deltaY(event.deltaY())
-    , m_deltaZ(event.deltaZ())
-    , m_clickCount(event.clickCount())
-#if PLATFORM(WIN)
-    , m_didActivateWebView(false)
-#endif
-{
-}
-
 void WebMouseEvent::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
     WebEvent::encode(encoder);

Modified: branches/safari-534.54-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (105103 => 105104)


--- branches/safari-534.54-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2012-01-17 00:16:48 UTC (rev 105103)
+++ branches/safari-534.54-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2012-01-17 00:19:57 UTC (rev 105104)
@@ -641,10 +641,8 @@
         // FIXME: Clicking in a scroll bar should not change focus.
         if (currentEvent->type() == WebEvent::MouseDown)
             focusPluginElement();
-        
-        // Adjust mouse coordinates to account for pageScaleFactor
-        WebMouseEvent eventWithScaledCoordinates(*static_cast<const WebMouseEvent*>(currentEvent), frame()->pageScaleFactor());
-        didHandleEvent = m_plugin->handleMouseEvent(eventWithScaledCoordinates);
+
+        didHandleEvent = m_plugin->handleMouseEvent(static_cast<const WebMouseEvent&>(*currentEvent));
     } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel) {
         // We have a wheel event.
         didHandleEvent = m_plugin->handleWheelEvent(static_cast<const WebWheelEvent&>(*currentEvent));
@@ -720,10 +718,17 @@
         m_plugin->deprecatedGeometryDidChange(rect, clipRectInWindowCoordinates());
     }
 
-    // FIXME: Just passing a translation matrix isn't good enough.
-    IntPoint locationInWindowCoordinates = parent()->contentsToRootView(frameRect().location());
-    AffineTransform transform = AffineTransform::translation(locationInWindowCoordinates.x(), locationInWindowCoordinates.y());
+    ASSERT(frame());
+    float pageScaleFactor = frame()->pageScaleFactor();
 
+    IntPoint scaledFrameRectLocation(frameRect().location().x() * pageScaleFactor, frameRect().location().y() * pageScaleFactor);
+    IntPoint scaledLocationInRootViewCoordinates(parent()->contentsToRootView(scaledFrameRectLocation));
+
+    // FIXME: We still don't get the right coordinates for transformed plugins.
+    AffineTransform transform;
+    transform.translate(scaledLocationInRootViewCoordinates.x(), scaledLocationInRootViewCoordinates.y());
+    transform.scale(pageScaleFactor);
+
     // FIXME: The clip rect isn't correct.
     IntRect clipRect = boundsRect();
     m_plugin->geometryDidChange(size(), clipRect, transform);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to