Title: [86851] trunk/Source/WebKit2
- Revision
- 86851
- Author
- [email protected]
- Date
- 2011-05-19 10:17:18 -0700 (Thu, 19 May 2011)
Log Message
2011-05-18 Chris Marrin <[email protected]>
Reviewed by Anders Carlsson.
Plug-ins at YouTube, cnn.com, nytimes vanish when their top/left is scrolled out of view when zoomed
https://bugs.webkit.org/show_bug.cgi?id=61101
Scale both bounding boxes sent to m_plugin->geometryDidChange(), not just the frameRect. This fools
the plugin into thinking it is drawing into an unscaled box with an unscaled view even when scaled.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::frame):Made this const so it can be used in clipRectInWindowCoordinates()
(WebKit::PluginView::viewGeometryDidChange):Used IntRect::scale() rather than scaling by hand
(WebKit::PluginView::clipRectInWindowCoordinates):Added scale of clipRect.
* WebProcess/Plugins/PluginView.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (86850 => 86851)
--- trunk/Source/WebKit2/ChangeLog 2011-05-19 17:15:51 UTC (rev 86850)
+++ trunk/Source/WebKit2/ChangeLog 2011-05-19 17:17:18 UTC (rev 86851)
@@ -1,3 +1,19 @@
+2011-05-18 Chris Marrin <[email protected]>
+
+ Reviewed by Anders Carlsson.
+
+ Plug-ins at YouTube, cnn.com, nytimes vanish when their top/left is scrolled out of view when zoomed
+ https://bugs.webkit.org/show_bug.cgi?id=61101
+
+ Scale both bounding boxes sent to m_plugin->geometryDidChange(), not just the frameRect. This fools
+ the plugin into thinking it is drawing into an unscaled box with an unscaled view even when scaled.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::frame):Made this const so it can be used in clipRectInWindowCoordinates()
+ (WebKit::PluginView::viewGeometryDidChange):Used IntRect::scale() rather than scaling by hand
+ (WebKit::PluginView::clipRectInWindowCoordinates):Added scale of clipRect.
+ * WebProcess/Plugins/PluginView.h:
+
2011-05-19 Carlos Garcia Campos <[email protected]>
Reviewed by Anders Carlsson.
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (86850 => 86851)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2011-05-19 17:15:51 UTC (rev 86850)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2011-05-19 17:17:18 UTC (rev 86851)
@@ -297,7 +297,7 @@
m_pluginElement = nullptr;
}
-Frame* PluginView::frame()
+Frame* PluginView::frame() const
{
return m_pluginElement->document()->frame();
}
@@ -645,10 +645,7 @@
IntRect frameRectInWindowCoordinates = parent()->contentsToWindow(frameRect());
// Adjust bounds to account for pageScaleFactor
- float scaleFactor = frame()->pageScaleFactor();
- frameRectInWindowCoordinates.setX(frameRectInWindowCoordinates.x() / scaleFactor);
- frameRectInWindowCoordinates.setY(frameRectInWindowCoordinates.y() / scaleFactor);
- frameRectInWindowCoordinates.setSize(m_boundsSize);
+ frameRectInWindowCoordinates.scale(1 / frame()->pageScaleFactor());
m_plugin->geometryDidChange(frameRectInWindowCoordinates, clipRectInWindowCoordinates());
}
@@ -666,7 +663,7 @@
// Get the frame rect in window coordinates.
IntRect frameRectInWindowCoordinates = parent()->contentsToWindow(frameRect());
- frameRectInWindowCoordinates.setSize(m_boundsSize);
+ frameRectInWindowCoordinates.scale(1 / frame()->pageScaleFactor());
// Get the window clip rect for the enclosing layer (in window coordinates).
RenderLayer* layer = m_pluginElement->renderer()->enclosingLayer();
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h (86850 => 86851)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2011-05-19 17:15:51 UTC (rev 86850)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2011-05-19 17:17:18 UTC (rev 86851)
@@ -51,7 +51,7 @@
public:
static PassRefPtr<PluginView> create(PassRefPtr<WebCore::HTMLPlugInElement>, PassRefPtr<Plugin>, const Plugin::Parameters&);
- WebCore::Frame* frame();
+ WebCore::Frame* frame() const;
bool isBeingDestroyed() const { return m_isBeingDestroyed; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes