<rdar://problem/9496795> REGRESSION (r86851): Plug-ins disappear when scrolled with...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 17:22:23 +0000 (17:22 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 17:22:23 +0000 (17:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=61448

Reviewed by Anders Carlsson.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::clipRectInWindowCoordinates): Correct for page scale
after intersecting the two rectangles.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87305 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp

index 78be66d..763e705 100644 (file)
@@ -1,3 +1,14 @@
+2011-05-25  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        <rdar://problem/9496795> REGRESSION (r86851): Plug-ins disappear when scrolled with non-1 page scale
+        https://bugs.webkit.org/show_bug.cgi?id=61448
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::clipRectInWindowCoordinates): Correct for page scale
+        after intersecting the two rectangles.
+
 2011-05-24  Timothy Hatcher  <timothy@apple.com>
 
         Make the Web Inspector bring the right window to the front when docked.
index b0108cb..bb68f0c 100644 (file)
@@ -659,19 +659,20 @@ void PluginView::viewVisibilityDidChange()
 
 IntRect PluginView::clipRectInWindowCoordinates() const
 {
-    ASSERT(parent());
-
     // Get the frame rect in window coordinates.
     IntRect frameRectInWindowCoordinates = parent()->contentsToWindow(frameRect());
-    frameRectInWindowCoordinates.scale(1 / frame()->pageScaleFactor());
+
+    Frame* frame = this->frame();
 
     // Get the window clip rect for the enclosing layer (in window coordinates).
     RenderLayer* layer = m_pluginElement->renderer()->enclosingLayer();
-    FrameView* parentView = m_pluginElement->document()->frame()->view();
-    IntRect windowClipRect = parentView->windowClipRectForLayer(layer, true);
+    IntRect windowClipRect = frame->view()->windowClipRectForLayer(layer, true);
 
     // Intersect the two rects to get the view clip rect in window coordinates.
-    return intersection(frameRectInWindowCoordinates, windowClipRect);
+    frameRectInWindowCoordinates.intersect(windowClipRect);
+
+    frameRectInWindowCoordinates.scale(1 / frame->pageScaleFactor());
+    return frameRectInWindowCoordinates;
 }
 
 void PluginView::focusPluginElement()