Changeset 187001 in webkit


Ignore:
Timestamp:
Jul 18, 2015 4:54:32 PM (9 years ago)
Author:
Simon Fraser
Message:

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):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r186982 r187001  
     12015-07-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Scroll position jumps when scrolling scaling pages down in split view
     4        https://bugs.webkit.org/show_bug.cgi?id=147072
     5        rdar://problem/21769577
     6
     7        Reviewed by Sam Weinig.
     8       
     9        When apple.com/music is in Split View at a reduced scale, scrolling the page
     10        can cause unwanted scroll jumps. This happened because we'd enter
     11        TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() with a pending
     12        layout, so run the autosizing logic. When scrolled near the bottom, the unconstrained
     13        layout resulted in a shorter document, which truncated the scroll position. The
     14        scaled layout then restored the longer document, but it also restored that
     15        truncated scroll position.
     16       
     17        Forcing a layout is sufficient to fix the bug for this page, and doing a single
     18        layout (which will happen anyway) is preferable to running the autosize logic
     19        if layout happens to be dirty.
     20
     21        I was not able to make a test to reproduce the problem. Entering
     22        scaleViewToFitDocumentIfNeeded() with pending layout was triggerable
     23        using a transform transition, but I was not able to reproduce incorrect
     24        scroll position restoration.
     25
     26        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     27        (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
     28
    1292015-07-17  Andy Estes  <aestes@apple.com>
    230
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r186662 r187001  
    281281        return;
    282282
     283    m_webPage.layoutIfNeeded();
     284
    283285    int viewWidth = m_webPage.size().width();
    284286    bool documentWidthChangedOrInvalidated = m_webPage.mainFrame()->view()->needsLayout() || (m_lastDocumentSizeForScaleToFit.width() != m_webPage.mainFrameView()->renderView()->unscaledDocumentRect().width());
Note: See TracChangeset for help on using the changeset viewer.