Tell ScrollView's child Widgets that their frame rects have changed when its own frame rect changes

r79167 moved some code from setFrameRect to setBoundsSize, including a call to
frameRectsChanged. This was done because positionScrollbarLayers, which is called by
frameRectsChanged, only needs to be called when the bounds change, not when the frame rect
changes. But the recursive calls inside frameRectsChanged *do* need to be called when the
frame rect changes.

This patch moves the positionScrollbarLayers call out of frameRectsChanged, since it needs
to be called at different times from frameRectsChanged. Then it restores the
frameRectsChanged call to setFrameRect, which fixes the bug.

Test: platform/win/plugins/iframe-inside-overflow.html

Fixes <http://webkit.org/b/60194> <rdar://problem/9383760> REGRESSION (r79167): Windowed
plugins in Google Reader don't move when the article list is scrolled

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars): Added a positionScrollbarLayers call here now that
frameRectsChanged doesn't call it for us. Also added a FIXME because it seems strange to
call frameRectsChanged here when our frame rect hasn't changed.
(WebCore::ScrollView::setFrameRect): Added back the frameRectsChanged call that was removed
in r79167.
(WebCore::ScrollView::setBoundsSize): Replaced a frameRectsChanged call with a call to
positionScrollbarLayers. We were only calling frameRectsChanged here in order to get
positionScrollbarLayers to be called.
(WebCore::ScrollView::frameRectsChanged): Removed the call to positionScrollbarLayers. All
callers of frameRectsChanged have been updated to call positionScrollbarLayers if needed.

Tools:

Add a plugin test that dumps the plugin window's rect

* DumpRenderTree/TestNetscapePlugIn/Tests/win/DumpWindowRect.cpp: Added.
(DumpWindowRect::DumpWindowRect): Just call up to the base class.
(DumpWindowRect::performWindowGeometryTest): Find our window rect relative to the test
harness window and log it.

* DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Added DumpWindowRect.

LayoutTests:

Add a test for windowed plugins inside iframes inside scrolled overflow areas

* platform/win/plugins/iframe-inside-overflow-expected.txt: Added.
* platform/win/plugins/iframe-inside-overflow.html: Added.
(loaded): Scrolls the div and tells the plugin to start its test (which will cause its
window rect to be logged).
* platform/win/plugins/resources/dump-window-rect-iframe.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index 95c18c1..a3a1745 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -579,7 +579,9 @@
     }
 
     if (hasHorizontalScrollbar != (m_horizontalScrollbar != 0) || hasVerticalScrollbar != (m_verticalScrollbar != 0)) {
+        // FIXME: Is frameRectsChanged really necessary here? Have any frame rects changed?
         frameRectsChanged();
+        positionScrollbarLayers();
         updateScrollCorner();
     }
 
@@ -817,6 +819,8 @@
         return;
 
     Widget::setFrameRect(newRect);
+
+    frameRectsChanged();
 }
 
 void ScrollView::setBoundsSize(const IntSize& newSize)
@@ -834,7 +838,7 @@
     if (!m_useFixedLayout)
         contentsResized();
 
-    frameRectsChanged();
+    positionScrollbarLayers();
 }
 
 void ScrollView::setInitialBoundsSize(const IntSize& newSize)
@@ -851,7 +855,6 @@
     HashSet<RefPtr<Widget> >::const_iterator end = m_children.end();
     for (HashSet<RefPtr<Widget> >::const_iterator current = m_children.begin(); current != end; ++current)
         (*current)->frameRectsChanged();
-    positionScrollbarLayers();
 }
 
 #if USE(ACCELERATED_COMPOSITING)