Changeset 133807 in webkit


Ignore:
Timestamp:
Nov 7, 2012 2:27:12 PM (11 years ago)
Author:
Beth Dakin
Message:

https://bugs.webkit.org/show_bug.cgi?id=101303
Fixed position elements that are out of view still end up forcing
non-threaded scrolling
-and corresponding-
<rdar://problem/12642222>

Reviewed by Simon Fraser.

Source/WebCore:

Re-name hasNonLayerFixedObjects() to
hasVisibleSlowRepaintFixedObjects() and make it virtual.

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::hasVisibleSlowRepaintFixedObjects):
(WebCore::ScrollingCoordinator::mainThreadScrollingReasons):

  • page/scrolling/ScrollingCoordinator.h:

(ScrollingCoordinator):

Override hasVisibleSlowRepaintFixedObjects() to always return false.
We don't want to bother with the extra computation in the
ScrollingCoordinator implementation, though other ports might still
want it.

  • page/scrolling/mac/ScrollingCoordinatorMac.h:

(WebCore::ScrollingCoordinatorMac::hasVisibleSlowRepaintFixedObjects):
(ScrollingCoordinatorMac):

Make this function const so that we can call it from
requiresCompositingForPosition().

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::calculateCompositedBounds):

Actually be thorough here and check if the fixed object has any
descendants that are visible in the view. If it does, then we do
want to composite the fixed object.
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

  • rendering/RenderLayerCompositor.h:

LayoutTests:

New tests for an invisible fixed object that has visible children.

  • compositing/absolute-inside-out-of-view-fixed-expected.txt: Added.
  • compositing/absolute-inside-out-of-view-fixed.html: Added.
  • platform/mac/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt: Added.
  • platform/mac/tiled-drawing/fixed/absolute-inside-out-of-view-fixed.html: Added.

Updated results because these tests can now scroll on the scrolling
thread, yay!

  • platform/mac/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt:
  • platform/mac/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
