Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Move animated resize into the layer tree transaction, and make it asy…
…nchronous https://bugs.webkit.org/show_bug.cgi?id=186130 <rdar://problem/38477288> Reviewed by Simon Fraser. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::setScrollPosition): (WebKit::RemoteLayerTreeTransaction::dynamicViewportSizeUpdateID const): (WebKit::RemoteLayerTreeTransaction::setDynamicViewportSizeUpdateID): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode const): (WebKit::RemoteLayerTreeTransaction::decode): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): Add scrollPosition to the transaction on all platforms, not just Mac. Add the optional dynamicViewportSizeUpdateID to the transaction, representing the most recent dynamicViewportSizeUpdate that commit contains, if any. * Shared/ios/DynamicViewportSizeUpdate.h: Added a typedef for DynamicViewportSizeUpdateID, and move the mode enum here. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::didCommitLayerTree): (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): Deleted. (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::synchronizeDynamicViewportUpdate): Deleted. Remove dynamicViewportUpdateChangedTarget and synchronizeDynamicViewportUpdate. Move dynamicViewportSizeUpdateID maintenance into WKWebView. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): Remove _resizeAnimationTransformTransactionID. We now instead pack the resize ID inside the transaction, instead of separately sending back a transaction ID to wait for. (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]): (-[WKWebView _didCommitLayerTree:]): Added, factored out of _didCommitLayerTree:. If the transaction includes the result of the most recently-sent resize, store the requisite adjustments required to counter the new scale and scroll offset, update the resizeAnimationView, and, if endAnimatedResize has already been called, call _didCompleteAnimatedResize to tear down the animation view and put things back together. Add some code so that if a commit arrives before the resize, we update the scale of the resize animation view to keep the width fitting. (activeMaximumUnobscuredSize): (activeOrientation): Move these because the code that depends on them moved. (-[WKWebView _didCompleteAnimatedResize]): Broken out of _endAnimatedResize. This can now be called from either endAnimatedResize or _didCommitLayerTreeDuringAnimatedResize, depending on which is called first. (-[WKWebView _beginAnimatedResizeWithUpdates:]): Don't create a new resize view if we still have one. Otherwise, we'll get the view ordering all wrong when making the second one. This didn't previously cause trouble, because we don't have a lot of WKScrollView subviews, but it totally could. Adopt _initialContentOffsetForScrollView just to make this code more clear. (-[WKWebView _endAnimatedResize]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: Canonical link: https://commits.webkit.org/201725@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
328 additions
and 247 deletions.
- +85 −0 Source/WebKit/ChangeLog
- +6 −5 Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
- +7 −5 Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
- +38 −0 Source/WebKit/Shared/ios/DynamicViewportSizeUpdate.h
- +170 −146 Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
- +2 −1 Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
- +0 −1 Source/WebKit/UIProcess/PageClient.h
- +0 −3 Source/WebKit/UIProcess/WebPageProxy.cpp
- +2 −7 Source/WebKit/UIProcess/WebPageProxy.h
- +0 −1 Source/WebKit/UIProcess/WebPageProxy.messages.in
- +0 −1 Source/WebKit/UIProcess/ios/PageClientImplIOS.h
- +0 −5 Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
- +5 −58 Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
- +4 −0 Source/WebKit/WebKit.xcodeproj/project.pbxproj
- +4 −2 Source/WebKit/WebProcess/WebPage/WebPage.cpp
- +3 −2 Source/WebKit/WebProcess/WebPage/WebPage.h
- +0 −1 Source/WebKit/WebProcess/WebPage/WebPage.messages.in
- +2 −9 Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (C) 2018 Apple Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS | ||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
* THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace WebKit { | ||
|
||
typedef uint64_t DynamicViewportSizeUpdateID; | ||
|
||
enum class DynamicViewportUpdateMode { | ||
NotResizing, | ||
ResizingWithAnimation, | ||
ResizingWithDocumentHidden, | ||
}; | ||
|
||
} // namespace WebKit |
Oops, something went wrong.