Fixed elements bounce when rubber-banding at the bottom of the page
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2017 19:11:59 +0000 (19:11 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2017 19:11:59 +0000 (19:11 +0000)
commit2583b773785cbe57eb1b7b883107488446121001
treee7976789fcc5880f3a1f0e1848b078f989f7d259
parent18d424b4b07575c9373ee491954ce60d1b36cf16
Fixed elements bounce when rubber-banding at the bottom of the page
https://bugs.webkit.org/show_bug.cgi?id=168493
rdar://problem/30567713

Reviewed by Tim Horton.

Source/WebCore:

FrameView::visibleDocumentRect() was computing a bad visible rect when bottom-rubber-banding,
by adding rubberBandBottom which is negative, rather than subtracting.

Log some more scrolling stuff.

Ironically, the existing test didn't test stick-to-viewport fixed position because
backgroundShouldExtendBeyondPage() is off by default in WTR, so clone it to a test
that sets this, to test both behaviors.

This also revealed that dynamic changes to backgroundShouldExtendBeyondPage() need
to be propagated to the scrolling tree, which is fixed in AsyncScrollingCoordinator::frameViewLayoutUpdated().

Test: fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html

* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::visibleDocumentRect):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorMac::commitTreeState):

LayoutTests:

* fast/visual-viewport/rubberbanding-viewport-rects-expected.txt:
* fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt: Copied from LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt.
* fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html: Copied from LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects.html.
* fast/visual-viewport/rubberbanding-viewport-rects.html:
* platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt:
* platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt: Copied from LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt.
* platform/mac-wk1/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt [new file with mode: 0644]
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html [new file with mode: 0644]
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects.html
LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-expected.txt
LayoutTests/platform/ios-simulator-wk2/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/fast/visual-viewport/rubberbanding-viewport-rects-extended-background-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm