Changeset 147120 in webkit


Ignore:
Timestamp:
Mar 28, 2013 8:48:28 AM (11 years ago)
Author:
wangxianzhu@chromium.org
Message:

Non-painting fixed elements should not cause repaints on scroll
https://bugs.webkit.org/show_bug.cgi?id=110430

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/repaint/scroll-fixed-layer-no-content.html
Test: compositing/repaint/scroll-fixed-layer-out-of-view.html

  • page/FrameView.cpp:

(WebCore::FrameView::scrollContentsFastPath): Check for no-content and out-of-view flag set by RLC.

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::requiresCompositingForPosition): Moved the check for no-content above out-of-view because it's faster.

LayoutTests:

  • compositing/repaint/scroll-fixed-layer-no-content.html: Added.
  • compositing/repaint/scroll-fixed-layer-no-content-expected.txt: Added.
  • compositing/repaint/scroll-fixed-layer-out-of-view.html: Added.
  • compositing/repaint/scroll-fixed-layer-out-of-view-expected.txt: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147119 r147120  
     12013-03-28  Xianzhu Wang  <wangxianzhu@chromium.org>
     2
     3        Non-painting fixed elements should not cause repaints on scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=110430
     5
     6        Reviewed by Simon Fraser.
     7
     8        * compositing/repaint/scroll-fixed-layer-no-content.html: Added.
     9        * compositing/repaint/scroll-fixed-layer-no-content-expected.txt: Added.
     10        * compositing/repaint/scroll-fixed-layer-out-of-view.html: Added.
     11        * compositing/repaint/scroll-fixed-layer-out-of-view-expected.txt: Added.
     12
    1132013-03-28  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r147118 r147120  
     12013-03-28  Xianzhu Wang  <wangxianzhu@chromium.org>
     2
     3        Non-painting fixed elements should not cause repaints on scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=110430
     5
     6        Reviewed by Simon Fraser.
     7
     8        Test: compositing/repaint/scroll-fixed-layer-no-content.html
     9        Test: compositing/repaint/scroll-fixed-layer-out-of-view.html
     10
     11        * page/FrameView.cpp:
     12        (WebCore::FrameView::scrollContentsFastPath): Check for no-content and out-of-view flag set by RLC.
     13        * rendering/RenderLayerCompositor.cpp:
     14        (WebCore::RenderLayerCompositor::requiresCompositingForPosition): Moved the check for no-content above out-of-view because it's faster.
     15
    1162013-03-28  Alexander Pavlov  <apavlov@chromium.org>
    217
  • trunk/Source/WebCore/page/FrameView.cpp

    r147039 r147120  
    16651665        ASSERT(renderer->hasLayer());
    16661666        RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
    1667        
     1667
     1668#if USE(ACCELERATED_COMPOSITING)
     1669        if (layer->viewportConstrainedNotCompositedReason() == RenderLayer::NotCompositedForBoundsOutOfView
     1670            || layer->viewportConstrainedNotCompositedReason() == RenderLayer::NotCompositedForNoVisibleContent) {
     1671            // Don't invalidate for invisible fixed layers.
     1672            continue;
     1673        }
     1674#endif
     1675
    16681676#if ENABLE(CSS_FILTERS)
    16691677        if (layer->hasAncestorWithFilterOutsets()) {
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r147039 r147120  
    21972197    }
    21982198
     2199    bool paintsContent = layer->isVisuallyNonEmpty() || layer->hasVisibleDescendant();
     2200    if (!paintsContent) {
     2201        if (viewportConstrainedNotCompositedReason)
     2202            *viewportConstrainedNotCompositedReason = RenderLayer::NotCompositedForNoVisibleContent;
     2203        return false;
     2204    }
     2205
    21992206    // Fixed position elements that are invisible in the current view don't get their own layer.
    22002207    if (FrameView* frameView = m_renderView->frameView()) {
     
    22092216    }
    22102217   
    2211     bool paintsContent = layer->isVisuallyNonEmpty() || layer->hasVisibleDescendant();
    2212     if (!paintsContent) {
    2213         if (viewportConstrainedNotCompositedReason)
    2214             *viewportConstrainedNotCompositedReason = RenderLayer::NotCompositedForNoVisibleContent;
    2215         return false;
    2216     }
    2217 
    22182218    return true;
    22192219}
Note: See TracChangeset for help on using the changeset viewer.