Unreviewed, rolling out r199259 and r200161.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2016 22:20:07 +0000 (22:20 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2016 22:20:07 +0000 (22:20 +0000)
Seems to have caused a ~1.2% PLT regression on iOS

Reverted changesets:

"[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
determine tiling area"
https://bugs.webkit.org/show_bug.cgi?id=156429
http://trac.webkit.org/changeset/199259

"[iOS WK2] When determining tile size, check whether ancestor
UIScrollViews are actually scrollable"
https://bugs.webkit.org/show_bug.cgi?id=157107
http://trac.webkit.org/changeset/200161

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200390 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/ScrollView.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp
Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/WKContentView.h
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

index e6a0530..606e73b 100644 (file)
@@ -1,3 +1,21 @@
+2016-05-03  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r199259 and r200161.
+
+        Seems to have caused a ~1.2% PLT regression on iOS
+
+        Reverted changesets:
+
+        "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
+        determine tiling area"
+        https://bugs.webkit.org/show_bug.cgi?id=156429
+        http://trac.webkit.org/changeset/199259
+
+        "[iOS WK2] When determining tile size, check whether ancestor
+        UIScrollViews are actually scrollable"
+        https://bugs.webkit.org/show_bug.cgi?id=157107
+        http://trac.webkit.org/changeset/200161
+
 2016-05-03  Filip Pizlo  <fpizlo@apple.com>
 
         Speed up JSGlobalObject initialization by making some properties lazy
index 3303d33..767805f 100644 (file)
@@ -79,19 +79,15 @@ void HistoryController::saveScrollPositionAndViewStateToItem(HistoryItem* item)
         item->setScrollPosition(frameView->cachedScrollPosition());
     else
         item->setScrollPosition(frameView->scrollPosition());
-
 #if PLATFORM(IOS)
     item->setExposedContentRect(frameView->exposedContentRect());
     item->setUnobscuredContentRect(frameView->unobscuredContentRect());
+    item->setObscuredInset(frameView->platformObscuredInset());
 #endif
 
     Page* page = m_frame.page();
-    if (page && m_frame.isMainFrame()) {
+    if (page && m_frame.isMainFrame())
         item->setPageScaleFactor(page->pageScaleFactor() / page->viewScaleFactor());
-#if PLATFORM(IOS)
-        item->setObscuredInset(page->obscuredInset());
-#endif
-    }
 
     // FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client.
     m_frame.loader().client().saveViewStateToItem(item);
index edfc3cf..bcc2f3a 100644 (file)
@@ -2485,11 +2485,6 @@ void FrameView::adjustTiledBackingScrollability()
     bool verticallyScrollable;
     bool clippedByAncestorView = static_cast<bool>(m_viewExposedRect);
 
-#if PLATFORM(IOS)
-    if (Page* page = frame().page())
-        clippedByAncestorView |= page->enclosedInScrollableAncestorView();
-#endif
-
     if (delegatesScrolling()) {
         IntSize documentSize = contentsSize();
         IntSize visibleSize = this->visibleSize();
index c569840..35b9602 100644 (file)
@@ -294,15 +294,7 @@ public:
 
     float topContentInset() const { return m_topContentInset; }
     WEBCORE_EXPORT void setTopContentInset(float);
-
-#if PLATFORM(IOS)
-    FloatSize obscuredInset() const { return m_obscuredInset; }
-    void setObscuredInset(FloatSize inset) { m_obscuredInset = inset; }
     
-    bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
-    void setEnclosedInScrollableAncestorView(bool f) { m_enclosedInScrollableAncestorView = f; }
-#endif
-
 #if ENABLE(IOS_TEXT_AUTOSIZING)
     float textAutosizingWidth() const { return m_textAutosizingWidth; }
     void setTextAutosizingWidth(float textAutosizingWidth) { m_textAutosizingWidth = textAutosizingWidth; }
@@ -608,13 +600,7 @@ private:
     float m_viewScaleFactor { 1 };
 
     float m_topContentInset;
-
-#if PLATFORM(IOS)
-    // This is only used for history scroll position restoration.
-    FloatSize m_obscuredInset;
-    bool m_enclosedInScrollableAncestorView { false };
-#endif
-
+    
 #if ENABLE(IOS_TEXT_AUTOSIZING)
     float m_textAutosizingWidth;
 #endif
index 4f805a2..1ac6baf 100644 (file)
@@ -378,6 +378,11 @@ public:
 
     WEBCORE_EXPORT void scrollOffsetChangedViaPlatformWidget(const ScrollOffset& oldOffset, const ScrollOffset& newOffset);
 
+#if PLATFORM(IOS)
+    FloatSize platformObscuredInset() const { return m_obscuredInset; }
+    void platformSetObscuredInset(FloatSize inset) { m_obscuredInset = inset; }
+#endif
+
 protected:
     ScrollView();
 
@@ -453,6 +458,7 @@ private:
     FloatRect m_exposedContentRect;
     FloatSize m_unobscuredContentSize;
     // This is only used for history scroll position restoration.
+    FloatSize m_obscuredInset;
 #else
     IntRect m_fixedVisibleContentRect;
 #endif
index 583c1de..e5490bc 100644 (file)
@@ -1,3 +1,21 @@
+2016-05-03  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r199259 and r200161.
+
+        Seems to have caused a ~1.2% PLT regression on iOS
+
+        Reverted changesets:
+
+        "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
+        determine tiling area"
+        https://bugs.webkit.org/show_bug.cgi?id=156429
+        http://trac.webkit.org/changeset/199259
+
+        "[iOS WK2] When determining tile size, check whether ancestor
+        UIScrollViews are actually scrollable"
+        https://bugs.webkit.org/show_bug.cgi?id=157107
+        http://trac.webkit.org/changeset/200161
+
 2016-05-03  Dean Jackson  <dino@apple.com>
 
         CSS Grid should be an experimental feature flag
index e93eb6b..4d46eea 100644 (file)
@@ -46,7 +46,6 @@ void VisibleContentRectUpdateInfo::encode(IPC::ArgumentEncoder& encoder) const
     encoder << m_inStableState;
     encoder << m_isChangingObscuredInsetsInteractively;
     encoder << m_allowShrinkToFit;
-    encoder << m_enclosedInScrollableAncestorView;
 }
 
 bool VisibleContentRectUpdateInfo::decode(IPC::ArgumentDecoder& decoder, VisibleContentRectUpdateInfo& result)
@@ -79,8 +78,6 @@ bool VisibleContentRectUpdateInfo::decode(IPC::ArgumentDecoder& decoder, Visible
         return false;
     if (!decoder.decode(result.m_allowShrinkToFit))
         return false;
-    if (!decoder.decode(result.m_enclosedInScrollableAncestorView))
-        return false;
 
     return true;
 }
index d59d3ca..0f37014 100644 (file)
@@ -41,7 +41,7 @@ public:
 
     VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect,
         const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect,
-        const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView,
+        const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit,
         double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
         : m_exposedContentRect(exposedContentRect)
         , m_unobscuredContentRect(unobscuredContentRect)
@@ -57,7 +57,6 @@ public:
         , m_inStableState(inStableState)
         , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively)
         , m_allowShrinkToFit(allowShrinkToFit)
-        , m_enclosedInScrollableAncestorView(enclosedInScrollableAncestorView)
     {
     }
 
@@ -71,7 +70,6 @@ public:
     bool inStableState() const { return m_inStableState; }
     bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; }
     bool allowShrinkToFit() const { return m_allowShrinkToFit; }
-    bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
 
     double timestamp() const { return m_timestamp; }
     double horizontalVelocity() const { return m_horizontalVelocity; }
@@ -98,7 +96,6 @@ private:
     bool m_inStableState { false };
     bool m_isChangingObscuredInsetsInteractively { false };
     bool m_allowShrinkToFit { false };
-    bool m_enclosedInScrollableAncestorView { false };
 };
 
 inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleContentRectUpdateInfo& b)
@@ -113,8 +110,7 @@ inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleConte
         && a.verticalVelocity() == b.verticalVelocity()
         && a.scaleChangeRate() == b.scaleChangeRate()
         && a.inStableState() == b.inStableState()
-        && a.allowShrinkToFit() == b.allowShrinkToFit()
-        && a.enclosedInScrollableAncestorView() == b.enclosedInScrollableAncestorView();
+        && a.allowShrinkToFit() == b.allowShrinkToFit();
 }
 
 } // namespace WebKit
index 391929c..38bb051 100644 (file)
@@ -242,9 +242,6 @@ WKWebView* fromWebPageProxy(WebKit::WebPageProxy& page)
     RetainPtr<UIView <WKWebViewContentProvider>> _customContentView;
     RetainPtr<UIView> _customContentFixedOverlayView;
 
-    RetainPtr<NSTimer> _enclosingScrollViewScrollTimer;
-    BOOL _didScrollSinceLastTimerFire;
-
     WebCore::Color _scrollViewBackgroundColor;
 
     // This value tracks the current adjustment added to the bottom inset due to the keyboard sliding out from the bottom
@@ -1047,7 +1044,7 @@ static CGSize roundScrollViewContentSize(const WebKit::WebPageProxy& page, CGSiz
     _delayUpdateVisibleContentRects = NO;
     if (_hadDelayedUpdateVisibleContentRects) {
         _hadDelayedUpdateVisibleContentRects = NO;
-        [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
+        [self _updateVisibleContentRects];
     }
 }
 
@@ -1791,7 +1788,7 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
     if (![self usesStandardContentView])
         return;
 
-    [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
+    [self _updateVisibleContentRects];
     [_contentView didFinishScrolling];
 }
 
@@ -1845,7 +1842,7 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
     if (![self usesStandardContentView])
         [_customContentView scrollViewDidScroll:(UIScrollView *)scrollView];
 
-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
+    [self _updateVisibleContentRects];
     
     if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page->scrollingPerformanceData())
         scrollPerfData->didScroll([self visibleRectInViewCoordinates]);
@@ -1854,13 +1851,13 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
 - (void)scrollViewDidZoom:(UIScrollView *)scrollView
 {
     [self _updateScrollViewBackground];
-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
+    [self _updateVisibleContentRects];
 }
 
 - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
 {
     ASSERT(scrollView == _scrollView);
-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
+    [self _updateVisibleContentRects];
     [_contentView didZoomToScale:scale];
 }
 
@@ -1875,55 +1872,7 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
         return;
 
     [_contentView didInterruptScrolling];
-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
-}
-
-- (CGRect)_visibleRectInEnclosingScrollView:(UIScrollView *)enclosingScrollView
-{
-    if (!enclosingScrollView)
-        return self.bounds;
-
-    CGRect exposedRect = [enclosingScrollView convertRect:enclosingScrollView.bounds toView:self];
-    return CGRectIntersectsRect(exposedRect, self.bounds) ? CGRectIntersection(exposedRect, self.bounds) : CGRectZero;
-}
-
-- (CGRect)_visibleContentRect
-{
-    CGRect visibleRectInContentCoordinates = _frozenVisibleContentRect ? _frozenVisibleContentRect.value() : [self convertRect:self.bounds toView:_contentView.get()];
-    
-    if (UIScrollView *enclosingScroller = [self _scroller]) {
-        CGRect viewVisibleRect = [self _visibleRectInEnclosingScrollView:enclosingScroller];
-        CGRect viewVisibleContentRect = [self convertRect:viewVisibleRect toView:_contentView.get()];
-        visibleRectInContentCoordinates = CGRectIntersection(visibleRectInContentCoordinates, viewVisibleContentRect);
-    }
-
-    return visibleRectInContentCoordinates;
-}
-
-// Called when some ancestor UIScrollView scrolls.
-- (void)_didScroll
-{
-    [self _updateVisibleContentRectAfterScrollInView:[self _scroller]];
-
-    const NSTimeInterval ScrollingEndedTimerInterval = 0.032;
-    if (!_enclosingScrollViewScrollTimer) {
-        _enclosingScrollViewScrollTimer = adoptNS([[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:ScrollingEndedTimerInterval]
-            interval:0 target:self selector:@selector(_enclosingScrollerScrollingEnded:) userInfo:nil repeats:YES]);
-        [[NSRunLoop mainRunLoop] addTimer:_enclosingScrollViewScrollTimer.get() forMode:NSDefaultRunLoopMode];
-    }
-    _didScrollSinceLastTimerFire = YES;
-}
-
-- (void)_enclosingScrollerScrollingEnded:(NSTimer *)timer
-{
-    if (_didScrollSinceLastTimerFire) {
-        _didScrollSinceLastTimerFire = NO;
-        return;
-    }
-
     [self _updateVisibleContentRects];
-    [_enclosingScrollViewScrollTimer invalidate];
-    _enclosingScrollViewScrollTimer = nil;
 }
 
 - (void)_frameOrBoundsChanged
@@ -1936,7 +1885,7 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
             _page->setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(bounds.size));
         if (!_overridesMaximumUnobscuredSize)
             _page->setMaximumUnobscuredSize(WebCore::FloatSize(bounds.size));
-        if (auto drawingArea = _page->drawingArea())
+        if (WebKit::DrawingAreaProxy* drawingArea = _page->drawingArea())
             drawingArea->setSize(WebCore::IntSize(bounds.size), WebCore::IntSize(), WebCore::IntSize());
     }
 
@@ -1966,42 +1915,6 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
 
 - (void)_updateVisibleContentRects
 {
-    // For visible rect updates not associated with a spefic UIScrollView, just consider our own scroller.
-    [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
-}
-
-- (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView
-{
-    BOOL isStableState = !([scrollView isDragging] || [scrollView isDecelerating] || [scrollView isZooming] || [scrollView _isAnimatingZoom] || [scrollView _isScrollingToTop]);
-
-    if (isStableState && scrollView == _scrollView.get())
-        isStableState = !_isChangingObscuredInsetsInteractively;
-    
-    if (isStableState && scrollView == _scrollView.get())
-        isStableState = ![self _scrollViewIsRubberBanding];
-
-    // FIXME: this can be made static after we stop supporting iOS 8.x.
-    if (isStableState && [scrollView respondsToSelector:@selector(_isInterruptingDeceleration)])
-        isStableState = ![scrollView performSelector:@selector(_isInterruptingDeceleration)];
-
-    [self _updateContentRectsWithState:isStableState];
-}
-
-static bool scrollViewCanScroll(UIScrollView *scrollView)
-{
-    if (!scrollView)
-        return NO;
-
-    UIEdgeInsets contentInset = scrollView.contentInset;
-    CGSize contentSize = scrollView.contentSize;
-    CGSize boundsSize = scrollView.bounds.size;
-
-    return (contentSize.width + contentInset.left + contentInset.right) > boundsSize.width
-        || (contentSize.height + contentInset.top + contentInset.bottom) > boundsSize.height;
-}
-
-- (void)_updateContentRectsWithState:(BOOL)inStableState
-{
     if (![self usesStandardContentView]) {
         [_customContentView web_computedContentInsetDidChange];
         return;
@@ -2019,7 +1932,7 @@ static bool scrollViewCanScroll(UIScrollView *scrollView)
         return;
 
     CGRect fullViewRect = self.bounds;
-    CGRect visibleRectInContentCoordinates = [self _visibleContentRect];
+    CGRect visibleRectInContentCoordinates = _frozenVisibleContentRect ? _frozenVisibleContentRect.value() : [self convertRect:fullViewRect toView:_contentView.get()];
 
     UIEdgeInsets computedContentInsetUnadjustedForKeyboard = [self _computedContentInset];
     if (!_haveSetObscuredInsets)
@@ -2030,10 +1943,17 @@ static bool scrollViewCanScroll(UIScrollView *scrollView)
 
     CGFloat scaleFactor = contentZoomScale(self);
 
+    BOOL isStableState = !(_isChangingObscuredInsetsInteractively || [_scrollView isDragging] || [_scrollView isDecelerating] || [_scrollView isZooming] || [_scrollView _isAnimatingZoom] || [_scrollView _isScrollingToTop] || [self _scrollViewIsRubberBanding]);
+
+    // FIXME: this can be made static after we stop supporting iOS 8.x.
+    if (isStableState && [_scrollView respondsToSelector:@selector(_isInterruptingDeceleration)])
+        isStableState = ![_scrollView performSelector:@selector(_isInterruptingDeceleration)];
+
 #if ENABLE(CSS_SCROLL_SNAP) && ENABLE(ASYNC_SCROLLING)
-    if (inStableState) {
+    if (isStableState) {
         WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy();
         if (coordinator && coordinator->hasActiveSnapPoint()) {
+            CGRect fullViewRect = self.bounds;
             CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, computedContentInsetUnadjustedForKeyboard);
             
             CGPoint currentPoint = [_scrollView contentOffset];
@@ -2054,9 +1974,8 @@ static bool scrollViewCanScroll(UIScrollView *scrollView)
         unobscuredRectInScrollViewCoordinates:unobscuredRect
         obscuredInset:CGSizeMake(_obscuredInsets.left, _obscuredInsets.top)
         scale:scaleFactor minimumScale:[_scrollView minimumZoomScale]
-        inStableState:inStableState
-        isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively
-        enclosedInScrollableAncestorView:scrollViewCanScroll([self _scroller])];
+        inStableState:isStableState
+        isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively];
 }
 
 - (void)_didFinishLoadForMainFrame
index 6e9d435..b531a31 100644 (file)
@@ -99,8 +99,6 @@ struct PrintInfo;
 - (void)_didInvokeUIScrollViewDelegateCallback;
 
 - (void)_updateVisibleContentRects;
-- (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView;
-- (void)_updateContentRectsWithState:(BOOL)inStableState;
 
 - (void)_didFinishLoadForMainFrame;
 - (void)_didFailLoadForMainFrame;
index 9ffacdd..a10d207 100644 (file)
@@ -455,7 +455,7 @@ public:
     const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
     const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
 
-    void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
+    void updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
     void resendLastVisibleContentRects();
 
     enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
index 1f5e530..cad014c 100644 (file)
@@ -70,9 +70,7 @@ class WebProcessPool;
     unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
     obscuredInset:(CGSize)topInset
     scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale
-    inStableState:(BOOL)isStableState
-    isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
-    enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView;
+    inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively;
 
 - (void)didFinishScrolling;
 - (void)didInterruptScrolling;
index c1ad11a..b395b26 100644 (file)
@@ -356,12 +356,8 @@ private:
 }
 
 - (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
-    obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView
+    obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
 {
-    auto drawingArea = _page->drawingArea();
-    if (!drawingArea)
-        return;
-
     double timestamp = monotonicallyIncreasingTime();
     HistoricalVelocityData::VelocityData velocityData;
     if (!isStableState)
@@ -370,32 +366,16 @@ private:
         _historicalKinematicData.clear();
 
     FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
-
-    VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(
-        visibleRect,
-        unobscuredRect,
-        unobscuredRectInScrollViewCoordinates,
-        fixedPositionRectForLayout,
-        WebCore::FloatSize(obscuredInset),
-        zoomScale,
-        isStableState,
-        isChangingObscuredInsetsInteractively,
-        _webView._allowsViewportShrinkToFit,
-        enclosedInScrollableAncestorView,
-        timestamp,
-        velocityData.horizontalVelocity,
-        velocityData.verticalVelocity,
-        velocityData.scaleChangeRate,
-        downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea).lastCommittedLayerTreeTransactionID());
-
-    _page->updateVisibleContentRects(visibleContentRectUpdateInfo);
+    _page->updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout, WebCore::FloatSize(obscuredInset),
+        zoomScale, isStableState, isChangingObscuredInsetsInteractively, _webView._allowsViewportShrinkToFit, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate);
 
     RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
     FloatRect fixedPositionRect = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), zoomScale);
     scrollingCoordinator->viewportChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), fixedPositionRect, zoomScale);
 
-    drawingArea->updateDebugIndicator();
-    
+    if (auto drawingArea = _page->drawingArea())
+        drawingArea->updateDebugIndicator();
+        
     [self updateFixedClippingView:fixedPositionRect];
 }
 
index 1b851b8..fa4cbd6 100644 (file)
@@ -182,16 +182,18 @@ void WebPageProxy::autocorrectionContextCallback(const String& beforeText, const
     callback->performCallbackWithReturnValue(beforeText, markedText, selectedText, afterText, location, length);
 }
 
-void WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdate)
+void WebPageProxy::updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate)
 {
     if (!isValid())
         return;
 
-    if (visibleContentRectUpdate == m_lastVisibleContentRectUpdate)
+    VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, obscuredInset, scale, inStableState, isChangingObscuredInsetsInteractively, allowShrinkToFit, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).lastCommittedLayerTreeTransactionID());
+
+    if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
         return;
 
-    m_lastVisibleContentRectUpdate = visibleContentRectUpdate;
-    m_process->send(Messages::ViewUpdateDispatcher::VisibleContentRectUpdate(m_pageID, visibleContentRectUpdate), 0);
+    m_lastVisibleContentRectUpdate = visibleContentRectUpdateInfo;
+    m_process->send(Messages::ViewUpdateDispatcher::VisibleContentRectUpdate(m_pageID, visibleContentRectUpdateInfo), 0);
 }
 
 void WebPageProxy::resendLastVisibleContentRects()
index 6f296e7..74e5b06 100644 (file)
@@ -259,8 +259,6 @@ FloatPoint RemoteLayerTreeDrawingAreaProxy::indicatorLocation() const
     if (m_webPageProxy.delegatesScrolling()) {
 #if PLATFORM(IOS)
         FloatPoint tiledMapLocation = m_webPageProxy.unobscuredContentRect().location();
-        tiledMapLocation = tiledMapLocation.expandedTo(m_webPageProxy.exposedContentRect().location() + FloatSize(0, 60));
-
         float absoluteInset = indicatorInset / m_webPageProxy.displayedContentScale();
         tiledMapLocation += FloatSize(absoluteInset, absoluteInset);
 #else
index 54dd838..6f60012 100644 (file)
@@ -2966,8 +2966,7 @@ void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visi
         viewportConfigurationChanged();
 
     frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size());
-    m_page->setObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
-    m_page->setEnclosedInScrollableAncestorView(visibleContentRectUpdateInfo.enclosedInScrollableAncestorView());
+    frameView.platformSetObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
 
     double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
     double verticalVelocity = visibleContentRectUpdateInfo.verticalVelocity();