Commit 49c0f278 authored by andersca@apple.com's avatar andersca@apple.com

Add and use ScrollElasticityControllerClient::absoluteScrollPosition

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

Reviewed by Dan Bernstein.

* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::absoluteScrollPosition):
(WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
* platform/mac/ScrollElasticityController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e45e18f7
2012-01-06 Anders Carlsson <andersca@apple.com>
Add and use ScrollElasticityControllerClient::absoluteScrollPosition
https://bugs.webkit.org/show_bug.cgi?id=75744
Reviewed by Dan Bernstein.
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::absoluteScrollPosition):
(WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
* platform/mac/ScrollElasticityController.h:
2012-01-06 Adam Barth <abarth@webkit.org>
Move FrameDestructionObserver to its own file
......@@ -130,6 +130,7 @@ private:
virtual bool pinnedInDirection(const FloatSize&) OVERRIDE;
virtual bool canScrollHorizontally() OVERRIDE;
virtual bool canScrollVertically() OVERRIDE;
virtual WebCore::IntPoint absoluteScrollPosition() OVERRIDE;
virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE;
virtual void immediateScrollBy(const FloatSize&) OVERRIDE;
virtual void startSnapRubberbandTimer() OVERRIDE;
......
......@@ -1068,6 +1068,11 @@ bool ScrollAnimatorMac::canScrollVertically()
return scrollbar->enabled();
}
IntPoint ScrollAnimatorMac::absoluteScrollPosition()
{
return m_scrollableArea->visibleContentRect().location() + m_scrollableArea->scrollOrigin();
}
void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& delta)
{
m_scrollableArea->setConstrainsScrollingToContentEdge(false);
......@@ -1350,7 +1355,7 @@ void ScrollAnimatorMac::snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*)
return;
}
m_scrollElasticityController.m_origOrigin = (m_scrollableArea->visibleContentRect().location() + m_scrollableArea->scrollOrigin()) - m_scrollElasticityController.m_startStretch;
m_scrollElasticityController.m_origOrigin = m_scrollElasticityController.m_client->absoluteScrollPosition() - m_scrollElasticityController.m_startStretch;
m_scrollElasticityController.m_origVelocity = m_scrollElasticityController.m_momentumVelocity;
// Just like normal scrolling, prefer vertical rubberbanding
......
......@@ -43,6 +43,10 @@ public:
virtual bool pinnedInDirection(const FloatSize&) = 0;
virtual bool canScrollHorizontally() = 0;
virtual bool canScrollVertically() = 0;
// Return the absolute scroll position, not relative to the scroll origin.
virtual WebCore::IntPoint absoluteScrollPosition() = 0;
virtual void immediateScrollBy(const FloatSize&) = 0;
virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
virtual void startSnapRubberbandTimer() = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment