viewport-fit changes during animated resize can cause layout size to get stuck
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2017 19:50:23 +0000 (19:50 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2017 19:50:23 +0000 (19:50 +0000)
commitd4d00c697df8a6d49e6418ead59e24426493efcf
treeba66bfcc6a1548a2d982e2e922e549c8d86a01c0
parent7bdac6a5fc69d5a70ee38210c2a329899cefe2b5
viewport-fit changes during animated resize can cause layout size to get stuck
https://bugs.webkit.org/show_bug.cgi?id=175169
<rdar://problem/33684697>

Reviewed by Simon Fraser.

If we get a commit that changes viewport-fit state while an animated
resize is underway, and that change causes the client to push a new
minimumLayoutSizeOverride, the new size will be lost forever, and we
will get stuck laying out at the wrong size.

This is because we unconditionally apply avoidsUnsafeArea for every commit,
while most other changes that come in from a commit are ignored if we're
inside animated resize. To fix, also ignore avoidsUnsafeArea changes during
animated resize, by moving the code that keeps track of it into WKWebView
like all of the rest, and read it out of the commit in didCommitLayerTree
*after* the animated-resize early-return.

Also, fix the associated layout tests by adding a missing assignment
in _computedContentInset, which was broken in r220138.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
(-[WKWebView _processDidExit]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _setAvoidsUnsafeArea:]):
(-[WKWebView _safeAreaShouldAffectObscuredInsets]):
(-[WKWebView _didChangeAvoidsUnsafeArea:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::setAvoidsUnsafeArea): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::avoidsUnsafeArea const): Deleted.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/UIProcess/mac/PageClientImpl.h