Layout size override changes during in-flight animated resize are dropped on the...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Aug 2017 18:57:36 +0000 (18:57 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Aug 2017 18:57:36 +0000 (18:57 +0000)
commit143af77c4f96c539d8efb68efdcfabaa47179880
treed3196894a554d3eb092661de54e36597847c69a5
parent2a0dd3224f2ef0466ab85d46984960c682a396ef
Layout size override changes during in-flight animated resize are dropped on the floor forever
https://bugs.webkit.org/show_bug.cgi?id=175916
<rdar://problem/33887295>

Reviewed by Beth Dakin.

Source/WebKit:

Layout size override changes that come in during an animated resize
are currently stored, but not sent in a separate message, because
they're sent as part of the resize. However, if a layout size override
change happens after the animated resize message was already sent, but
before the animated resize is ended, that change will be stored, but
not sent in the animated resize message (because it's too late), and
then subsequent calls with the same size will early-return, because
we're testing against the stored size, not the size we last actually
sent to the Web Content process.

Instead, store the last-sent size, so that subsequent layout size override
changes with the same size won't bail, and if it differs from the active
state after the animated resize completes, send an out-of-band update.

All of the above also applies to device orientation, which follows
exactly the same pattern.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _dispatchSetMinimumLayoutSize:]):
(-[WKWebView _dispatchSetMaximumUnobscuredSize:]):
(-[WKWebView _dispatchSetDeviceOrientation:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _windowDidRotate:]):
(-[WKWebView _didRelaunchProcess]):
(-[WKWebView _setMinimumLayoutSizeOverride:]):
(-[WKWebView _setInterfaceOrientationOverride:]):
(-[WKWebView _setMaximumUnobscuredSizeOverride:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm:
(TEST):
Add a test ensuring that override layout size changes
during an animated resize actually take effect.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm