Implement ScrollableArea::scrollOffset()
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jun 2019 00:33:32 +0000 (00:33 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jun 2019 00:33:32 +0000 (00:33 +0000)
commit1d44c3a5e8cf94a2e4d3eb09029fab7eea343df6
treebbc171c74942e482384a76a811294b1aff0fa5c8
parent3a5d29e82fe1c58ba45d8b1faced6043d4ea7194
Implement ScrollableArea::scrollOffset()
https://bugs.webkit.org/show_bug.cgi?id=198895

Reviewed by Antti Koivisto.

Source/WebCore:

Remove from ScrollableArea the following:
    virtual int scrollSize(ScrollbarOrientation) const = 0;
    virtual int scrollOffset(ScrollbarOrientation) const = 0;
and instead implement ScrollOffset scrollOffset() const.

Also make scrollPosition() pure virtual, avoiding the reverse dependency where
this base class implementation got values from scrollbars.

scrollSize(ScrollbarOrientation) was only used by ScrollAnimatorIOS and we can
do the same computation via min/max scroll positions.

RenderListBox and PopupMenuWin need implementations of scrollPosition().

Remove some PLATFORM(IOS_FAMILY) #ifdefs from ScrollableArea for code that compiles
on all platforms.

* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::overhangAmount const):
(WebCore::ScrollView::scrollSize const): Deleted.
(WebCore::ScrollView::scrollOffset const): Deleted.
* platform/ScrollView.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::isPinnedVerticallyInDirection const):
(WebCore::ScrollableArea::scrollOffset const):
(WebCore::ScrollableArea::scrollPosition const): Deleted.
* platform/ScrollableArea.h:
(WebCore::offsetForOrientation):
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition const):
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition const):
(WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition const):
(WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition const):
(WebCore::ScrollableArea::tiledBacking const): Deleted.
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
(WebCore::Scrollbar::offsetDidChange):
* platform/ios/ScrollAnimatorIOS.mm:
(WebCore::ScrollAnimatorIOS::handleTouchEvent):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::scrollPosition const):
(WebCore::PopupMenuWin::wndProc):
(WebCore::PopupMenuWin::scrollSize const): Deleted.
(WebCore::PopupMenuWin::scrollOffset const): Deleted.
* platform/win/PopupMenuWin.h:
(WebCore::PopupMenuWin::scrollOffset const): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollSize const): Deleted.
(WebCore::RenderLayer::scrollOffset const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollPosition const):
(WebCore::RenderListBox::scrollSize const): Deleted.
(WebCore::RenderListBox::scrollOffset const): Deleted.
* rendering/RenderListBox.h:

Source/WebKit:

* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::PopupMenuWin::scrollPosition const):
(WebKit::WebPopupMenuProxyWin::onKeyDown): Just use m_scrollOffset.
(WebKit::WebPopupMenuProxyWin::scrollSize const): Deleted.
* UIProcess/win/WebPopupMenuProxyWin.h: Remove the one-axis scrollOffset()
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::scrollSize const): Deleted.
(WebKit::PDFPlugin::scrollOffset const): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.h
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/ios/ScrollAnimatorIOS.mm
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/platform/win/PopupMenuWin.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListBox.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp
Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm