Rubber-banding is often not smooth on infinitely scrolling websites
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Oct 2013 19:11:08 +0000 (19:11 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Oct 2013 19:11:08 +0000 (19:11 +0000)
commit2215ff4e419b1b74b4b0b8f046eb19c64d11d152
tree1c2118676071fef533dc7faabc4162fbfca0db1e
parente07426e0d1e79b9743520182edd73eee3e328764
Rubber-banding is often not smooth on infinitely scrolling websites
https://bugs.webkit.org/show_bug.cgi?id=122985

Reviewed by Simon Fraser.

totalContentsSize is an important part of the calculation for
maximumScrollPosition(). This function is called repeatedly throughout the curve
of a rubber-band to determine the stretch amount. To keep the rubber-band
animation smooth, it should be allowed to finish its animation using the old
totalContentsSize. This patch does that by adding a new variable,
m_totalContentsSizeForRubberBand. This value should almost always be equivalent to
m_totalContentsSize. It will only vary if m_totalContentsSize has changed in the
middle of a rubber-band, and in that case, it will stay equivalent to the old
totalContentSize value until the rubber band animation finishes.

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand):
(WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::stopSnapRubberbandTimer):
(WebCore::ScrollingTreeScrollingNodeMac::maximumScrollPosition):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm