Title: [99247] trunk/Source/WebKit2
Revision
99247
Author
[email protected]
Date
2011-11-03 16:55:21 -0700 (Thu, 03 Nov 2011)

Log Message

Add NetscapePlugin::convertToRootView
https://bugs.webkit.org/show_bug.cgi?id=71519

Reviewed by Darin Adler.

Yet another step towards eliminating uses of m_frameRectInWindowCoordinates.

Also, use the "root view" terminology, since that's really what we mean here.

* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::callSetWindow):
Use convertToRootView to get the plug-in location and clip rect in root view coordinates.

(WebKit::NetscapePlugin::convertToRootView):
Apply the m_pluginToRootViewTransform.mapPoint transform.

* WebProcess/Plugins/Netscape/NetscapePlugin.h:
Add convertToRootView.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (99246 => 99247)


--- trunk/Source/WebKit2/ChangeLog	2011-11-03 23:42:29 UTC (rev 99246)
+++ trunk/Source/WebKit2/ChangeLog	2011-11-03 23:55:21 UTC (rev 99247)
@@ -1,5 +1,26 @@
 2011-11-03  Anders Carlsson  <[email protected]>
 
+        Add NetscapePlugin::convertToRootView
+        https://bugs.webkit.org/show_bug.cgi?id=71519
+
+        Reviewed by Darin Adler.
+
+        Yet another step towards eliminating uses of m_frameRectInWindowCoordinates.
+
+        Also, use the "root view" terminology, since that's really what we mean here.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::callSetWindow):
+        Use convertToRootView to get the plug-in location and clip rect in root view coordinates.
+
+        (WebKit::NetscapePlugin::convertToRootView):
+        Apply the m_pluginToRootViewTransform.mapPoint transform.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        Add convertToRootView.
+
+2011-11-03  Anders Carlsson  <[email protected]>
+
         Move plug-in size and backing store checks to PluginProxy::updateBackingStore
         https://bugs.webkit.org/show_bug.cgi?id=71508
 

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (99246 => 99247)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-11-03 23:42:29 UTC (rev 99246)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2011-11-03 23:55:21 UTC (rev 99247)
@@ -484,10 +484,13 @@
 void NetscapePlugin::callSetWindow()
 {
     if (wantsWindowRelativeNPWindowCoordinates()) {
-        m_npWindow.x = m_frameRectInWindowCoordinates.x();
-        m_npWindow.y = m_frameRectInWindowCoordinates.y();
-        m_npWindow.clipRect.top = m_clipRectInWindowCoordinates.y();
-        m_npWindow.clipRect.left = m_clipRectInWindowCoordinates.x();
+        IntPoint pluginLocationInRootViewCoordinates = convertToRootView(IntPoint());
+        IntPoint clipRectInRootViewCoordinates = convertToRootView(m_clipRect.location());
+
+        m_npWindow.x = pluginLocationInRootViewCoordinates.x();
+        m_npWindow.y = pluginLocationInRootViewCoordinates.y();
+        m_npWindow.clipRect.top = clipRectInRootViewCoordinates.y();
+        m_npWindow.clipRect.left = clipRectInRootViewCoordinates.x();
     } else {
         m_npWindow.x = 0;
         m_npWindow.y = 0;
@@ -947,4 +950,9 @@
     return false;
 }
 
+IntPoint NetscapePlugin::convertToRootView(const IntPoint& pointInPluginCoordinates) const
+{
+    return m_pluginToRootViewTransform.mapPoint(pointInPluginCoordinates);
+}
+
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (99246 => 99247)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h	2011-11-03 23:42:29 UTC (rev 99246)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h	2011-11-03 23:55:21 UTC (rev 99247)
@@ -217,6 +217,9 @@
 
     bool supportsSnapshotting() const;
 
+    // Convert the given point from plug-in coordinates to root view coordinates.
+    WebCore::IntPoint convertToRootView(const WebCore::IntPoint&) const;
+
 #if PLUGIN_ARCHITECTURE(WIN)
     static BOOL WINAPI hookedTrackPopupMenu(HMENU, UINT uFlags, int x, int y, int nReserved, HWND, const RECT*);
     void scheduleWindowedGeometryUpdate();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to