Have ScrollableArea store a ScrollType for the current scroll
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 00:11:08 +0000 (00:11 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 00:11:08 +0000 (00:11 +0000)
commit081c702bf2d1df11e08ffe626bd5269598d2b187
treee4f8ea5400c4f6f0067a531d736909e92f8577b6
parenta53556f6e0a1af9180621a33a441f7eef64aa743
Have ScrollableArea store a ScrollType for the current scroll
https://bugs.webkit.org/show_bug.cgi?id=196627

Reviewed by Zalan Bujtas.

Source/WebCore:

RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
so just have ScrollableArea store a ScrollType.

RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
it onto the base class.

AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.

No behavior change.

* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
(WebCore::FrameView::setWasScrolledByUser):
* page/FrameViewLayoutContext.cpp:
(WebCore::LayoutScope::LayoutScope):
(WebCore::LayoutScope::~LayoutScope):
* page/ios/FrameIOS.mm:
(WebCore::Frame::overflowScrollPositionChangedForNode):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* platform/ScrollView.cpp:
(WebCore::ScrollView::setScrollPosition):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ScrollableArea):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::currentScrollType const):
(WebCore::ScrollableArea::setCurrentScrollType):
(WebCore::ScrollableArea::setIsUserScroll): Deleted.
(WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
(WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollTo):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollOffset):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::start):

Source/WebKitLegacy/mac:

Send the programmatic scroll type.

* DOM/DOMHTML.mm:
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameViewLayoutContext.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderMarquee.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOMHTML.mm