[iOS] Flash when swiping back to Google search result page
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2019 22:31:36 +0000 (22:31 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2019 22:31:36 +0000 (22:31 +0000)
commit94955fd3515cbe4fa0b2f4882db2c7065a7869a4
treec648bc937626a859ac8a63ffbeb036cab723381e
parentdac3aeb3b7895c6cb22bc4e22cdbd9c9bc3dfabd
[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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm