Add explicit conversions between scrollOffset and scrollPostion, and use them in...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Dec 2015 20:15:27 +0000 (20:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Dec 2015 20:15:27 +0000 (20:15 +0000)
commit30d7a373c772d9f93a0a81ee3151532ac367729d
treeb01d6b09d7ac9d4ab5c19f754fbdccad5a25dfba
parent2fd66c4307553cbe39b0c9ecaf1b94d63d3b93fa
Add explicit conversions between scrollOffset and scrollPostion, and use them in a few places
https://bugs.webkit.org/show_bug.cgi?id=152594

Reviewed by Sam Weinig.

Add functions to ScrollableArea to convert between scrollPosition and scrollOffset,
and use them in places where code did the math with scrollOrigin.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::minimumScrollPosition):
(WebCore::FrameView::maximumScrollPosition): totalContentsSize().width() == contentsWidth(),
so we can use the base class maximumScrollPosition(), which also clamps.
* platform/ScrollView.cpp:
(WebCore::ScrollView::maximumScrollPosition):
(WebCore::ScrollView::setScrollOffset):
(WebCore::ScrollView::overhangAmount):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::calculateOverhangAreasForPainting):
(WebCore::ScrollView::minimumScrollPosition): Deleted. Can use base class implementation.
* platform/ScrollView.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::minimumScrollPosition):
(WebCore::ScrollableArea::maximumScrollPosition):
(WebCore::ScrollableArea::maximumScrollOffset):
(WebCore::ScrollableArea::scrollPositionFromOffset):
(WebCore::ScrollableArea::scrollOffsetFromPosition):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::scrollOrigin):
(WebCore::ScrollableArea::scrollOriginChanged):
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::unobscuredContentRect):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::pinnedInDirection):
(WebCore::ScrollAnimatorMac::absoluteScrollPosition):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollPosition):
(WebCore::RenderLayer::maximumScrollPosition):
(WebCore::RenderLayer::overhangAmount):
(WebCore::RenderLayer::minimumScrollPosition): Deleted.
* rendering/RenderLayer.h:

Source/WebKit2:

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/ios/ScrollViewIOS.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm