Fix GraphicsLayer visible rect computation when scrolling in WebKit1
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2012 01:17:47 +0000 (01:17 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2012 01:17:47 +0000 (01:17 +0000)
commit0d094556ff64a1240d88c04ddc9eb6473501af17
tree913894bc7485e1d81df10cc9089081358c63c4d0
parent368952642e8127656a4a340ecfdadd218ead5dbf
Fix GraphicsLayer visible rect computation when scrolling in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=99385

Reviewed by Dean Jackson, Tim Horton.

Source/WebCore:

RenderLayerCompositor always used frameView->frameRect() as the visible
rect on the root used for GraphicsLayer visibleRect computation. This
was wrong for subframes, which require a rect with an origin of (0,0)
and size of the contentsSize().

It was also wrong when the scrolling is not represented in the GraphicsLayer
tree. When scrolling is done elsewhere, we need to use the ScrollView's
visibleContentRect().

Tests: compositing/visible-rect/scrolled.html
       compositing/visible-rect/iframe-and-layers.html
       compositing/visible-rect/iframe-no-layers.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):

LayoutTests:

scrolled.html tests the visible rect after scrolling. The other tests
are for visibleRect in iframes, with and without compositing layers
in the parent document (which exercises different code paths in WebKit1).

* compositing/visible-rect/iframe-and-layers-expected.txt: Added.
* compositing/visible-rect/iframe-and-layers.html: Added.
* compositing/visible-rect/iframe-no-layers-expected.txt: Added.
* compositing/visible-rect/iframe-no-layers.html: Added.
* compositing/visible-rect/resources/subframe-with-layers.html: Added.
* compositing/visible-rect/scrolled-expected.txt: Added.
* compositing/visible-rect/scrolled.html: Added.
* platform/mac-wk2/compositing/visible-rect/iframe-no-layers-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/visible-rect/iframe-and-layers-expected.txt [new file with mode: 0644]
LayoutTests/compositing/visible-rect/iframe-and-layers.html [new file with mode: 0644]
LayoutTests/compositing/visible-rect/iframe-no-layers-expected.txt [new file with mode: 0644]
LayoutTests/compositing/visible-rect/iframe-no-layers.html [new file with mode: 0644]
LayoutTests/compositing/visible-rect/resources/subframe-with-layers.html [new file with mode: 0644]
LayoutTests/compositing/visible-rect/scrolled-expected.txt [new file with mode: 0644]
LayoutTests/compositing/visible-rect/scrolled.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/compositing/visible-rect/iframe-no-layers-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp