Skip to content
  • simon.fraser@apple.com's avatar
    Fix repaint issues when resizing a window with centered content, for platforms with a tile cache · fc75029c
    simon.fraser@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@137811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    fc75029c