Tell ScrollView's child Widgets that their frame rects have changed when its own...
authorAdam Roben <aroben@apple.com>
Fri, 13 May 2011 17:24:55 +0000 (17:24 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Tue, 17 May 2011 14:39:37 +0000 (11:39 -0300)
commit457a0f01f64329b3d064f4855ba9a98ce426371f
tree70347e4aee0c698db93884c8c5dcfb1f3bad1488
parent8620c0c154d60999fd0d3573047d692b1dbcc4ce
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
LayoutTests/ChangeLog
LayoutTests/platform/win/plugins/iframe-inside-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/plugins/iframe-inside-overflow.html [new file with mode: 0644]
LayoutTests/platform/win/plugins/resources/dump-window-rect-iframe.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/ScrollView.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DumpWindowRect.cpp [new file with mode: 0644]
Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj