WebKit Bugzilla
Attachment 342037 Details for
Bug 186130
: Move animated resize into the layer tree transaction, and make it asynchronous
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186130-20180605233339.patch (text/plain), 64.33 KB, created by
Tim Horton
on 2018-06-05 23:33:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2018-06-05 23:33:40 PDT
Size:
64.33 KB
patch
obsolete
>Subversion Revision: 232515 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6ee13e5cb5aeebd33516459f282189d5efe7641b..990af36981bc839efe9c0e52afa194c4a90a19e3 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,88 @@ >+2018-06-05 Tim Horton <timothy_horton@apple.com> >+ >+ Move animated resize into the layer tree transaction, and make it asynchronous >+ 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: >+ >+ > 2018-06-05 Brent Fulgham <bfulgham@apple.com> > > Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds >diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h >index f156c23354955db7c1b2650b0f0bba3c01d7b336..9b494b10339c8b724d9444f806a4f919fee6639e 100644 >--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h >+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h >@@ -25,6 +25,7 @@ > > #pragma once > >+#include "DynamicViewportSizeUpdate.h" > #include "EditorState.h" > #include "GenericCallback.h" > #include "PlatformCAAnimationRemote.h" >@@ -218,10 +219,8 @@ public: > WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; } > void setPageExtendedBackgroundColor(WebCore::Color color) { m_pageExtendedBackgroundColor = color; } > >-#if PLATFORM(MAC) > WebCore::IntPoint scrollPosition() const { return m_scrollPosition; } > void setScrollPosition(WebCore::IntPoint p) { m_scrollPosition = p; } >-#endif > > double pageScaleFactor() const { return m_pageScaleFactor; } > void setPageScaleFactor(double pageScaleFactor) { m_pageScaleFactor = pageScaleFactor; } >@@ -272,6 +271,9 @@ public: > bool hasEditorState() const { return !!m_editorState; } > const EditorState& editorState() const { return m_editorState.value(); } > void setEditorState(const EditorState& editorState) { m_editorState = editorState; } >+ >+ std::optional<DynamicViewportSizeUpdateID> dynamicViewportSizeUpdateID() const { return m_dynamicViewportSizeUpdateID; } >+ void setDynamicViewportSizeUpdateID(DynamicViewportSizeUpdateID resizeID) { m_dynamicViewportSizeUpdateID = resizeID; } > > private: > WebCore::GraphicsLayer::PlatformLayerID m_rootLayerID; >@@ -290,9 +292,7 @@ private: > WebCore::LayoutSize m_baseLayoutViewportSize; > WebCore::LayoutPoint m_minStableLayoutViewportOrigin; > WebCore::LayoutPoint m_maxStableLayoutViewportOrigin; >-#if PLATFORM(MAC) > WebCore::IntPoint m_scrollPosition; >-#endif > WebCore::Color m_pageExtendedBackgroundColor; > double m_pageScaleFactor { 1 }; > double m_minimumScaleFactor { 1 }; >@@ -309,7 +309,8 @@ private: > bool m_viewportMetaTagCameFromImageDocument { false }; > bool m_isInStableState { false }; > >- std::optional<EditorState> m_editorState { std::nullopt }; >+ std::optional<EditorState> m_editorState; >+ std::optional<DynamicViewportSizeUpdateID> m_dynamicViewportSizeUpdateID; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >index 8c4f7900503e5080e6043faba3851b90ff613a2d..e3a097e515abf3ddc882abef2bc348bbdf41c5d0 100644 >--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm >@@ -533,9 +533,8 @@ void RemoteLayerTreeTransaction::encode(IPC::Encoder& encoder) const > encoder << m_minStableLayoutViewportOrigin; > encoder << m_maxStableLayoutViewportOrigin; > >-#if PLATFORM(MAC) > encoder << m_scrollPosition; >-#endif >+ > encoder << m_pageExtendedBackgroundColor; > encoder << m_pageScaleFactor; > encoder << m_minimumScaleFactor; >@@ -563,6 +562,8 @@ void RemoteLayerTreeTransaction::encode(IPC::Encoder& encoder) const > encoder << hasEditorState(); > if (m_editorState) > encoder << *m_editorState; >+ >+ encoder << m_dynamicViewportSizeUpdateID; > } > > bool RemoteLayerTreeTransaction::decode(IPC::Decoder& decoder, RemoteLayerTreeTransaction& result) >@@ -624,11 +625,9 @@ bool RemoteLayerTreeTransaction::decode(IPC::Decoder& decoder, RemoteLayerTreeTr > > if (!decoder.decode(result.m_maxStableLayoutViewportOrigin)) > return false; >- >-#if PLATFORM(MAC) >+ > if (!decoder.decode(result.m_scrollPosition)) > return false; >-#endif > > if (!decoder.decode(result.m_pageExtendedBackgroundColor)) > return false; >@@ -692,6 +691,9 @@ bool RemoteLayerTreeTransaction::decode(IPC::Decoder& decoder, RemoteLayerTreeTr > result.setEditorState(editorState); > } > >+ if (!decoder.decode(result.m_dynamicViewportSizeUpdateID)) >+ return false; >+ > return true; > } > >diff --git a/Source/WebKit/Shared/ios/DynamicViewportSizeUpdate.h b/Source/WebKit/Shared/ios/DynamicViewportSizeUpdate.h >new file mode 100644 >index 0000000000000000000000000000000000000000..97a22c2354c3aa4247cb454bf21c753b8d0981b2 >--- /dev/null >+++ b/Source/WebKit/Shared/ios/DynamicViewportSizeUpdate.h >@@ -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 >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index 0e642a6af483a4705ed87bc0e9775e8bcc5c3c51..bd2f1c1be37db360430b52167603854b56286bd5 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -33,6 +33,7 @@ > #import "APISerializedScriptValue.h" > #import "CompletionHandlerCallChecker.h" > #import "DiagnosticLoggingClient.h" >+#import "DynamicViewportSizeUpdate.h" > #import "FindClient.h" > #import "FrontBoardServicesSPI.h" > #import "FullscreenClient.h" >@@ -176,12 +177,6 @@ - (UIViewController *)_rootAncestorViewController; > - (UIViewController *)_viewControllerForSupportedInterfaceOrientations; > @end > >-enum class DynamicViewportUpdateMode { >- NotResizing, >- ResizingWithAnimation, >- ResizingWithDocumentHidden, >-}; >- > #endif // PLATFORM(IOS) > > #if PLATFORM(IOS) >@@ -311,9 +306,10 @@ @implementation WKWebView { > BOOL _hasCommittedLoadForMainFrame; > BOOL _needsResetViewStateAfterCommitLoadForMainFrame; > uint64_t _firstPaintAfterCommitLoadTransactionID; >- DynamicViewportUpdateMode _dynamicViewportUpdateMode; >+ WebKit::DynamicViewportUpdateMode _dynamicViewportUpdateMode; >+ WebKit::DynamicViewportSizeUpdateID _currentDynamicViewportSizeUpdateID; > CATransform3D _resizeAnimationTransformAdjustments; >- std::optional<uint64_t> _resizeAnimationTransformTransactionID; >+ CGFloat _animatedResizeOriginalContentWidth; > RetainPtr<UIView> _resizeAnimationView; > CGFloat _lastAdjustmentForScroller; > std::optional<CGRect> _frozenVisibleContentRect; >@@ -348,6 +344,8 @@ @implementation WKWebView { > BOOL _hadDelayedUpdateVisibleContentRects; > > int _activeAnimatedResizeCount; >+ BOOL _waitingForEndAnimatedResize; >+ BOOL _waitingForCommitAfterAnimatedResize; > > Vector<WTF::Function<void ()>> _snapshotsDeferredDuringResize; > RetainPtr<NSMutableArray> _stableStatePresentationUpdateCallbacks; >@@ -357,15 +355,13 @@ @implementation WKWebView { > BOOL _hasScheduledVisibleRectUpdate; > BOOL _visibleContentRectUpdateScheduledFromScrollViewInStableState; > Vector<BlockPtr<void ()>> _visibleContentRectUpdateCallbacks; >+ >+ _WKDragInteractionPolicy _dragInteractionPolicy; > #endif > #if PLATFORM(MAC) > std::unique_ptr<WebKit::WebViewImpl> _impl; > RetainPtr<WKTextFinderClient> _textFinderClient; > #endif >- >-#if PLATFORM(IOS) >- _WKDragInteractionPolicy _dragInteractionPolicy; >-#endif > } > > - (instancetype)initWithFrame:(CGRect)frame >@@ -1664,7 +1660,7 @@ - (UIEdgeInsets)_computedUnobscuredSafeAreaInset > - (void)_processDidExit > { > [self _hidePasswordView]; >- if (!_customContentView && _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) { >+ if (!_customContentView && _dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) { > NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()]; > [_scrollView insertSubview:_contentView.get() atIndex:indexOfResizeAnimationView]; > [_scrollView insertSubview:[_contentView unscaledView] atIndex:indexOfResizeAnimationView + 1]; >@@ -1682,7 +1678,10 @@ - (void)_processDidExit > _initialScaleFactor = 1; > _hasCommittedLoadForMainFrame = NO; > _needsResetViewStateAfterCommitLoadForMainFrame = NO; >- _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing; >+ _dynamicViewportUpdateMode = WebKit::DynamicViewportUpdateMode::NotResizing; >+ _waitingForEndAnimatedResize = NO; >+ _waitingForCommitAfterAnimatedResize = NO; >+ _animatedResizeOriginalContentWidth = 0; > [_contentView setHidden:NO]; > _scrollOffsetToRestore = std::nullopt; > _unobscuredCenterToRestore = std::nullopt; >@@ -1698,7 +1697,6 @@ - (void)_processDidExit > > _firstPaintAfterCommitLoadTransactionID = 0; > _firstTransactionIDAfterPageRestore = std::nullopt; >- _resizeAnimationTransformTransactionID = std::nullopt; > > _hasScheduledVisibleRectUpdate = NO; > _commitDidRestoreScrollPosition = NO; >@@ -1754,6 +1752,49 @@ static inline bool areEssentiallyEqualAsFloat(float a, float b) > return WTF::areEssentiallyEqual(a, b); > } > >+- (void)_didCommitLayerTreeDuringAnimatedResize:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction >+{ >+ auto updateID = layerTreeTransaction.dynamicViewportSizeUpdateID(); >+ if (updateID && *updateID == _currentDynamicViewportSizeUpdateID) { >+ double pageScale = layerTreeTransaction.pageScaleFactor(); >+ WebCore::IntPoint scrollPosition = layerTreeTransaction.scrollPosition(); >+ >+ CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11; >+ double currentTargetScale = animatingScaleTarget * [[_contentView layer] transform].m11; >+ double scale = pageScale / currentTargetScale; >+ _resizeAnimationTransformAdjustments = CATransform3DMakeScale(scale, scale, 1); >+ >+ CGPoint newContentOffset = [self _contentOffsetAdjustedForObscuredInset:CGPointMake(scrollPosition.x() * pageScale, scrollPosition.y() * pageScale)]; >+ CGPoint currentContentOffset = [_scrollView contentOffset]; >+ >+ _resizeAnimationTransformAdjustments.m41 = (currentContentOffset.x - newContentOffset.x) / animatingScaleTarget; >+ _resizeAnimationTransformAdjustments.m42 = (currentContentOffset.y - newContentOffset.y) / animatingScaleTarget; >+ >+ [_resizeAnimationView layer].sublayerTransform = _resizeAnimationTransformAdjustments; >+ >+ // If we've already passed endAnimatedResize, immediately complete >+ // the resize when we have an up-to-date layer tree. Otherwise, >+ // we will defer completion until endAnimatedResize. >+ _waitingForCommitAfterAnimatedResize = NO; >+ if (!_waitingForEndAnimatedResize) >+ [self _didCompleteAnimatedResize]; >+ >+ return; >+ } >+ >+ // If a commit arrives during the live part of a resize but before the >+ // layer tree takes the current resize into account, it could change the >+ // WKContentView's size. Update the resizeAnimationView's scale to ensure >+ // we continue to fill the width of the resize target. >+ >+ if (_waitingForEndAnimatedResize) >+ return; >+ >+ auto newViewLayoutSize = [self activeViewLayoutSize:self.bounds]; >+ CGFloat resizeAnimationViewScale = _animatedResizeOriginalContentWidth / newViewLayoutSize.width(); >+ [[_resizeAnimationView layer] setSublayerTransform:CATransform3DMakeScale(resizeAnimationViewScale, resizeAnimationViewScale, 1)]; >+} >+ > - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction > { > if (![self usesStandardContentView]) >@@ -1763,15 +1804,8 @@ - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTree > > bool needUpdateVisibleContentRects = _page->updateLayoutViewportParameters(layerTreeTransaction); > >- if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) { >- if (_resizeAnimationTransformTransactionID && layerTreeTransaction.transactionID() >= _resizeAnimationTransformTransactionID.value()) { >- _resizeAnimationTransformTransactionID = std::nullopt; >- [_resizeAnimationView layer].sublayerTransform = _resizeAnimationTransformAdjustments; >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::ResizingWithDocumentHidden) { >- [_contentView setHidden:NO]; >- [self _endAnimatedResize]; >- } >- } >+ if (_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) { >+ [self _didCommitLayerTreeDuringAnimatedResize:layerTreeTransaction]; > return; > } > >@@ -1871,25 +1905,6 @@ - (void)_layerTreeCommitComplete > _commitDidRestoreScrollPosition = NO; > } > >-- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID >-{ >- LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _dynamicViewportUpdateChangedTargetToScale:] " << newScale << " _dynamicViewportUpdateMode " << (int)_dynamicViewportUpdateMode); >- >- if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) { >- CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11; >- double currentTargetScale = animatingScaleTarget * [[_contentView layer] transform].m11; >- double scale = newScale / currentTargetScale; >- _resizeAnimationTransformAdjustments = CATransform3DMakeScale(scale, scale, 1); >- >- CGPoint newContentOffset = [self _contentOffsetAdjustedForObscuredInset:CGPointMake(newScrollPosition.x * newScale, newScrollPosition.y * newScale)]; >- CGPoint currentContentOffset = [_scrollView contentOffset]; >- >- _resizeAnimationTransformAdjustments.m41 = (currentContentOffset.x - newContentOffset.x) / animatingScaleTarget; >- _resizeAnimationTransformAdjustments.m42 = (currentContentOffset.y - newContentOffset.y) / animatingScaleTarget; >- _resizeAnimationTransformTransactionID = nextValidLayerTreeTransactionID; >- } >-} >- > - (void)_couldNotRestorePageState > { > // The gestureController may be waiting for the scroll position to be restored >@@ -1902,7 +1917,7 @@ - (void)_couldNotRestorePageState > > - (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)obscuredInsets scale:(double)scale > { >- if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) >+ if (_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) > return; > > if (![self usesStandardContentView]) >@@ -1920,7 +1935,7 @@ - (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPos > > - (void)_restorePageStateToUnobscuredCenter:(std::optional<WebCore::FloatPoint>)center scale:(double)scale > { >- if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) >+ if (_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) > return; > > if (![self usesStandardContentView]) >@@ -2035,7 +2050,7 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff > > - (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin > { >- if (_commitDidRestoreScrollPosition || _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) >+ if (_commitDidRestoreScrollPosition || _dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) > return; > > WebCore::FloatPoint contentOffset = WebCore::ScrollableArea::scrollOffsetFromPosition(scrollPosition, toFloatSize(scrollOrigin)); >@@ -2615,7 +2630,7 @@ - (void)_frameOrBoundsChanged > CGRect bounds = self.bounds; > [_scrollView setFrame:bounds]; > >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) { >+ if (_dynamicViewportUpdateMode == WebKit::DynamicViewportUpdateMode::NotResizing) { > if (!_overridesViewLayoutSize) > [self _dispatchSetViewLayoutSize:[self activeViewLayoutSize:self.bounds]]; > if (!_overridesMaximumUnobscuredSize) >@@ -2777,7 +2792,7 @@ - (void)_updateVisibleContentRects > return; > } > >- if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing >+ if (_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing > || (_needsResetViewStateAfterCommitLoadForMainFrame && ![_contentView sizeChangedSinceLastVisibleContentRectUpdate]) > || [_scrollView isZoomBouncing] > || _currentlyAdjustingScrollViewInsetsForKeyboard) >@@ -2835,6 +2850,84 @@ - (void)_didStartProvisionalLoadForMainFrame > _gestureController->didStartProvisionalLoadForMainFrame(); > } > >+static WebCore::FloatSize activeMaximumUnobscuredSize(WKWebView *webView, const CGRect& bounds) >+{ >+ return WebCore::FloatSize(webView->_overridesMaximumUnobscuredSize ? webView->_maximumUnobscuredSizeOverride : bounds.size); >+} >+ >+static int32_t activeOrientation(WKWebView *webView) >+{ >+ return webView->_overridesInterfaceOrientation ? deviceOrientationForUIInterfaceOrientation(webView->_interfaceOrientationOverride) : webView->_page->deviceOrientation(); >+} >+ >+- (void)_didCompleteAnimatedResize >+{ >+ if (_dynamicViewportUpdateMode == WebKit::DynamicViewportUpdateMode::NotResizing) >+ return; >+ >+ [_contentView setHidden:NO]; >+ >+ if (!_resizeAnimationView) { >+ // Paranoia. If _resizeAnimationView is null we'll end up setting a zero scale on the content view. >+ RELEASE_LOG_IF_ALLOWED("%p -[WKWebView _endAnimatedResize:] - _resizeAnimationView is nil", self); >+ _dynamicViewportUpdateMode = WebKit::DynamicViewportUpdateMode::NotResizing; >+ return; >+ } >+ >+ --_activeAnimatedResizeCount; >+ NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()]; >+ [_scrollView insertSubview:_contentView.get() atIndex:indexOfResizeAnimationView]; >+ [_scrollView insertSubview:[_contentView unscaledView] atIndex:indexOfResizeAnimationView + 1]; >+ >+ CALayer *contentLayer = [_contentView layer]; >+ CGFloat adjustmentScale = _resizeAnimationTransformAdjustments.m11; >+ contentLayer.sublayerTransform = CATransform3DIdentity; >+ >+ CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11; >+ CATransform3D contentLayerTransform = contentLayer.transform; >+ CGFloat currentScale = [[_resizeAnimationView layer] transform].m11 * contentLayerTransform.m11; >+ >+ // We cannot use [UIScrollView setZoomScale:] directly because the UIScrollView delegate would get a callback with >+ // an invalid contentOffset. The real content offset is only set below. >+ // Since there is no public API for setting both the zoomScale and the contentOffset, we set the zoomScale manually >+ // on the zoom layer and then only change the contentOffset. >+ CGFloat adjustedScale = adjustmentScale * currentScale; >+ contentLayerTransform.m11 = adjustedScale; >+ contentLayerTransform.m22 = adjustedScale; >+ contentLayer.transform = contentLayerTransform; >+ >+ CGPoint currentScrollOffset = [_scrollView contentOffset]; >+ double horizontalScrollAdjustement = _resizeAnimationTransformAdjustments.m41 * animatingScaleTarget; >+ double verticalScrollAdjustment = _resizeAnimationTransformAdjustments.m42 * animatingScaleTarget; >+ >+ [_scrollView setContentSize:roundScrollViewContentSize(*_page, [_contentView frame].size)]; >+ [_scrollView setContentOffset:CGPointMake(currentScrollOffset.x - horizontalScrollAdjustement, currentScrollOffset.y - verticalScrollAdjustment)]; >+ >+ [_resizeAnimationView removeFromSuperview]; >+ _resizeAnimationView = nil; >+ _resizeAnimationTransformAdjustments = CATransform3DIdentity; >+ >+ _dynamicViewportUpdateMode = WebKit::DynamicViewportUpdateMode::NotResizing; >+ [self _scheduleVisibleContentRectUpdate]; >+ >+ CGRect newBounds = self.bounds; >+ auto newViewLayoutSize = [self activeViewLayoutSize:newBounds]; >+ auto newMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, newBounds); >+ int32_t newOrientation = activeOrientation(self); >+ >+ if (!_lastSentViewLayoutSize || newViewLayoutSize != _lastSentViewLayoutSize.value()) >+ [self _dispatchSetViewLayoutSize:newViewLayoutSize]; >+ >+ if (!_lastSentMaximumUnobscuredSize || newMaximumUnobscuredSize != _lastSentMaximumUnobscuredSize.value()) >+ [self _dispatchSetMaximumUnobscuredSize:WebCore::FloatSize(newMaximumUnobscuredSize)]; >+ >+ if (!_lastSentDeviceOrientation || newOrientation != _lastSentDeviceOrientation.value()) >+ [self _dispatchSetDeviceOrientation:newOrientation]; >+ >+ while (!_snapshotsDeferredDuringResize.isEmpty()) >+ _snapshotsDeferredDuringResize.takeLast()(); >+} >+ > - (void)_didFinishLoadForMainFrame > { > if (_gestureController) >@@ -4217,16 +4310,6 @@ - (void)_setShouldSuppressFirstResponderChanges:(BOOL)shouldSuppress > #endif > > #if PLATFORM(IOS) >-static WebCore::FloatSize activeMaximumUnobscuredSize(WKWebView *webView, const CGRect& bounds) >-{ >- return WebCore::FloatSize(webView->_overridesMaximumUnobscuredSize ? webView->_maximumUnobscuredSizeOverride : bounds.size); >-} >- >-static int32_t activeOrientation(WKWebView *webView) >-{ >- return webView->_overridesInterfaceOrientation ? deviceOrientationForUIInterfaceOrientation(webView->_interfaceOrientationOverride) : webView->_page->deviceOrientation(); >-} >- > - (void (^)(void))_retainActiveFocusedState > { > ++_activeFocusedStateRetainCount; >@@ -5008,7 +5091,7 @@ - (void)_setViewLayoutSizeOverride:(CGSize)viewLayoutSizeOverride > _overridesViewLayoutSize = YES; > _viewLayoutSizeOverride = viewLayoutSizeOverride; > >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) >+ if (_dynamicViewportUpdateMode == WebKit::DynamicViewportUpdateMode::NotResizing) > [self _dispatchSetViewLayoutSize:WebCore::FloatSize(viewLayoutSizeOverride)]; > > } >@@ -5084,7 +5167,7 @@ - (void)_setInterfaceOrientationOverride:(UIInterfaceOrientation)interfaceOrient > _overridesInterfaceOrientation = YES; > _interfaceOrientationOverride = interfaceOrientation; > >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) >+ if (_dynamicViewportUpdateMode == WebKit::DynamicViewportUpdateMode::NotResizing) > [self _dispatchSetDeviceOrientation:deviceOrientationForUIInterfaceOrientation(_interfaceOrientationOverride)]; > } > >@@ -5112,7 +5195,7 @@ - (void)_setMaximumUnobscuredSizeOverride:(CGSize)size > _overridesMaximumUnobscuredSize = YES; > _maximumUnobscuredSizeOverride = size; > >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) >+ if (_dynamicViewportUpdateMode == WebKit::DynamicViewportUpdateMode::NotResizing) > [self _dispatchSetMaximumUnobscuredSize:WebCore::FloatSize(size)]; > } > >@@ -5157,7 +5240,7 @@ - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock > return; > } > >- _dynamicViewportUpdateMode = DynamicViewportUpdateMode::ResizingWithAnimation; >+ _dynamicViewportUpdateMode = WebKit::DynamicViewportUpdateMode::ResizingWithAnimation; > > auto oldViewLayoutSize = [self activeViewLayoutSize:self.bounds]; > auto oldMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, oldBounds); >@@ -5176,7 +5259,7 @@ - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock > > ASSERT_WITH_MESSAGE(!(_overridesViewLayoutSize && newViewLayoutSize.isEmpty()), "Clients controlling the layout size should maintain a valid layout size to minimize layouts."); > if (CGRectIsEmpty(newBounds) || newViewLayoutSize.isEmpty() || CGRectIsEmpty(futureUnobscuredRectInSelfCoordinates) || CGRectIsEmpty(contentViewBounds)) { >- _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing; >+ _dynamicViewportUpdateMode = WebKit::DynamicViewportUpdateMode::NotResizing; > [self _frameOrBoundsChanged]; > if (_overridesViewLayoutSize) > [self _dispatchSetViewLayoutSize:newViewLayoutSize]; >@@ -5194,7 +5277,7 @@ - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock > && oldMaximumUnobscuredSize == newMaximumUnobscuredSize > && oldOrientation == newOrientation > && UIEdgeInsetsEqualToEdgeInsets(oldObscuredInsets, newObscuredInsets)) { >- _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing; >+ _dynamicViewportUpdateMode = WebKit::DynamicViewportUpdateMode::NotResizing; > [self _scheduleVisibleContentRectUpdate]; > return; > } >@@ -5202,12 +5285,14 @@ - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock > ++_activeAnimatedResizeCount; > _resizeAnimationTransformAdjustments = CATransform3DIdentity; > >- NSUInteger indexOfContentView = [[_scrollView subviews] indexOfObject:_contentView.get()]; >- _resizeAnimationView = adoptNS([[UIView alloc] init]); >- [_resizeAnimationView layer].name = @"ResizeAnimation"; >- [_scrollView insertSubview:_resizeAnimationView.get() atIndex:indexOfContentView]; >- [_resizeAnimationView addSubview:_contentView.get()]; >- [_resizeAnimationView addSubview:[_contentView unscaledView]]; >+ if (!_resizeAnimationView) { >+ NSUInteger indexOfContentView = [[_scrollView subviews] indexOfObject:_contentView.get()]; >+ _resizeAnimationView = adoptNS([[UIView alloc] init]); >+ [_resizeAnimationView layer].name = @"ResizeAnimation"; >+ [_scrollView insertSubview:_resizeAnimationView.get() atIndex:indexOfContentView]; >+ [_resizeAnimationView addSubview:_contentView.get()]; >+ [_resizeAnimationView addSubview:[_contentView unscaledView]]; >+ } > > CGSize contentSizeInContentViewCoordinates = contentViewBounds.size; > [_scrollView setMinimumZoomScale:std::min(newViewLayoutSize.width() / contentSizeInContentViewCoordinates.width, [_scrollView minimumZoomScale])]; >@@ -5215,8 +5300,8 @@ - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock > > // Compute the new scale to keep the current content width in the scrollview. > CGFloat oldWebViewWidthInContentViewCoordinates = oldUnobscuredContentRect.width(); >- CGFloat visibleContentViewWidthInContentCoordinates = std::min(contentSizeInContentViewCoordinates.width, oldWebViewWidthInContentViewCoordinates); >- CGFloat targetScale = newViewLayoutSize.width() / visibleContentViewWidthInContentCoordinates; >+ _animatedResizeOriginalContentWidth = std::min(contentSizeInContentViewCoordinates.width, oldWebViewWidthInContentViewCoordinates); >+ CGFloat targetScale = newViewLayoutSize.width() / _animatedResizeOriginalContentWidth; > CGFloat resizeAnimationViewAnimationScale = targetScale / contentZoomScale(self); > [_resizeAnimationView setTransform:CGAffineTransformMakeScale(resizeAnimationViewAnimationScale, resizeAnimationViewAnimationScale)]; > >@@ -5244,7 +5329,7 @@ - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock > if (oldUnobscuredContentRect.maxY() > contentSizeInContentViewCoordinates.height - 1) > contentOffset.y = maxVerticalOffset; > if (oldUnobscuredContentRect.y() < 1) >- contentOffset.y = -_obscuredInsets.top; >+ contentOffset.y = [self _initialContentOffsetForScrollView].y; > > // FIXME: if we have content centered after double tap to zoom, we should also try to keep that rect in view. > [_scrollView setContentSize:roundScrollViewContentSize(*_page, futureContentSizeInSelfCoordinates)]; >@@ -5260,9 +5345,12 @@ - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock > _lastSentMaximumUnobscuredSize = newMaximumUnobscuredSize; > _lastSentDeviceOrientation = newOrientation; > >- _page->dynamicViewportSizeUpdate(newViewLayoutSize, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, unobscuredSafeAreaInsetsExtent, targetScale, newOrientation); >+ _page->dynamicViewportSizeUpdate(newViewLayoutSize, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, unobscuredSafeAreaInsetsExtent, targetScale, newOrientation, ++_currentDynamicViewportSizeUpdateID); > if (WebKit::DrawingAreaProxy* drawingArea = _page->drawingArea()) > drawingArea->setSize(WebCore::IntSize(newBounds.size)); >+ >+ _waitingForCommitAfterAnimatedResize = YES; >+ _waitingForEndAnimatedResize = YES; > } > > - (void)_endAnimatedResize >@@ -5272,84 +5360,20 @@ - (void)_endAnimatedResize > if ([_customContentView respondsToSelector:@selector(web_endAnimatedResize)]) > [_customContentView web_endAnimatedResize]; > >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) >- return; >- >- _page->synchronizeDynamicViewportUpdate(); >- >- // synchronizeDynamicViewportUpdate() may cause this function to re-enter via _didCommitLayerTree, so check _dynamicViewportUpdateMode again. >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) >- return; >- >- if (!_resizeAnimationView) { >- // Paranoia. If _resizeAnimationView is null we'll end up setting a zero scale on the content view. >- RELEASE_LOG_IF_ALLOWED("%p -[WKWebView _endAnimatedResize:] - _resizeAnimationView is nil", self); >- _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing; >- [_contentView setHidden:NO]; >- return; >- } >- >- --_activeAnimatedResizeCount; >- NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()]; >- [_scrollView insertSubview:_contentView.get() atIndex:indexOfResizeAnimationView]; >- [_scrollView insertSubview:[_contentView unscaledView] atIndex:indexOfResizeAnimationView + 1]; >- >- CALayer *contentViewLayer = [_contentView layer]; >- CGFloat adjustmentScale = _resizeAnimationTransformAdjustments.m11; >- contentViewLayer.sublayerTransform = CATransform3DIdentity; >- >- CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11; >- CALayer *contentLayer = [_contentView layer]; >- CATransform3D contentLayerTransform = contentLayer.transform; >- CGFloat currentScale = [[_resizeAnimationView layer] transform].m11 * contentLayerTransform.m11; >- >- // We cannot use [UIScrollView setZoomScale:] directly because the UIScrollView delegate would get a callback with >- // an invalid contentOffset. The real content offset is only set below. >- // Since there is no public API for setting both the zoomScale and the contentOffset, we set the zoomScale manually >- // on the zoom layer and then only change the contentOffset. >- CGFloat adjustedScale = adjustmentScale * currentScale; >- contentLayerTransform.m11 = adjustedScale; >- contentLayerTransform.m22 = adjustedScale; >- contentLayer.transform = contentLayerTransform; >- >- CGPoint currentScrollOffset = [_scrollView contentOffset]; >- double horizontalScrollAdjustement = _resizeAnimationTransformAdjustments.m41 * animatingScaleTarget; >- double verticalScrollAdjustment = _resizeAnimationTransformAdjustments.m42 * animatingScaleTarget; >- >- [_scrollView setContentSize:roundScrollViewContentSize(*_page, [_contentView frame].size)]; >- [_scrollView setContentOffset:CGPointMake(currentScrollOffset.x - horizontalScrollAdjustement, currentScrollOffset.y - verticalScrollAdjustment)]; >- >- [_resizeAnimationView removeFromSuperview]; >- _resizeAnimationView = nil; >- _resizeAnimationTransformAdjustments = CATransform3DIdentity; >- >- _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing; >- [_contentView setHidden:NO]; >- [self _scheduleVisibleContentRectUpdate]; >- >- CGRect newBounds = self.bounds; >- auto newViewLayoutSize = [self activeViewLayoutSize:newBounds]; >- auto newMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, newBounds); >- int32_t newOrientation = activeOrientation(self); >- >- if (!_lastSentViewLayoutSize || newViewLayoutSize != _lastSentViewLayoutSize.value()) >- [self _dispatchSetViewLayoutSize:newViewLayoutSize]; >- if (!_lastSentMaximumUnobscuredSize || newMaximumUnobscuredSize != _lastSentMaximumUnobscuredSize.value()) >- [self _dispatchSetMaximumUnobscuredSize:WebCore::FloatSize(newMaximumUnobscuredSize)]; >- if (!_lastSentDeviceOrientation || newOrientation != _lastSentDeviceOrientation.value()) >- [self _dispatchSetDeviceOrientation:newOrientation]; >- >- while (!_snapshotsDeferredDuringResize.isEmpty()) >- _snapshotsDeferredDuringResize.takeLast()(); >+ // If we already have an up-to-date layer tree, immediately complete >+ // the resize. Otherwise, we will defer completion until we do. >+ _waitingForEndAnimatedResize = NO; >+ if (!_waitingForCommitAfterAnimatedResize) >+ [self _didCompleteAnimatedResize]; > } > > - (void)_resizeWhileHidingContentWithUpdates:(void (^)(void))updateBlock > { > LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView " << _page->pageID() << " _resizeWhileHidingContentWithUpdates:]"); > [self _beginAnimatedResizeWithUpdates:updateBlock]; >- if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::ResizingWithAnimation) { >+ if (_dynamicViewportUpdateMode == WebKit::DynamicViewportUpdateMode::ResizingWithAnimation) { > [_contentView setHidden:YES]; >- _dynamicViewportUpdateMode = DynamicViewportUpdateMode::ResizingWithDocumentHidden; >+ _dynamicViewportUpdateMode = WebKit::DynamicViewportUpdateMode::ResizingWithDocumentHidden; > } > } > >@@ -5360,7 +5384,7 @@ - (void)_setOverlaidAccessoryViewsInset:(CGSize)inset > > - (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler > { >- if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) { >+ if (_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) { > // Defer snapshotting until after the current resize completes. > void (^copiedCompletionHandler)(CGImageRef) = [completionHandler copy]; > RetainPtr<WKWebView> retainedSelf = self; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >index 9e139d0ec80379ff50ac4d99062f18c2f551a11f..7a7788f6e389d44000df576668303ccf73fbca4f 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h >@@ -82,7 +82,6 @@ struct PrintInfo; > - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction; > - (void)_layerTreeCommitComplete; > >-- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID; > - (void)_couldNotRestorePageState; > - (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)insets scale:(double)scale; > - (void)_restorePageStateToUnobscuredCenter:(std::optional<WebCore::FloatPoint>)center scale:(double)scale; // FIXME: needs scroll origin? >@@ -105,6 +104,8 @@ struct PrintInfo; > > - (void)_scheduleVisibleContentRectUpdate; > >+- (void)_didCompleteAnimatedResize; >+ > - (void)_didStartProvisionalLoadForMainFrame; > - (void)_didFinishLoadForMainFrame; > - (void)_didFailLoadForMainFrame; >diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h >index d7ef697d998a166697f11dc6f9e91e1c967e1819..b658fbb508d8543fe884c56b2f2aff6abdaf6535 100644 >--- a/Source/WebKit/UIProcess/PageClient.h >+++ b/Source/WebKit/UIProcess/PageClient.h >@@ -284,7 +284,6 @@ public: > virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&) = 0; > virtual void layerTreeCommitComplete() = 0; > >- virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) = 0; > virtual void couldNotRestorePageState() = 0; > virtual void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) = 0; > virtual void restorePageCenterAndScale(std::optional<WebCore::FloatPoint> center, double scale) = 0; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 451757cfb21962a698a8b08de5ff35e4dc1d7035..0f4d4bd5d498554e6e7edff61cfc4d4242ee9842 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -5968,9 +5968,6 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason) > #if PLATFORM(IOS) > m_firstLayerTreeTransactionIdAfterDidCommitLoad = 0; > m_lastVisibleContentRectUpdate = VisibleContentRectUpdateInfo(); >- m_dynamicViewportSizeUpdateWaitingForTarget = false; >- m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false; >- m_dynamicViewportSizeUpdateLayerTreeTransactionID = 0; > m_hasNetworkRequestsOnSuspended = false; > m_isKeyboardAnimatingIn = false; > m_isScrollingOrZooming = false; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 629b78d72346408e923fe716b06338c40336fb26..8a3b72799106591f3818a15e0fa244f4b32b855b 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -107,6 +107,7 @@ OBJC_CLASS _WKRemoteObjectRegistry; > #endif > > #if PLATFORM(COCOA) >+#include "DynamicViewportSizeUpdate.h" > #include "LayerRepresentation.h" > #include "TouchBarMenuData.h" > #include "TouchBarMenuItemData.h" >@@ -551,8 +552,7 @@ public: > void overflowScrollWillStartScroll(); > void overflowScrollDidEndScroll(); > >- void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation); >- void synchronizeDynamicViewportUpdate(); >+ void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, DynamicViewportSizeUpdateID); > > void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&); > void setMaximumUnobscuredSize(const WebCore::FloatSize&); >@@ -1663,7 +1663,6 @@ private: > WebCore::FloatSize overrideScreenSize(); > float textAutosizingWidth(); > >- void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID); > void couldNotRestorePageState(); > void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale); > void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double scale); >@@ -1844,11 +1843,7 @@ private: > VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate; > uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad { 0 }; > int32_t m_deviceOrientation { 0 }; >- uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID { 0 }; >- uint64_t m_currentDynamicViewportSizeUpdateID { 0 }; > bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true }; >- bool m_dynamicViewportSizeUpdateWaitingForTarget { false }; >- bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit { false }; > bool m_hasNetworkRequestsOnSuspended { false }; > bool m_isKeyboardAnimatingIn { false }; > bool m_isScrollingOrZooming { false }; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in >index e8b69cdf5df62c65fb85d42ad826456940c6ec6a..105f4cf4257a326b33c4e93561a8e593fa614e97 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in >@@ -389,7 +389,6 @@ messages -> WebPageProxy { > #endif > > #if PLATFORM(IOS) >- DynamicViewportUpdateChangedTarget(double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t dynamicViewportSizeUpdateID) > CouldNotRestorePageState() > RestorePageState(std::optional<WebCore::FloatPoint> scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::RectEdges<float> obscuredInsetsOnSave, double scale) > RestorePageCenterAndScale(std::optional<WebCore::FloatPoint> unobscuredCenter, double scale) >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >index 9a7464ba8a47098a0205d1cd468ac0662d02ac5d..152ff301603d14d17d6fdca5c4d94db2c0805c1c 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >@@ -120,7 +120,6 @@ private: > void didCommitLayerTree(const RemoteLayerTreeTransaction&) override; > void layerTreeCommitComplete() override; > >- void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) override; > void couldNotRestorePageState() override; > void restorePageState(std::optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatBoxExtent&, double) override; > void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double) override; >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >index 8cddc5413d533be2fb48fdd3c04385e968cf03fa..5daba6036418f712ca03966fdec70431b505df1a 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >@@ -515,11 +515,6 @@ void PageClientImpl::layerTreeCommitComplete() > [m_contentView _layerTreeCommitComplete]; > } > >-void PageClientImpl::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t nextValidLayerTreeTransactionID) >-{ >- [m_webView _dynamicViewportUpdateChangedTargetToScale:newScale position:newScrollPosition nextValidLayerTreeTransactionID:nextValidLayerTreeTransactionID]; >-} >- > void PageClientImpl::couldNotRestorePageState() > { > [m_webView _couldNotRestorePageState]; >diff --git a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >index 93732367b15404b1aeb7a4c0f90ef77d15b898db..fe0c737d7e5c509174799054db69f8ed7162cf79 100644 >--- a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >@@ -306,53 +306,17 @@ void WebPageProxy::overflowScrollDidEndScroll() > m_pageClient.overflowScrollDidEndScroll(); > } > >-void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation) >+void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, DynamicViewportSizeUpdateID dynamicViewportSizeUpdateID) > { > if (!isValid()) > return; > > hideValidationMessage(); > >- m_dynamicViewportSizeUpdateWaitingForTarget = true; >- m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = true; >- m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(viewLayoutSize, maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, unobscuredSafeAreaInsets, targetScale, deviceOrientation, ++m_currentDynamicViewportSizeUpdateID), m_pageID); >-} >- >-void WebPageProxy::synchronizeDynamicViewportUpdate() >-{ >- if (!isValid()) >- return; >- >- if (m_dynamicViewportSizeUpdateWaitingForTarget) { >- // We do not want the UIProcess to finish animated resize with the old content size, scale, etc. >- // If that happens, the UIProcess would start pushing new VisibleContentRectUpdateInfo to the WebProcess with >- // invalid informations. >- // >- // Ideally, the animated resize should just be transactional, and the UIProcess would remain in the "resize" state >- // until both DynamicViewportUpdateChangedTarget and the associated commitLayerTree are finished. >- // The tricky part with such implementation is if a second animated resize starts before the end of the previous one. >- // In that case, the values used for the target state needs to be computed from the output of the previous animated resize. >- // >- // The following is a workaround to have the UIProcess in a consistent state. >- // Instead of handling nested resize, we block the UIProcess until the animated resize finishes. >- double newScale; >- FloatPoint newScrollPosition; >- uint64_t nextValidLayerTreeTransactionID; >- if (m_process->sendSync(Messages::WebPage::SynchronizeDynamicViewportUpdate(), Messages::WebPage::SynchronizeDynamicViewportUpdate::Reply(newScale, newScrollPosition, nextValidLayerTreeTransactionID), m_pageID, 2_s)) { >- m_dynamicViewportSizeUpdateWaitingForTarget = false; >- m_dynamicViewportSizeUpdateLayerTreeTransactionID = nextValidLayerTreeTransactionID; >- m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition, nextValidLayerTreeTransactionID); >- } >- >- } >- >- // If m_dynamicViewportSizeUpdateWaitingForTarget is false, we are waiting for the next valid frame with the hope it is the one for the new target. >- // If m_dynamicViewportSizeUpdateWaitingForTarget is still true, this is a desperate attempt to get the valid frame before finishing the animation. >- if (m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit) >- m_drawingArea->waitForDidUpdateActivityState(); >- >- m_dynamicViewportSizeUpdateWaitingForTarget = false; >- m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false; >+ m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(viewLayoutSize, >+ maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, >+ targetUnobscuredRectInScrollViewCoordinates, unobscuredSafeAreaInsets, >+ targetScale, deviceOrientation, dynamicViewportSizeUpdateID), m_pageID); > } > > void WebPageProxy::setViewportConfigurationViewLayoutSize(const WebCore::FloatSize& size) >@@ -407,11 +371,6 @@ void WebPageProxy::didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction& > } > } > >- if (!m_dynamicViewportSizeUpdateWaitingForTarget && m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit) { >- if (layerTreeTransaction.transactionID() >= m_dynamicViewportSizeUpdateLayerTreeTransactionID) >- m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false; >- } >- > m_pageClient.didCommitLayerTree(layerTreeTransaction); > > // FIXME: Remove this special mechanism and fold it into the transaction's layout milestones. >@@ -904,18 +863,6 @@ float WebPageProxy::textAutosizingWidth() > return WebCore::screenSize().width(); > } > >-void WebPageProxy::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID) >-{ >- if (dynamicViewportSizeUpdateID != m_currentDynamicViewportSizeUpdateID) >- return; >- >- if (m_dynamicViewportSizeUpdateWaitingForTarget) { >- m_dynamicViewportSizeUpdateLayerTreeTransactionID = downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).nextLayerTreeTransactionID(); >- m_dynamicViewportSizeUpdateWaitingForTarget = false; >- m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition, m_dynamicViewportSizeUpdateLayerTreeTransactionID); >- } >-} >- > void WebPageProxy::couldNotRestorePageState() > { > m_pageClient.couldNotRestorePageState(); >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 2d311754c212eb3bb0cb241ff69f6f23aedc84a4..bc0ca61da3bf9e8034294e1fdfb989b35514020e 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -677,6 +677,7 @@ > 2DA049B8180CCD0A00AAFA9E /* GraphicsLayerCARemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */; }; > 2DA1E4FE18C02B6A00DBC929 /* WKLegacyPDFView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA1E4FC18C02B6A00DBC929 /* WKLegacyPDFView.h */; }; > 2DA1E4FF18C02B6A00DBC929 /* WKLegacyPDFView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA1E4FD18C02B6A00DBC929 /* WKLegacyPDFView.mm */; }; >+ 2DA6731A20C754B1003CB401 /* DynamicViewportSizeUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA6731920C754B1003CB401 /* DynamicViewportSizeUpdate.h */; }; > 2DA9449E1884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */; }; > 2DA9449F1884E4F000ED86DB /* NativeWebTouchEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */; }; > 2DA944A01884E4F000ED86DB /* WebIOSEventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA944991884E4F000ED86DB /* WebIOSEventFactory.h */; }; >@@ -3055,6 +3056,7 @@ > 2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerCARemote.h; sourceTree = "<group>"; }; > 2DA1E4FC18C02B6A00DBC929 /* WKLegacyPDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKLegacyPDFView.h; path = ios/WKLegacyPDFView.h; sourceTree = "<group>"; }; > 2DA1E4FD18C02B6A00DBC929 /* WKLegacyPDFView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKLegacyPDFView.mm; path = ios/WKLegacyPDFView.mm; sourceTree = "<group>"; }; >+ 2DA6731920C754B1003CB401 /* DynamicViewportSizeUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicViewportSizeUpdate.h; path = ios/DynamicViewportSizeUpdate.h; sourceTree = "<group>"; }; > 2DA7FDCB18F88625008DDED0 /* FindIndicatorOverlayClientIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FindIndicatorOverlayClientIOS.h; path = ios/FindIndicatorOverlayClientIOS.h; sourceTree = "<group>"; }; > 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NativeWebKeyboardEventIOS.mm; path = ios/NativeWebKeyboardEventIOS.mm; sourceTree = "<group>"; }; > 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NativeWebTouchEventIOS.mm; path = ios/NativeWebTouchEventIOS.mm; sourceTree = "<group>"; }; >@@ -5779,6 +5781,7 @@ > isa = PBXGroup; > children = ( > A7E93CEB192531AA00A1DC48 /* ChildProcessIOS.mm */, >+ 2DA6731920C754B1003CB401 /* DynamicViewportSizeUpdate.h */, > 2DA9449D1884E4F000ED86DB /* GestureTypes.h */, > C5BCE5DA1C50761D00CDE3FA /* InteractionInformationAtPosition.h */, > C5BCE5DB1C50761D00CDE3FA /* InteractionInformationAtPosition.mm */, >@@ -8941,6 +8944,7 @@ > 1A64229A12DD029200CAAE2C /* DrawingAreaMessages.h in Headers */, > BC2652171182608100243E12 /* DrawingAreaProxy.h in Headers */, > 1A64230912DD09EB00CAAE2C /* DrawingAreaProxyMessages.h in Headers */, >+ 2DA6731A20C754B1003CB401 /* DynamicViewportSizeUpdate.h in Headers */, > E105FE5418D7B9DE008F57A8 /* EditingRange.h in Headers */, > 1AA41AB512C02EC4002BE67B /* EditorState.h in Headers */, > BC032DA810F437D10058C15A /* Encoder.h in Headers */, >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 9703d4976c1fc92548823e6e8bf5841ace5e59f7..8d23abdddcecfec0c530845db05d024dd61bc965 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -3226,11 +3226,13 @@ void WebPage::willCommitLayerTree(RemoteLayerTreeTransaction& layerTransaction) > layerTransaction.setAvoidsUnsafeArea(m_viewportConfiguration.avoidsUnsafeArea()); > layerTransaction.setIsInStableState(m_isInStableState); > layerTransaction.setAllowsUserScaling(allowsUserScaling()); >+ if (m_pendingDynamicViewportSizeUpdateID) { >+ layerTransaction.setDynamicViewportSizeUpdateID(*m_pendingDynamicViewportSizeUpdateID); >+ m_pendingDynamicViewportSizeUpdateID = std::nullopt; >+ } > #endif > >-#if PLATFORM(MAC) > layerTransaction.setScrollPosition(frameView->scrollPosition()); >-#endif > > if (m_hasPendingEditorStateUpdate) { > layerTransaction.setEditorState(editorState()); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 1699a91157baa78c8862db63076c080cdff6e533..9a51dc174aa16c27db185ca708e2a734d220aeea 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -107,6 +107,7 @@ > #endif > > #if PLATFORM(COCOA) >+#include "DynamicViewportSizeUpdate.h" > #include <WebCore/VisibleSelection.h> > #include <wtf/RetainPtr.h> > OBJC_CLASS CALayer; >@@ -882,8 +883,7 @@ public: > void setViewportConfigurationViewLayoutSize(const WebCore::FloatSize&); > void setMaximumUnobscuredSize(const WebCore::FloatSize&); > void setDeviceOrientation(int32_t); >- void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID); >- void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID); >+ void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, DynamicViewportSizeUpdateID); > std::optional<float> scaleFromUIProcess(const VisibleContentRectUpdateInfo&) const; > void updateVisibleContentRects(const VisibleContentRectUpdateInfo&, MonotonicTime oldestTimestamp); > bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; } >@@ -1654,6 +1654,7 @@ private: > WebCore::FloatPoint m_pendingSyntheticClickLocation; > WebCore::FloatRect m_previousExposedContentRect; > uint64_t m_currentAssistedNodeIdentifier { 0 }; >+ std::optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID; > #endif > > WebCore::Timer m_layerVolatilityTimer; >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index 7e1503065a26ad67e3daa3a368241c006c21d706..ab0ce64aa0b8885cfb402d9ac1799a5e3f4028ed 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -49,7 +49,6 @@ messages -> WebPage LegacyReceiver { > SetMaximumUnobscuredSize(WebCore::FloatSize size) > SetDeviceOrientation(int32_t deviceOrientation) > DynamicViewportSizeUpdate(WebCore::FloatSize viewLayoutSize, WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, WebCore::RectEdges<float> targetUnobscuredSafeAreaInsets, double scale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID) >- SynchronizeDynamicViewportUpdate() -> (double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t nextValidLayerTreeTransactionID) > > HandleTap(WebCore::IntPoint point, uint64_t lastLayerTreeTransactionId) > PotentialTapAtPosition(uint64_t requestID, WebCore::FloatPoint point) >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index cf8c6fe1b0e7d72fa1b48c1d8342927b805f9b3b..8b5d37c4268cf0522d12f7b5eaaafa41df8b7140 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -2495,7 +2495,7 @@ void WebPage::resetTextAutosizing() > } > } > >-void WebPage::dynamicViewportSizeUpdate(const FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, uint64_t dynamicViewportSizeUpdateID) >+void WebPage::dynamicViewportSizeUpdate(const FloatSize& viewLayoutSize, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& targetUnobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, DynamicViewportSizeUpdateID dynamicViewportSizeUpdateID) > { > SetForScope<bool> dynamicSizeUpdateGuard(m_inDynamicSizeUpdate, true); > // FIXME: this does not handle the cases where the content would change the content size or scroll position from JavaScript. >@@ -2672,14 +2672,7 @@ void WebPage::dynamicViewportSizeUpdate(const FloatSize& viewLayoutSize, const W > > m_drawingArea->scheduleCompositingLayerFlush(); > >- send(Messages::WebPageProxy::DynamicViewportUpdateChangedTarget(pageScaleFactor(), frameView.scrollPosition(), dynamicViewportSizeUpdateID)); >-} >- >-void WebPage::synchronizeDynamicViewportUpdate(double& newTargetScale, FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID) >-{ >- newTargetScale = pageScaleFactor(); >- newScrollPosition = m_page->mainFrame().view()->scrollPosition(); >- nextValidLayerTreeTransactionID = downcast<RemoteLayerTreeDrawingArea>(*m_drawingArea).nextTransactionID(); >+ m_pendingDynamicViewportSizeUpdateID = dynamicViewportSizeUpdateID; > } > > void WebPage::resetViewportDefaultConfiguration(WebFrame* frame, bool hasMobileDocType)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186130
:
341649
|
341717
|
342020
|
342036
| 342037 |
342041