Location:
trunk
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r133801 r133807  
     12012-11-07  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=101303
     4        Fixed position elements that are out of view still end up forcing
     5        non-threaded scrolling
     6        -and corresponding-
     7        <rdar://problem/12642222>
     8
     9        Reviewed by Simon Fraser.
     10
     11        New tests for an invisible fixed object that has visible children.
     12        * compositing/absolute-inside-out-of-view-fixed-expected.txt: Added.
     13        * compositing/absolute-inside-out-of-view-fixed.html: Added.
     14        * platform/mac/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt: Added.
     15        * platform/mac/tiled-drawing/fixed/absolute-inside-out-of-view-fixed.html: Added.
     16
     17        Updated results because these tests can now scroll on the scrolling
     18        thread, yay!
     19        * platform/mac/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt:
     20        * platform/mac/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
     21
    1222012-11-07  Philip Rogers  <pdr@google.com>
    223
  • trunk/LayoutTests/platform/mac/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt

    r133536 r133807  
    22  (viewport rect 0 0 785 600)
    33  (contents size 785 1021)
    4   (Scrolling on main thread because: Has non-layer fixed objects, )
    54  (children 1
    65    (Fixed node
  • trunk/LayoutTests/platform/mac/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt

    r133536 r133807  
    22  (viewport rect 0 0 785 600)
    33  (contents size 785 1021)
    4   (Scrolling on main thread because: Has non-layer fixed objects, )
    54  (children 1
    65    (Fixed node
  • trunk/Source/WebCore/ChangeLog

    r133806 r133807  
     12012-11-07  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=101303
     4        Fixed position elements that are out of view still end up forcing
     5        non-threaded scrolling
     6        -and corresponding-
     7        <rdar://problem/12642222>
     8
     9        Reviewed by Simon Fraser.
     10
     11        Re-name hasNonLayerFixedObjects() to
     12        hasVisibleSlowRepaintFixedObjects() and make it virtual.
     13        * page/scrolling/ScrollingCoordinator.cpp:
     14        (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintFixedObjects):
     15        (WebCore::ScrollingCoordinator::mainThreadScrollingReasons):
     16        * page/scrolling/ScrollingCoordinator.h:
     17        (ScrollingCoordinator):
     18
     19        Override hasVisibleSlowRepaintFixedObjects() to always return false.
     20        We don't want to bother with the extra computation in the
     21        ScrollingCoordinator implementation, though other ports might still
     22        want it.
     23        * page/scrolling/mac/ScrollingCoordinatorMac.h:
     24        (WebCore::ScrollingCoordinatorMac::hasVisibleSlowRepaintFixedObjects):
     25        (ScrollingCoordinatorMac):
     26
     27        Make this function const so that we can call it from
     28        requiresCompositingForPosition().
     29        * rendering/RenderLayerCompositor.cpp:
     30        (WebCore::RenderLayerCompositor::calculateCompositedBounds):
     31
     32        Actually be thorough here and check if the fixed object has any
     33        descendants that are visible in the view. If it does, then we do
     34        want to composite the fixed object.
     35        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
     36        * rendering/RenderLayerCompositor.h:
     37
    1382012-11-07  Roger Fong  <roger_fong@apple.com>
    239
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r133536 r133807  
    265265#endif
    266266
    267 bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView) const
     267bool ScrollingCoordinator::hasVisibleSlowRepaintFixedObjects(FrameView* frameView) const
    268268{
    269269    const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView->viewportConstrainedObjects();
     
    298298    if (!supportsFixedPositionLayers() && frameView->hasViewportConstrainedObjects())
    299299        mainThreadScrollingReasons |= HasViewportConstrainedObjectsWithoutSupportingFixedLayers;
    300     if (supportsFixedPositionLayers() && hasNonLayerFixedObjects(frameView))
     300    if (supportsFixedPositionLayers() && hasVisibleSlowRepaintFixedObjects(frameView))
    301301        mainThreadScrollingReasons |= HasNonLayerFixedObjects;
    302302    if (m_page->mainFrame()->document()->isImageDocument())
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r133779 r133807  
    156156    virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons) { }
    157157
    158     bool hasNonLayerFixedObjects(FrameView*) const;
     158    virtual bool hasVisibleSlowRepaintFixedObjects(FrameView*) const;
    159159    void updateShouldUpdateScrollLayerPositionOnMainThread();
    160160
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h

    r133536 r133807  
    9393    virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons);
    9494
     95    virtual bool hasVisibleSlowRepaintFixedObjects(FrameView*) const { return false; }
     96
    9597    void ensureRootStateNodeForFrameView(FrameView*);
    9698    ScrollingStateNode* stateNodeForID(ScrollingNodeID);
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r133536 r133807  
    662662// The bounds of the GraphicsLayer created for a compositing layer is the union of the bounds of all the descendant
    663663// RenderLayers that are rendered by the composited RenderLayer.
    664 IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer)
     664IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer) const
    665665{
    666666    if (!canBeComposited(layer))
     
    19481948
    19491949    // Fixed position elements that are invisible in the current view don't get their own layer.
    1950     FrameView* frameView = m_renderView->frameView();
    1951     if (frameView && !layer->absoluteBoundingBox().intersects(IntRect(IntPoint(frameView->scrollOffsetForFixedPosition()), frameView->layoutSize())))
    1952         return false;
     1950    if (FrameView* frameView = m_renderView->frameView()) {
     1951        IntRect viewBounds = IntRect(IntPoint(frameView->scrollOffsetForFixedPosition()), frameView->layoutSize());
     1952        IntRect layerBounds = calculateCompositedBounds(layer, rootRenderLayer());
     1953        if (!viewBounds.intersects(layerBounds))
     1954            return false;
     1955    }
    19531956
    19541957    return true;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r133536 r133807  
    131131    // Return the bounding box required for compositing layer and its childern, relative to ancestorLayer.
    132132    // If layerBoundingBox is not 0, on return it contains the bounding box of this layer only.
    133     IntRect calculateCompositedBounds(const RenderLayer*, const RenderLayer* ancestorLayer);
     133    IntRect calculateCompositedBounds(const RenderLayer*, const RenderLayer* ancestorLayer) const;
    134134
    135135    // Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
Note: See TracChangeset for help on using the changeset viewer.