Changeset 240298 in webkit


Ignore:
Timestamp:
Jan 22, 2019 2:31:36 PM (5 years ago)
Author:
Antti Koivisto
Message:

[iOS] Flash when swiping back to Google search result page
https://bugs.webkit.org/show_bug.cgi?id=193668
<rdar://problem/47071684>

Reviewed by Simon Fraser.

If the google page is scrolled, there is sometimes a short flash.

When restoring the page state we also restore exposedContentRect which is used to determine
which part of the page to create layers for. Scroll position is restored by the UI process
later so we rely on this to get the right layers for the initial view update.

A viewport configuration update may sometimes trample over the restored exposedContentRect,
moving it to top left. In this case the initial layer tree unfreeze commit may not have
layers to cover the actual visible view position.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::didCommitLoad):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::restorePageState):

Set a bit to indicate we have already restored the exposedContentRect.

(WebKit::WebPage::viewportConfigurationChanged):

Only reset exposedContentRect if wasn't already set by restorePageState.

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r240297 r240298  
     12019-01-22  Antti Koivisto  <antti@apple.com>
     2
     3        [iOS] Flash when swiping back to Google search result page
     4        https://bugs.webkit.org/show_bug.cgi?id=193668
     5        <rdar://problem/47071684>
     6
     7        Reviewed by Simon Fraser.
     8
     9        If the google page is scrolled, there is sometimes a short flash.
     10
     11        When restoring the page state we also restore exposedContentRect which is used to determine
     12        which part of the page to create layers for. Scroll position is restored by the UI process
     13        later so we rely on this to get the right layers for the initial view update.
     14
     15        A viewport configuration update may sometimes trample over the restored exposedContentRect,
     16        moving it to top left. In this case the initial layer tree unfreeze commit may not have
     17        layers to cover the actual visible view position.
     18
     19        * WebProcess/WebPage/WebPage.cpp:
     20        (WebKit::WebPage::didCommitLoad):
     21        * WebProcess/WebPage/WebPage.h:
     22        * WebProcess/WebPage/ios/WebPageIOS.mm:
     23        (WebKit::WebPage::restorePageState):
     24
     25        Set a bit to indicate we have already restored the exposedContentRect.
     26
     27        (WebKit::WebPage::viewportConfigurationChanged):
     28
     29        Only reset exposedContentRect if wasn't already set by restorePageState.
     30
    1312019-01-22  Alex Christensen  <achristensen@webkit.org>
    232
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r240203 r240298  
    56055605#if PLATFORM(IOS_FAMILY)
    56065606    m_hasReceivedVisibleContentRectsAfterDidCommitLoad = false;
     5607    m_hasRestoredExposedContentRectAfterDidCommitLoad = false;
    56075608    m_scaleWasSetByUIProcess = false;
    56085609    m_userHasChangedPageScaleFactor = false;
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r240199 r240298  
    17111711
    17121712    WebCore::ViewportConfiguration m_viewportConfiguration;
     1713
    17131714    bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad { false };
     1715    bool m_hasRestoredExposedContentRectAfterDidCommitLoad { false };
    17141716    bool m_scaleWasSetByUIProcess { false };
    17151717    bool m_userHasChangedPageScaleFactor { false };
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r240159 r240298  
    347347        if (historyItem.shouldRestoreScrollPosition()) {
    348348            m_drawingArea->setExposedContentRect(historyItem.exposedContentRect());
     349            m_hasRestoredExposedContentRectAfterDidCommitLoad = true;
    349350            scrollPosition = FloatPoint(historyItem.scrollPosition());
    350351        }
     
    28412842        // FIXME: We could send down the obscured margins to find a better exposed rect and unobscured rect.
    28422843        // It is not a big deal at the moment because the tile coverage will always extend past the obscured bottom inset.
    2843         m_drawingArea->setExposedContentRect(FloatRect(scrollPosition, minimumLayoutSizeInDocumentCoordinates));
     2844        if (!m_hasRestoredExposedContentRectAfterDidCommitLoad)
     2845            m_drawingArea->setExposedContentRect(FloatRect(scrollPosition, minimumLayoutSizeInDocumentCoordinates));
    28442846    }
    28452847    scalePage(scale, scrollPosition);
Note: See TracChangeset for help on using the changeset viewer.