Scroll position jumps when scrolling scaling pages down in split view
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jul 2015 23:54:32 +0000 (23:54 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jul 2015 23:54:32 +0000 (23:54 +0000)
commit1a23250a12204c26923f30b13e14b9fb073ccebd
treeb5aa38ac24175d3662f801f71a608eb2cf56bab6
parent4fe6c7ee0cd24143f7b01d468ed4d36bc79da520
Scroll position jumps when scrolling scaling pages down in split view
https://bugs.webkit.org/show_bug.cgi?id=147072
rdar://problem/21769577

Reviewed by Sam Weinig.

When apple.com/music is in Split View at a reduced scale, scrolling the page
can cause unwanted scroll jumps. This happened because we'd enter
TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() with a pending
layout, so run the autosizing logic. When scrolled near the bottom, the unconstrained
layout resulted in a shorter document, which truncated the scroll position. The
scaled layout then restored the longer document, but it also restored that
truncated scroll position.

Forcing a layout is sufficient to fix the bug for this page, and doing a single
layout (which will happen anyway) is preferable to running the autosize logic
if layout happens to be dirty.

I was not able to make a test to reproduce the problem. Entering
scaleViewToFitDocumentIfNeeded() with pending layout was triggerable
using a transform transition, but I was not able to reproduce incorrect
scroll position restoration.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm