Changeset 169410 in webkit


Ignore:
Timestamp:
May 27, 2014 9:44:54 PM (10 years ago)
Author:
Simon Fraser
Message:

Do some renaming in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=133333

Reviewed by Tim Horton.

Source/WebCore:

Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
since this goes deep and to indicate that it's about layer updating.

Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
this is the custom fixed-position rect that changes on zooming.

  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):

  • page/scrolling/ScrollingTree.h:
  • page/scrolling/ScrollingTreeFrameScrollingNode.h:
  • page/scrolling/ScrollingTreeNode.h:
  • page/scrolling/ScrollingTreeScrollingNode.h:
  • page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
  • page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:

(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):

  • page/scrolling/mac/ScrollingTreeFixedNode.h:
  • page/scrolling/mac/ScrollingTreeFixedNode.mm:

(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeFixedNode::parentScrollPositionDidChange): Deleted.

  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):

  • page/scrolling/mac/ScrollingTreeStickyNode.h:
  • page/scrolling/mac/ScrollingTreeStickyNode.mm:

(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeStickyNode::parentScrollPositionDidChange): Deleted.

Source/WebKit2:

Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
since this goes deep and to indicate that it's about layer updating.

Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
this is the custom fixed-position rect that changes on zooming.

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
  • UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:

(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):

Location:
trunk/Source
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r169409 r169410  
     12014-05-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Do some renaming in the scrolling tree
     4        https://bugs.webkit.org/show_bug.cgi?id=133333
     5
     6        Reviewed by Tim Horton.
     7
     8        Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
     9        since this goes deep and to indicate that it's about layer updating.
     10       
     11        Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
     12        this is the custom fixed-position rect that changes on zooming.
     13
     14        * page/scrolling/ScrollingTree.cpp:
     15        (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
     16        * page/scrolling/ScrollingTree.h:
     17        * page/scrolling/ScrollingTreeFrameScrollingNode.h:
     18        * page/scrolling/ScrollingTreeNode.h:
     19        * page/scrolling/ScrollingTreeScrollingNode.h:
     20        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
     21        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
     22        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange):
     23        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
     24        * page/scrolling/mac/ScrollingTreeFixedNode.h:
     25        * page/scrolling/mac/ScrollingTreeFixedNode.mm:
     26        (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
     27        (WebCore::ScrollingTreeFixedNode::parentScrollPositionDidChange): Deleted.
     28        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
     29        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     30        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
     31        * page/scrolling/mac/ScrollingTreeStickyNode.h:
     32        * page/scrolling/mac/ScrollingTreeStickyNode.mm:
     33        (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
     34        (WebCore::ScrollingTreeStickyNode::parentScrollPositionDidChange): Deleted.
     35
    1362014-05-27  Simon Fraser  <simon.fraser@apple.com>
    237
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r169063 r169410  
    9999}
    100100
    101 void ScrollingTree::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatRect& viewportRect, double scale)
     101void ScrollingTree::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatRect& fixedPositionRect, double scale)
    102102{
    103103    ScrollingTreeNode* node = nodeForID(nodeID);
     
    108108        return;
    109109
    110     toScrollingTreeScrollingNode(node)->updateLayersAfterViewportChange(viewportRect, scale);
     110    toScrollingTreeScrollingNode(node)->updateLayersAfterViewportChange(fixedPositionRect, scale);
    111111}
    112112
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r168338 r169410  
    8181    // Delegated scrolling/zooming has caused the viewport to change, so update viewport-constrained layers
    8282    // (but don't cause scroll events to be fired).
    83     virtual void viewportChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatRect& viewportRect, double scale);
     83    virtual void viewportChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatRect& fixedPositionRect, double scale);
    8484
    8585    // Delegated scrolling has scrolled a node. Update layer positions on descendant tree nodes,
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h

    r169312 r169410  
    4444   
    4545    // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children.
    46     virtual void parentScrollPositionDidChange(const FloatRect& /*viewportRect*/, const FloatSize& /*cumulativeDelta*/) override { }
     46    virtual void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /*fixedPositionRect*/, const FloatSize& /*cumulativeDelta*/) override { }
    4747
    4848    virtual void handleWheelEvent(const PlatformWheelEvent&) = 0;
     
    5050    virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) = 0;
    5151
    52     virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) = 0;
     52    virtual void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) = 0;
    5353    virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { }
    5454
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.h

    r169063 r169410  
    5656    virtual void updateAfterChildren(const ScrollingStateNode&) { }
    5757
    58     virtual void parentScrollPositionDidChange(const FloatRect& viewportRect, const FloatSize& cumulativeDelta) = 0;
     58    virtual void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) = 0;
    5959
    6060    ScrollingTreeNode* parent() const { return m_parent; }
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h

    r169313 r169410  
    4848
    4949    // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children.
    50     virtual void parentScrollPositionDidChange(const FloatRect& /*viewportRect*/, const FloatSize& /*cumulativeDelta*/) override { }
     50    virtual void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /*fixedPositionRect*/, const FloatSize& /*cumulativeDelta*/) override { }
    5151
    5252    virtual void handleWheelEvent(const PlatformWheelEvent&) = 0;
     
    5454    virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&);
    5555
    56     virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) = 0;
     56    virtual void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) = 0;
    5757    virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { }
    5858
  • trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h

    r169312 r169410  
    5252    virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override;
    5353
    54     virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale);
     54    virtual void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale);
    5555    virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) override;
    5656
  • trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm

    r169312 r169410  
    127127}
    128128
    129 void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange(const FloatRect& viewportRect, double /*scale*/)
    130 {
    131     [m_counterScrollingLayer setPosition:viewportRect.location()];
     129void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double /*scale*/)
     130{
     131    // Note: we never currently have a m_counterScrollingLayer (which is used for background-attachment:fixed) on iOS.
     132    [m_counterScrollingLayer setPosition:fixedPositionRect.location()];
    132133
    133134    if (!m_children)
     
    136137    size_t size = m_children->size();
    137138    for (size_t i = 0; i < size; ++i)
    138         m_children->at(i)->parentScrollPositionDidChange(viewportRect, FloatSize());
     139        m_children->at(i)->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
    139140}
    140141
     
    170171    if (!m_children)
    171172        return;
    172    
     173
    173174    viewportRect.setLocation(scrollOffset);
    174    
     175
    175176    FloatRect viewportConstrainedObjectsRect = FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(viewportRect), roundedLayoutSize(totalContentsSize()), frameScaleFactor(), false, behaviorForFixed);
    176    
     177
    177178    size_t size = m_children->size();
    178179    for (size_t i = 0; i < size; ++i)
    179         m_children->at(i)->parentScrollPositionDidChange(viewportConstrainedObjectsRect, FloatSize());
     180        m_children->at(i)->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
    180181}
    181182
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h

    r166293 r169410  
    4949
    5050    virtual void updateBeforeChildren(const ScrollingStateNode&) override;
    51     virtual void parentScrollPositionDidChange(const FloatRect& viewportRect, const FloatSize& cumulativeDelta) override;
     51    virtual void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;
    5252
    5353    FixedPositionViewportConstraints m_constraints;
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm

    r163231 r169410  
    6565}
    6666
    67 void ScrollingTreeFixedNode::parentScrollPositionDidChange(const FloatRect& viewportRect, const FloatSize& cumulativeDelta)
     67void ScrollingTreeFixedNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)
    6868{
    69     FloatPoint layerPosition = m_constraints.layerPositionForViewportRect(viewportRect);
     69    FloatPoint layerPosition = m_constraints.layerPositionForViewportRect(fixedPositionRect);
    7070    layerPosition -= cumulativeDelta;
    7171
     
    8282    size_t size = m_children->size();
    8383    for (size_t i = 0; i < size; ++i)
    84         m_children->at(i)->parentScrollPositionDidChange(viewportRect, newDelta);
     84        m_children->at(i)->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, newDelta);
    8585}
    8686
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h

    r169312 r169410  
    7070    virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override;
    7171
    72     virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) override;
     72    virtual void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override;
    7373
    7474    virtual void setScrollLayerPosition(const FloatPoint&) override;
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm

    r169312 r169410  
    350350    FloatRect viewportRect(FloatPoint(), scrollableAreaSize());
    351351   
    352     // FIXME: scrollOffsetForFixedPosition() needs to do float math.
    353352    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect),
    354353        roundedLayoutSize(totalContentsSize()), roundedLayoutPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
     
    411410    size_t size = m_children->size();
    412411    for (size_t i = 0; i < size; ++i)
    413         m_children->at(i)->parentScrollPositionDidChange(viewportRect, FloatSize());
     412        m_children->at(i)->updateLayersAfterAncestorChange(*this, viewportRect, FloatSize());
    414413}
    415414
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h

    r166293 r169410  
    4949
    5050    virtual void updateBeforeChildren(const ScrollingStateNode&) override;
    51     virtual void parentScrollPositionDidChange(const FloatRect& viewportRect, const FloatSize& cumulativeDelta) override;
     51    virtual void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;
    5252
    5353    StickyPositionViewportConstraints m_constraints;
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm

    r163231 r169410  
    6565}
    6666
    67 void ScrollingTreeStickyNode::parentScrollPositionDidChange(const FloatRect& viewportRect, const FloatSize& cumulativeDelta)
     67void ScrollingTreeStickyNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)
    6868{
    69     FloatPoint layerPosition = m_constraints.layerPositionForConstrainingRect(viewportRect);
     69    FloatPoint layerPosition = m_constraints.layerPositionForConstrainingRect(fixedPositionRect);
    7070
    7171    // FIXME: Subtracting the cumulativeDelta is not totally sufficient to get the new position right for nested
     
    8686    size_t size = m_children->size();
    8787    for (size_t i = 0; i < size; ++i)
    88         m_children->at(i)->parentScrollPositionDidChange(viewportRect, newDelta);
     88        m_children->at(i)->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, newDelta);
    8989}
    9090
  • trunk/Source/WebKit2/ChangeLog

    r169405 r169410  
     12014-05-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Do some renaming in the scrolling tree
     4        https://bugs.webkit.org/show_bug.cgi?id=133333
     5
     6        Reviewed by Tim Horton.
     7       
     8        Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
     9        since this goes deep and to indicate that it's about layer updating.
     10       
     11        Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
     12        this is the custom fixed-position rect that changes on zooming.
     13
     14        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
     15        (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
     16        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
     17        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
     18        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
     19
    1202014-05-27  Geoffrey Garen  <ggaren@apple.com>
    221
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp

    r169123 r169410  
    155155}
    156156
    157 void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatRect& viewportRect, double scale)
     157void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatRect& fixedPositionRect, double scale)
    158158{
    159     m_scrollingTree->viewportChangedViaDelegatedScrolling(nodeID, viewportRect, scale);
     159    m_scrollingTree->viewportChangedViaDelegatedScrolling(nodeID, fixedPositionRect, scale);
    160160}
    161161
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h

    r168338 r169410  
    5959
    6060    // Called externally when native views move around.
    61     void viewportChangedViaDelegatedScrolling(WebCore::ScrollingNodeID, const WebCore::FloatRect& viewportRect, double scale);
     61    void viewportChangedViaDelegatedScrolling(WebCore::ScrollingNodeID, const WebCore::FloatRect& fixedPositionRect, double scale);
    6262
    6363    // FIXME: expose the tree and pass this to that?
  • trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h

    r169313 r169410  
    5555    virtual void setScrollLayerPosition(const WebCore::FloatPoint&) override;
    5656
    57     virtual void updateLayersAfterViewportChange(const WebCore::FloatRect& viewportRect, double scale) { }
     57    virtual void updateLayersAfterViewportChange(const WebCore::FloatRect& fixedPositionRect, double scale) { }
    5858    virtual void handleWheelEvent(const WebCore::PlatformWheelEvent&) override { }
    5959
Note: See TracChangeset for help on using the changeset viewer.