Fix repaint issues when resizing a window with centered content, for platforms with...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Dec 2012 22:11:27 +0000 (22:11 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Dec 2012 22:11:27 +0000 (22:11 +0000)
commitabc573f7be3f98b18d6b4a8de1b0bc4d746a11b4
treec4ff5ca0b00ccbb194cc4facd175457bc4870eca
parent858185bf4428b38a971f0c89c3422a3abe23c87d
Fix repaint issues when resizing a window with centered content, for platforms with a tile cache
https://bugs.webkit.org/show_bug.cgi?id=105073

Reviewed by Dan Bernstein.

Add a manual test for window resize with a centered element.

* ManualTests/resize-repaint.html: Added.

Source/WebCore:

There were several issues with the "do full repaint" code path in
FrameView::layout(). These caused repaint issues when resizing the web view,
especially for platforms that use a tile cache.

First, the m_doFullRepaint flag wold get clobbered on resize-layouts, because
the call to adjustViewSize() re-enters layout(), and resets the m_doFullRepaint member
variable to false, even if the outer call had previously set it to true. This would
cause us to lose track of whether we needed to do a full repaint. The patch fixes
this by restoring m_doFullRepaint to the value it had before the call to adjustViewSize().

The second problem was that full repaints would not propagate to compositing
layers. They only repainted the RenderView, and on platforms that use a tile cache,
this only repaints the top portion of that tile cache. This was fixed by sending
a NeedsFullRepaintInBacking flag down into RenderLayer::updateLayerPositions(),
and using that to do a full repaint on all compositing layers.

Sending this new flag down into updateAfterLayout() prompted some boolean/flags
cleanup with propagated into several files. This also allowed me to no longer
include RenderLayerBacking.h in RenderLayerCompositor.h, but that required
header cleanup in several files.

Automated testing is not possible because WebKitTestRunner resizes the window
asynchronously (bug 105101). Added manual test.

* page/FrameView.cpp:
(WebCore::updateLayerPositionFlags):
(WebCore::FrameView::layout):
* page/scrolling/ScrollingCoordinator.cpp:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::contentChanged):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.cpp:
* rendering/RenderView.cpp:

Source/WebKit/chromium:

Include RenderLayerBacking.h, which is no longer included by RenderLayerCompositor.h.

* tests/ScrollingCoordinatorChromiumTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
ChangeLog
ManualTests/resize-repaint.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp