Changeset 171498 in webkit


Ignore:
Timestamp:
Jul 23, 2014 5:23:03 PM (10 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
https://bugs.webkit.org/show_bug.cgi?id=135221

Reviewed by Tim Horton.

Source/WebCore:

Add a function on GraphicsLayer to force a flush of the layer position
to the underlying graphics system, so that when layers cease being
scroll-coordinated, we can ensure that their layers are repositioned
in the correct location.

  • WebCore.exp.in:
  • platform/graphics/GraphicsLayer.h:

(WebCore::GraphicsLayer::forcePositionUpdate):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::forcePositionUpdate):

  • platform/graphics/ca/GraphicsLayerCA.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):

Source/WebKit2:

The call to didCommitLayerTree() can cause one or two visible rect updates,
via changes to the UIScrollView contentSize and contentOffset. As a result, we
would notify the scrolling tree about a viewport change, but using the old
scrolling tree rather than the new one, so we could move layers around for
nodes which are about to be removed from the tree.

Fix by m_webPageProxy->didCommitLayerTree() after the scrolling tree has been
committed.

  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:

(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r171497 r171498  
     12014-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
     4        https://bugs.webkit.org/show_bug.cgi?id=135221
     5
     6        Reviewed by Tim Horton.
     7
     8        Add a function on GraphicsLayer to force a flush of the layer position
     9        to the underlying graphics system, so that when layers cease being
     10        scroll-coordinated, we can ensure that their layers are repositioned
     11        in the correct location.
     12
     13        * WebCore.exp.in:
     14        * platform/graphics/GraphicsLayer.h:
     15        (WebCore::GraphicsLayer::forcePositionUpdate):
     16        * platform/graphics/ca/GraphicsLayerCA.cpp:
     17        (WebCore::GraphicsLayerCA::forcePositionUpdate):
     18        * platform/graphics/ca/GraphicsLayerCA.h:
     19        * rendering/RenderLayerCompositor.cpp:
     20        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
     21
    1222014-07-23  Pratik Solanki  <psolanki@apple.com>
    223
  • trunk/Source/WebCore/WebCore.exp.in

    r171345 r171498  
    580580__ZN7WebCore15GraphicsLayerCA18setReplicatedLayerEPNS_13GraphicsLayerE
    581581__ZN7WebCore15GraphicsLayerCA18setShowDebugBorderEb
     582__ZN7WebCore15GraphicsLayerCA19forcePositionUpdateEv
    582583__ZN7WebCore15GraphicsLayerCA19setContentsToCanvasEP7CALayer
    583584__ZN7WebCore15GraphicsLayerCA19setCustomAppearanceENS_13GraphicsLayer16CustomAppearanceE
     
    29632964#endif
    29642965
     2966#if USE(CONTENT_FILTERING)
     2967__ZN7WebCore13ContentFilter6decodeEP17NSKeyedUnarchiverRS0_
     2968__ZN7WebCore13ContentFilterC1Ev
     2969__ZN7WebCore13ContentFilterD1Ev
     2970__ZNK7WebCore13ContentFilter6encodeEP15NSKeyedArchiver
     2971#endif
     2972
     2973#if USE(CONTENT_FILTERING) && PLATFORM(IOS)
     2974__ZN7WebCore13ContentFilter43handleUnblockRequestAndDispatchIfSuccessfulERKNS_15ResourceRequestENSt3__18functionIFvvEEE
     2975#endif
     2976
    29652977#if ENABLE(CONTEXT_MENUS)
    29662978__ZN7WebCore11ContextMenu22setPlatformDescriptionEP14NSMutableArray
     
    34663478__ZN7WebCore4Page11setViewModeENS0_8ViewModeE
    34673479#endif
    3468 
    3469 #if USE(CONTENT_FILTERING)
    3470 #if PLATFORM(IOS)
    3471 __ZN7WebCore13ContentFilter43handleUnblockRequestAndDispatchIfSuccessfulERKNS_15ResourceRequestENSt3__18functionIFvvEEE
    3472 #endif
    3473 __ZN7WebCore13ContentFilter6decodeEP17NSKeyedUnarchiverRS0_
    3474 __ZN7WebCore13ContentFilterC1Ev
    3475 __ZN7WebCore13ContentFilterD1Ev
    3476 __ZNK7WebCore13ContentFilter6encodeEP15NSKeyedArchiver
    3477 #endif
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r170462 r171498  
    292292    virtual void setPosition(const FloatPoint& p) { m_position = p; }
    293293
     294    // Ensure that the position is flushed to the underlying graphics framework.
     295    virtual void forcePositionUpdate() { }
     296
    294297    // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state.
    295298    virtual void syncPosition(const FloatPoint& p) { m_position = p; }
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r170462 r171498  
    503503}
    504504
     505void GraphicsLayerCA::forcePositionUpdate()
     506{
     507    noteLayerPropertyChanged(GeometryChanged);
     508}
     509
    505510void GraphicsLayerCA::setAnchorPoint(const FloatPoint3D& point)
    506511{
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r170462 r171498  
    8181
    8282    virtual void setPosition(const FloatPoint&) override;
     83    virtual void forcePositionUpdate() override;
     84
    8385    virtual void setAnchorPoint(const FloatPoint3D&) override;
    8486    virtual void setSize(const FloatSize&) override;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r171494 r171498  
    37603760        m_scrollingNodeToLayerMap.remove(nodeID);
    37613761
    3762     if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(FixedNode))
     3762    if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(FixedNode)) {
    37633763        m_scrollingNodeToLayerMap.remove(nodeID);
     3764        backing->graphicsLayer()->forcePositionUpdate();
     3765    }
    37643766
    37653767    backing->detachFromScrollingCoordinator();
  • trunk/Source/WebKit2/ChangeLog

    r171493 r171498  
     12014-07-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
     4        https://bugs.webkit.org/show_bug.cgi?id=135221
     5
     6        Reviewed by Tim Horton.
     7       
     8        The call to didCommitLayerTree() can cause one or two visible rect updates,
     9        via changes to the UIScrollView contentSize and contentOffset. As a result, we
     10        would notify the scrolling tree about a viewport change, but using the old
     11        scrolling tree rather than the new one, so we could move layers around for
     12        nodes which are about to be removed from the tree.
     13       
     14        Fix by m_webPageProxy->didCommitLayerTree() after the scrolling tree has been
     15        committed.
     16
     17        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
     18        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
     19
    1202014-07-23  Oliver Hunt  <oliver@apple.com>
    221
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm

    r171191 r171498  
    201201        m_webPageProxy->setAcceleratedCompositingRootLayer(m_remoteLayerTreeHost.rootLayer());
    202202
    203 #if PLATFORM(IOS)
    204     m_webPageProxy->didCommitLayerTree(layerTreeTransaction);
    205 #endif
    206 
    207203#if ENABLE(ASYNC_SCROLLING)
    208204    bool fixedOrStickyLayerChanged = false;
     
    217213#endif
    218214#endif // ENABLE(ASYNC_SCROLLING)
     215
     216#if PLATFORM(IOS)
     217    m_webPageProxy->didCommitLayerTree(layerTreeTransaction);
     218#endif
    219219
    220220    if (m_debugIndicatorLayerTreeHost) {
Note: See TracChangeset for help on using the changeset viewer.