- Revision
- 117869
- Author
- [email protected]
- Date
- 2012-05-21 18:55:25 -0700 (Mon, 21 May 2012)
Log Message
Flash player buttons do not work when page is zoomed in
https://bugs.webkit.org/show_bug.cgi?id=87056
<rdar://problem/11491501>
Reviewed by Oliver Hunt.
Source/WebKit2:
Use the page scale factor when computing the plug-in to root view transform, otherwise we'll compute an
incorrect transform for plug-ins inside subframes. Also, make sure that viewGeometryDidChange is called for all plug-ins
when scaling the page since otherwise it won't be called unless the scroll position changes.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pageScaleFactorDidChange):
(WebKit):
(WebKit::PluginView::viewGeometryDidChange):
* WebProcess/Plugins/PluginView.h:
(PluginView):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scalePage):
LayoutTests:
* platform/mac-wk2/plugins/mouse-events-scaled-iframe-expected.txt: Added.
* platform/mac-wk2/plugins/mouse-events-scaled-iframe.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (117868 => 117869)
--- trunk/LayoutTests/ChangeLog 2012-05-22 01:53:10 UTC (rev 117868)
+++ trunk/LayoutTests/ChangeLog 2012-05-22 01:55:25 UTC (rev 117869)
@@ -1,3 +1,14 @@
+2012-05-21 Anders Carlsson <[email protected]>
+
+ Flash player buttons do not work when page is zoomed in
+ https://bugs.webkit.org/show_bug.cgi?id=87056
+ <rdar://problem/11491501>
+
+ Reviewed by Oliver Hunt.
+
+ * platform/mac-wk2/plugins/mouse-events-scaled-iframe-expected.txt: Added.
+ * platform/mac-wk2/plugins/mouse-events-scaled-iframe.html: Added.
+
2012-05-21 Abhishek Arya <[email protected]>
Regression(r117482): Run-in crashes relating to generated content and inline line box clearing.
Added: trunk/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-iframe-expected.txt (0 => 117869)
--- trunk/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-iframe-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-iframe-expected.txt 2012-05-22 01:55:25 UTC (rev 117869)
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: PLUGIN: mouseDown at (400, 400)
+CONSOLE MESSAGE: PLUGIN: mouseUp at (400, 400)
+CONSOLE MESSAGE: PLUGIN: mouseDown at (200, 200)
+CONSOLE MESSAGE: PLUGIN: mouseUp at (200, 200)
+CONSOLE MESSAGE: PLUGIN: mouseDown at (133, 133)
+CONSOLE MESSAGE: PLUGIN: mouseUp at (133, 133)
+
Added: trunk/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-iframe.html (0 => 117869)
--- trunk/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-iframe.html (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/mouse-events-scaled-iframe.html 2012-05-22 01:55:25 UTC (rev 117869)
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<html>
+<iframe id="iframe" src="" style="position: absolute; left: 0; top: 0; border:0" width="1000" height="1000"></iframe>
Modified: trunk/Source/WebKit2/ChangeLog (117868 => 117869)
--- trunk/Source/WebKit2/ChangeLog 2012-05-22 01:53:10 UTC (rev 117868)
+++ trunk/Source/WebKit2/ChangeLog 2012-05-22 01:55:25 UTC (rev 117869)
@@ -1,3 +1,24 @@
+2012-05-21 Anders Carlsson <[email protected]>
+
+ Flash player buttons do not work when page is zoomed in
+ https://bugs.webkit.org/show_bug.cgi?id=87056
+ <rdar://problem/11491501>
+
+ Reviewed by Oliver Hunt.
+
+ Use the page scale factor when computing the plug-in to root view transform, otherwise we'll compute an
+ incorrect transform for plug-ins inside subframes. Also, make sure that viewGeometryDidChange is called for all plug-ins
+ when scaling the page since otherwise it won't be called unless the scroll position changes.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::pageScaleFactorDidChange):
+ (WebKit):
+ (WebKit::PluginView::viewGeometryDidChange):
+ * WebProcess/Plugins/PluginView.h:
+ (PluginView):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::scalePage):
+
2012-05-15 Gavin Barraclough <[email protected]>
Add support for private names
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (117868 => 117869)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2012-05-22 01:53:10 UTC (rev 117868)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2012-05-22 01:55:25 UTC (rev 117869)
@@ -395,6 +395,11 @@
return toRenderBoxModelObject(m_pluginElement->renderer());
}
+void PluginView::pageScaleFactorDidChange()
+{
+ viewGeometryDidChange();
+}
+
#if PLATFORM(MAC)
void PluginView::setWindowIsVisible(bool windowIsVisible)
{
@@ -748,15 +753,15 @@
return;
ASSERT(frame());
- float frameScaleFactor = frame()->frameScaleFactor();
+ float pageScaleFactor = frame()->page() ? frame()->page()->pageScaleFactor() : 1;
- IntPoint scaledFrameRectLocation(frameRect().location().x() * frameScaleFactor, frameRect().location().y() * frameScaleFactor);
+ 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(frameScaleFactor);
+ transform.scale(pageScaleFactor);
// FIXME: The clip rect isn't correct.
IntRect clipRect = boundsRect();
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h (117868 => 117869)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2012-05-22 01:53:10 UTC (rev 117868)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2012-05-22 01:55:25 UTC (rev 117869)
@@ -72,6 +72,8 @@
// FIXME: Remove this; nobody should have to know about the plug-in view's renderer except the plug-in view itself.
WebCore::RenderBoxModelObject* renderer() const;
+ void pageScaleFactorDidChange();
+
private:
PluginView(PassRefPtr<WebCore::HTMLPlugInElement>, PassRefPtr<Plugin>, const Plugin::Parameters& parameters);
virtual ~PluginView();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (117868 => 117869)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-05-22 01:53:10 UTC (rev 117868)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-05-22 01:55:25 UTC (rev 117869)
@@ -1014,6 +1014,11 @@
{
m_page->setPageScaleFactor(scale, origin);
+#if PLATFORM(MAC)
+ for (HashSet<PluginView*>::const_iterator it = m_pluginViews.begin(), end = m_pluginViews.end(); it != end; ++it)
+ (*it)->pageScaleFactorDidChange();
+#endif
+
send(Messages::WebPageProxy::PageScaleFactorDidChange(scale));
}