Skip to content
Permalink
Browse files
Have a single notion of scroll position in the scrolling tree and der…
…ive layoutViewport from it

https://bugs.webkit.org/show_bug.cgi?id=194973

Reviewed by Antti Koivisto.

This patch cleans up how the scrolling tree responds to scrolls.

First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
UI process scroll position.

On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
updates related layers on this node (counter-scrolling layers etc), and then tells the
scrolling tree, which recurses through descendant nodes so they can adjust their layer
positions.

On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
which does the above other than setting scrolledContentsLayer (since we're reacting to
layer state changes, not producing them).

updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
ScrollingTree does the tree walk so classes don't have to implement
updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
need to cross frame boundaries).

We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
since the fixed state was computed with the "layout" scroll position, so we have to account
for the scroll delta since the last committed position. It's possible we could improve this
in future.

Source/WebCore:

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
(WebCore::ScrollingTree::notifyRelatedNodesRecursive):
(WebCore::ScrollingTree::mainFrameLayoutViewport):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
(WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollTo):
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
(WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
(WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
(WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
(WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
(): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):

Source/WebKit:

* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
(WebKit::ScrollerPairMac::updateValues):
(WebKit::ScrollerPairMac::valuesForOrientation):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

Canonical link: https://commits.webkit.org/209451@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed Feb 27, 2019
1 parent 526ffa7 commit f3ca6c49bba4cb6e8f65eafe90334069beb64c5f
Showing 53 changed files with 557 additions and 475 deletions.
@@ -35,7 +35,7 @@
<body>
<p>This test passes if you see a green rectangle.</p>
<div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
<iframe id="clickInContentBox" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<iframe id="clickInContentBox" style="left: 0px; top: 0px; -webkit-tap-highlight-color: transparent;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<body style='margin: 0; width: 200px; height: 200px;'>
<div style='position: absolute; width: 100px; height: 100px; background: red; -webkit-tap-highlight-color: transparent;'
onclick='this.style.background=&quot;green&quot;'></div>
@@ -35,7 +35,7 @@
<body>
<p>This test passes if you see a green rectangle.</p>
<div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
<iframe id="clickInPaddingBoxOutOfContentBox" style="left: 0px; top: 0px; background: red;" onclick="this.style.background='green'" scrolling="yes" srcdoc="
<iframe id="clickInPaddingBoxOutOfContentBox" style="left: 0px; top: 0px; background: red; -webkit-tap-highlight-color: transparent;" onclick="this.style.background='green;'" scrolling="yes" srcdoc="
<body style='margin: 0; width: 200px; height: 200px'>
<div style='position: absolute; width: 100px; height: 100px; background: green; -webkit-tap-highlight-color: transparent;'
onclick='this.style.background=&quot;red&quot;'></div>
@@ -35,13 +35,13 @@
<body>
<p>This test passes if you see a green rectangle.</p>
<div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
<iframe id="clickElementAboveFrame" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<iframe id="clickElementAboveFrame" style="left: 0px; top: 0px; -webkit-tap-highlight-color: transparent;" scrolling="yes" onclick="this.style.background='red';" srcdoc="
<body style='margin: 0; width: 200px; height: 200px; background: green;'>
<div style='position: absolute; width: 100px; height: 100px; background: green; -webkit-tap-highlight-color: transparent;'
onclick='this.style.background=&quot;red&quot;'></div>
</body>" onload="runTest()">
</iframe>
<div style="position: absolute; width: 50px; height: 50px; left: 25px; top: 25px; background: red" onclick="this.style.background='green';"></div>
<div style="position: absolute; width: 50px; height: 50px; left: 25px; top: 25px; background: red; -webkit-tap-highlight-color: transparent" onclick="this.style.background='green';"></div>
</div>
</body>
</html>
@@ -35,7 +35,7 @@
<body>
<p>This test passes if you see a green rectangle.</p>
<div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
<iframe id="clickElementInsideFrame" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<iframe id="clickElementInsideFrame" style="left: 0px; top: 0px; -webkit-tap-highlight-color: transparent;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<body style='margin: 0; width: 200px; height: 200px; background: green;'>
<div style='position: absolute; left: 10px; top: 10px; width: 50px; height: 50px; background: red; -webkit-tap-highlight-color: transparent;'
onclick='this.style.background=&quot;green&quot;'></div>
@@ -37,7 +37,7 @@
<body>
<p>This test passes if you see a green rectangle.</p>
<div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
<iframe id="clickElementInsideFrameAfterProgrammaticScroll" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<iframe id="clickElementInsideFrameAfterProgrammaticScroll" style="left: 0px; top: 0px; -webkit-tap-highlight-color: transparent;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<body style='margin: 0; width: 200px; height: 200px; background: green;'>
<div style='position: absolute; width: 75px; height: 75px; background: red;'></div>
<div style='position: absolute; left: 110px; top: 110px; width: 50px; height: 50px; background: red; -webkit-tap-highlight-color: transparent;'
@@ -45,7 +45,7 @@
<body>
<p>This test passes if you see a green rectangle.</p>
<div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
<iframe id="clickElementInsideFrameAfterUserScroll" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<iframe id="clickElementInsideFrameAfterUserScroll" style="left: 0px; top: 0px; -webkit-tap-highlight-color: transparent;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
<body style='margin: 0; width: 200px; height: 200px; background: green;'>
<div style='position: absolute; width: 75px; height: 75px; background: red;'></div>
<div style='position: absolute; left: 0px; top: 150px; width: 50px; height: 50px; background: red; -webkit-tap-highlight-color: transparent;'
@@ -1075,6 +1075,7 @@ webkit.org/b/156620 legacy-animation-engine/fast/animation/request-animation-fra
webkit.org/b/153049 perf/array-binary-search.html [ Pass Failure Timeout ]

fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html [ Pass Failure ]
webkit.org/b/195108 fast/scrolling/ios/hit-testing-iframe-002.html [ ImageOnlyFailure ]

webkit.org/b/157589 fast/text-autosizing/ios/text-autosizing-after-back.html [ Pass Timeout ]

@@ -1,3 +1,161 @@
2019-02-26 Simon Fraser <simon.fraser@apple.com>

Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
https://bugs.webkit.org/show_bug.cgi?id=194973

Reviewed by Antti Koivisto.

This patch cleans up how the scrolling tree responds to scrolls.

First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
UI process scroll position.

On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
updates related layers on this node (counter-scrolling layers etc), and then tells the
scrolling tree, which recurses through descendant nodes so they can adjust their layer
positions.

On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
which does the above other than setting scrolledContentsLayer (since we're reacting to
layer state changes, not producing them).

updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
ScrollingTree does the tree walk so classes don't have to implement
updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
need to cross frame boundaries).

We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
since the fixed state was computed with the "layout" scroll position, so we have to account
for the scroll delta since the last committed position. It's possible we could improve this
in future.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
(WebCore::ScrollingTree::notifyRelatedNodesRecursive):
(WebCore::ScrollingTree::mainFrameLayoutViewport):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
(WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollTo):
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
(WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
(WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
(WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
(WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
(): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):

2019-02-22 Simon Fraser <simon.fraser@apple.com>

Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
https://bugs.webkit.org/show_bug.cgi?id=194973

Reviewed by Antti Koivisto.

The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
and require different code for each scrolling node subclass, and adds a choke point that we can use to update
the layout viewport.

We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
an alias for the scroll position.

Add some isRootNode() checks for things that should only affect the main frame.

* page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
no sense here.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
(WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
(WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPosition):
(WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
(WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::scrollPosition const):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.

2019-02-27 Ulrich Pflueger <up@nanocosmos.de>

[MSE] SourceBuffer sample time increment vs. last frame duration check is broken

0 comments on commit f3ca6c4

Please sign in to comment.