Changeset 200470 in webkit


Ignore:
Timestamp:
May 5, 2016 1:01:13 PM (8 years ago)
Author:
Simon Fraser
Message:

Revert r200390, thus putting r199259 and r200161 and back.

Source/WebCore:

  • loader/HistoryController.cpp:

(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):

  • page/FrameView.cpp:

(WebCore::FrameView::adjustTiledBackingScrollability):

  • page/Page.h:

(WebCore::Page::obscuredInset):
(WebCore::Page::setObscuredInset):
(WebCore::Page::enclosedInScrollableAncestorView):
(WebCore::Page::setEnclosedInScrollableAncestorView):

  • platform/ScrollView.h:

(WebCore::ScrollView::platformObscuredInset): Deleted.
(WebCore::ScrollView::platformSetObscuredInset): Deleted.

Source/WebKit2:

  • Shared/VisibleContentRectUpdateInfo.cpp:

(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):

  • Shared/VisibleContentRectUpdateInfo.h:

(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
(WebKit::operator==):

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
(-[WKWebView _didFinishScrolling]):
(-[WKWebView scrollViewDidScroll:]):
(-[WKWebView scrollViewDidZoom:]):
(-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
(-[WKWebView _scrollViewDidInterruptDecelerating:]):
(-[WKWebView _visibleRectInEnclosingScrollView:]):
(-[WKWebView _visibleContentRect]):
(-[WKWebView _didScroll]):
(-[WKWebView _enclosingScrollerScrollingEnded:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
(scrollViewCanScroll):
(-[WKWebView _updateContentRectsWithState:]):

  • UIProcess/API/Cocoa/WKWebViewInternal.h:
  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/WKContentView.h:
  • UIProcess/ios/WKContentView.mm:

(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::updateVisibleContentRects):

  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:

(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::updateVisibleContentRects):

Location:
trunk/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r200469 r200470  
     12016-05-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Revert r200390, thus putting r199259 and r200161 and back.
     4
     5        * loader/HistoryController.cpp:
     6        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
     7        * page/FrameView.cpp:
     8        (WebCore::FrameView::adjustTiledBackingScrollability):
     9        * page/Page.h:
     10        (WebCore::Page::obscuredInset):
     11        (WebCore::Page::setObscuredInset):
     12        (WebCore::Page::enclosedInScrollableAncestorView):
     13        (WebCore::Page::setEnclosedInScrollableAncestorView):
     14        * platform/ScrollView.h:
     15        (WebCore::ScrollView::platformObscuredInset): Deleted.
     16        (WebCore::ScrollView::platformSetObscuredInset): Deleted.
     17
    1182016-05-05  Sam Weinig  <sam@webkit.org>
    219
  • trunk/Source/WebCore/loader/HistoryController.cpp

    r200390 r200470  
    8080    else
    8181        item->setScrollPosition(frameView->scrollPosition());
     82
    8283#if PLATFORM(IOS)
    8384    item->setExposedContentRect(frameView->exposedContentRect());
    8485    item->setUnobscuredContentRect(frameView->unobscuredContentRect());
    85     item->setObscuredInset(frameView->platformObscuredInset());
    8686#endif
    8787
    8888    Page* page = m_frame.page();
    89     if (page && m_frame.isMainFrame())
     89    if (page && m_frame.isMainFrame()) {
    9090        item->setPageScaleFactor(page->pageScaleFactor() / page->viewScaleFactor());
     91#if PLATFORM(IOS)
     92        item->setObscuredInset(page->obscuredInset());
     93#endif
     94    }
    9195
    9296    // FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client.
  • trunk/Source/WebCore/page/FrameView.cpp

    r200390 r200470  
    24862486    bool clippedByAncestorView = static_cast<bool>(m_viewExposedRect);
    24872487
     2488#if PLATFORM(IOS)
     2489    if (Page* page = frame().page())
     2490        clippedByAncestorView |= page->enclosedInScrollableAncestorView();
     2491#endif
     2492
    24882493    if (delegatesScrolling()) {
    24892494        IntSize documentSize = contentsSize();
  • trunk/Source/WebCore/page/Page.h

    r200390 r200470  
    295295    float topContentInset() const { return m_topContentInset; }
    296296    WEBCORE_EXPORT void setTopContentInset(float);
     297
     298#if PLATFORM(IOS)
     299    FloatSize obscuredInset() const { return m_obscuredInset; }
     300    void setObscuredInset(FloatSize inset) { m_obscuredInset = inset; }
    297301   
     302    bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
     303    void setEnclosedInScrollableAncestorView(bool f) { m_enclosedInScrollableAncestorView = f; }
     304#endif
     305
    298306#if ENABLE(IOS_TEXT_AUTOSIZING)
    299307    float textAutosizingWidth() const { return m_textAutosizingWidth; }
     
    601609
    602610    float m_topContentInset;
    603    
     611
     612#if PLATFORM(IOS)
     613    // This is only used for history scroll position restoration.
     614    FloatSize m_obscuredInset;
     615    bool m_enclosedInScrollableAncestorView { false };
     616#endif
     617
    604618#if ENABLE(IOS_TEXT_AUTOSIZING)
    605619    float m_textAutosizingWidth;
  • trunk/Source/WebCore/platform/ScrollView.h

    r200390 r200470  
    379379    WEBCORE_EXPORT void scrollOffsetChangedViaPlatformWidget(const ScrollOffset& oldOffset, const ScrollOffset& newOffset);
    380380
    381 #if PLATFORM(IOS)
    382     FloatSize platformObscuredInset() const { return m_obscuredInset; }
    383     void platformSetObscuredInset(FloatSize inset) { m_obscuredInset = inset; }
    384 #endif
    385 
    386381protected:
    387382    ScrollView();
     
    459454    FloatSize m_unobscuredContentSize;
    460455    // This is only used for history scroll position restoration.
    461     FloatSize m_obscuredInset;
    462456#else
    463457    IntRect m_fixedVisibleContentRect;
  • trunk/Source/WebKit2/ChangeLog

    r200463 r200470  
     12016-05-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Revert r200390, thus putting r199259 and r200161 and back.
     4
     5        * Shared/VisibleContentRectUpdateInfo.cpp:
     6        (WebKit::VisibleContentRectUpdateInfo::encode):
     7        (WebKit::VisibleContentRectUpdateInfo::decode):
     8        * Shared/VisibleContentRectUpdateInfo.h:
     9        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
     10        (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
     11        (WebKit::operator==):
     12        * UIProcess/API/Cocoa/WKWebView.mm:
     13        (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
     14        (-[WKWebView _didFinishScrolling]):
     15        (-[WKWebView scrollViewDidScroll:]):
     16        (-[WKWebView scrollViewDidZoom:]):
     17        (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
     18        (-[WKWebView _scrollViewDidInterruptDecelerating:]):
     19        (-[WKWebView _visibleRectInEnclosingScrollView:]):
     20        (-[WKWebView _visibleContentRect]):
     21        (-[WKWebView _didScroll]):
     22        (-[WKWebView _enclosingScrollerScrollingEnded:]):
     23        (-[WKWebView _frameOrBoundsChanged]):
     24        (-[WKWebView _updateVisibleContentRects]):
     25        (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
     26        (scrollViewCanScroll):
     27        (-[WKWebView _updateContentRectsWithState:]):
     28        * UIProcess/API/Cocoa/WKWebViewInternal.h:
     29        * UIProcess/WebPageProxy.h:
     30        * UIProcess/ios/WKContentView.h:
     31        * UIProcess/ios/WKContentView.mm:
     32        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
     33        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
     34        * UIProcess/ios/WebPageProxyIOS.mm:
     35        (WebKit::WebPageProxy::updateVisibleContentRects):
     36        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
     37        (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
     38        * WebProcess/WebPage/ios/WebPageIOS.mm:
     39        (WebKit::WebPage::updateVisibleContentRects):
     40
    1412016-05-02  Sam Weinig  <sam@webkit.org>
    242
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp

    r200390 r200470  
    4747    encoder << m_isChangingObscuredInsetsInteractively;
    4848    encoder << m_allowShrinkToFit;
     49    encoder << m_enclosedInScrollableAncestorView;
    4950}
    5051
     
    7980    if (!decoder.decode(result.m_allowShrinkToFit))
    8081        return false;
     82    if (!decoder.decode(result.m_enclosedInScrollableAncestorView))
     83        return false;
    8184
    8285    return true;
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h

    r200390 r200470  
    4242    VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect,
    4343        const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect,
    44         const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit,
     44        const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView,
    4545        double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
    4646        : m_exposedContentRect(exposedContentRect)
     
    5858        , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively)
    5959        , m_allowShrinkToFit(allowShrinkToFit)
     60        , m_enclosedInScrollableAncestorView(enclosedInScrollableAncestorView)
    6061    {
    6162    }
     
    7172    bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; }
    7273    bool allowShrinkToFit() const { return m_allowShrinkToFit; }
     74    bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
    7375
    7476    double timestamp() const { return m_timestamp; }
     
    9799    bool m_isChangingObscuredInsetsInteractively { false };
    98100    bool m_allowShrinkToFit { false };
     101    bool m_enclosedInScrollableAncestorView { false };
    99102};
    100103
     
    111114        && a.scaleChangeRate() == b.scaleChangeRate()
    112115        && a.inStableState() == b.inStableState()
    113         && a.allowShrinkToFit() == b.allowShrinkToFit();
     116        && a.allowShrinkToFit() == b.allowShrinkToFit()
     117        && a.enclosedInScrollableAncestorView() == b.enclosedInScrollableAncestorView();
    114118}
    115119
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r200463 r200470  
    243243    RetainPtr<UIView> _customContentFixedOverlayView;
    244244
     245    RetainPtr<NSTimer> _enclosingScrollViewScrollTimer;
     246    BOOL _didScrollSinceLastTimerFire;
     247
    245248    WebCore::Color _scrollViewBackgroundColor;
    246249
     
    10491052    if (_hadDelayedUpdateVisibleContentRects) {
    10501053        _hadDelayedUpdateVisibleContentRects = NO;
    1051         [self _updateVisibleContentRects];
     1054        [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
    10521055    }
    10531056}
     
    17931796        return;
    17941797
    1795     [self _updateVisibleContentRects];
     1798    [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
    17961799    [_contentView didFinishScrolling];
    17971800}
     
    18471850        [_customContentView scrollViewDidScroll:(UIScrollView *)scrollView];
    18481851
    1849     [self _updateVisibleContentRects];
     1852    [self _updateVisibleContentRectAfterScrollInView:scrollView];
    18501853   
    18511854    if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page->scrollingPerformanceData())
     
    18561859{
    18571860    [self _updateScrollViewBackground];
    1858     [self _updateVisibleContentRects];
     1861    [self _updateVisibleContentRectAfterScrollInView:scrollView];
    18591862}
    18601863
     
    18621865{
    18631866    ASSERT(scrollView == _scrollView);
    1864     [self _updateVisibleContentRects];
     1867    [self _updateVisibleContentRectAfterScrollInView:scrollView];
    18651868    [_contentView didZoomToScale:scale];
    18661869}
     
    18771880
    18781881    [_contentView didInterruptScrolling];
     1882    [self _updateVisibleContentRectAfterScrollInView:scrollView];
     1883}
     1884
     1885- (CGRect)_visibleRectInEnclosingScrollView:(UIScrollView *)enclosingScrollView
     1886{
     1887    if (!enclosingScrollView)
     1888        return self.bounds;
     1889
     1890    CGRect exposedRect = [enclosingScrollView convertRect:enclosingScrollView.bounds toView:self];
     1891    return CGRectIntersectsRect(exposedRect, self.bounds) ? CGRectIntersection(exposedRect, self.bounds) : CGRectZero;
     1892}
     1893
     1894- (CGRect)_visibleContentRect
     1895{
     1896    CGRect visibleRectInContentCoordinates = _frozenVisibleContentRect ? _frozenVisibleContentRect.value() : [self convertRect:self.bounds toView:_contentView.get()];
     1897   
     1898    if (UIScrollView *enclosingScroller = [self _scroller]) {
     1899        CGRect viewVisibleRect = [self _visibleRectInEnclosingScrollView:enclosingScroller];
     1900        CGRect viewVisibleContentRect = [self convertRect:viewVisibleRect toView:_contentView.get()];
     1901        visibleRectInContentCoordinates = CGRectIntersection(visibleRectInContentCoordinates, viewVisibleContentRect);
     1902    }
     1903
     1904    return visibleRectInContentCoordinates;
     1905}
     1906
     1907// Called when some ancestor UIScrollView scrolls.
     1908- (void)_didScroll
     1909{
     1910    [self _updateVisibleContentRectAfterScrollInView:[self _scroller]];
     1911
     1912    const NSTimeInterval ScrollingEndedTimerInterval = 0.032;
     1913    if (!_enclosingScrollViewScrollTimer) {
     1914        _enclosingScrollViewScrollTimer = adoptNS([[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:ScrollingEndedTimerInterval]
     1915            interval:0 target:self selector:@selector(_enclosingScrollerScrollingEnded:) userInfo:nil repeats:YES]);
     1916        [[NSRunLoop mainRunLoop] addTimer:_enclosingScrollViewScrollTimer.get() forMode:NSDefaultRunLoopMode];
     1917    }
     1918    _didScrollSinceLastTimerFire = YES;
     1919}
     1920
     1921- (void)_enclosingScrollerScrollingEnded:(NSTimer *)timer
     1922{
     1923    if (_didScrollSinceLastTimerFire) {
     1924        _didScrollSinceLastTimerFire = NO;
     1925        return;
     1926    }
     1927
    18791928    [self _updateVisibleContentRects];
     1929    [_enclosingScrollViewScrollTimer invalidate];
     1930    _enclosingScrollViewScrollTimer = nil;
    18801931}
    18811932
     
    18901941        if (!_overridesMaximumUnobscuredSize)
    18911942            _page->setMaximumUnobscuredSize(WebCore::FloatSize(bounds.size));
    1892         if (WebKit::DrawingAreaProxy* drawingArea = _page->drawingArea())
     1943        if (auto drawingArea = _page->drawingArea())
    18931944            drawingArea->setSize(WebCore::IntSize(bounds.size), WebCore::IntSize(), WebCore::IntSize());
    18941945    }
     
    19201971- (void)_updateVisibleContentRects
    19211972{
     1973    // For visible rect updates not associated with a spefic UIScrollView, just consider our own scroller.
     1974    [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
     1975}
     1976
     1977- (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView
     1978{
     1979    BOOL isStableState = !([scrollView isDragging] || [scrollView isDecelerating] || [scrollView isZooming] || [scrollView _isAnimatingZoom] || [scrollView _isScrollingToTop]);
     1980
     1981    if (isStableState && scrollView == _scrollView.get())
     1982        isStableState = !_isChangingObscuredInsetsInteractively;
     1983   
     1984    if (isStableState && scrollView == _scrollView.get())
     1985        isStableState = ![self _scrollViewIsRubberBanding];
     1986
     1987    // FIXME: this can be made static after we stop supporting iOS 8.x.
     1988    if (isStableState && [scrollView respondsToSelector:@selector(_isInterruptingDeceleration)])
     1989        isStableState = ![scrollView performSelector:@selector(_isInterruptingDeceleration)];
     1990
     1991    [self _updateContentRectsWithState:isStableState];
     1992}
     1993
     1994static bool scrollViewCanScroll(UIScrollView *scrollView)
     1995{
     1996    if (!scrollView)
     1997        return NO;
     1998
     1999    UIEdgeInsets contentInset = scrollView.contentInset;
     2000    CGSize contentSize = scrollView.contentSize;
     2001    CGSize boundsSize = scrollView.bounds.size;
     2002
     2003    return (contentSize.width + contentInset.left + contentInset.right) > boundsSize.width
     2004        || (contentSize.height + contentInset.top + contentInset.bottom) > boundsSize.height;
     2005}
     2006
     2007- (void)_updateContentRectsWithState:(BOOL)inStableState
     2008{
    19222009    if (![self usesStandardContentView]) {
    19232010        [_customContentView web_computedContentInsetDidChange];
     
    19372024
    19382025    CGRect fullViewRect = self.bounds;
    1939     CGRect visibleRectInContentCoordinates = _frozenVisibleContentRect ? _frozenVisibleContentRect.value() : [self convertRect:fullViewRect toView:_contentView.get()];
     2026    CGRect visibleRectInContentCoordinates = [self _visibleContentRect];
    19402027
    19412028    UIEdgeInsets computedContentInsetUnadjustedForKeyboard = [self _computedContentInset];
     
    19482035    CGFloat scaleFactor = contentZoomScale(self);
    19492036
    1950     BOOL isStableState = !(_isChangingObscuredInsetsInteractively || [_scrollView isDragging] || [_scrollView isDecelerating] || [_scrollView isZooming] || [_scrollView _isAnimatingZoom] || [_scrollView _isScrollingToTop] || [self _scrollViewIsRubberBanding]);
    1951 
    1952     // FIXME: this can be made static after we stop supporting iOS 8.x.
    1953     if (isStableState && [_scrollView respondsToSelector:@selector(_isInterruptingDeceleration)])
    1954         isStableState = ![_scrollView performSelector:@selector(_isInterruptingDeceleration)];
    1955 
    19562037#if ENABLE(CSS_SCROLL_SNAP) && ENABLE(ASYNC_SCROLLING)
    1957     if (isStableState) {
     2038    if (inStableState) {
    19582039        WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy();
    19592040        if (coordinator && coordinator->hasActiveSnapPoint()) {
    1960             CGRect fullViewRect = self.bounds;
    19612041            CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, computedContentInsetUnadjustedForKeyboard);
    19622042           
     
    19792059        obscuredInset:CGSizeMake(_obscuredInsets.left, _obscuredInsets.top)
    19802060        scale:scaleFactor minimumScale:[_scrollView minimumZoomScale]
    1981         inStableState:isStableState
    1982         isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively];
     2061        inStableState:inStableState
     2062        isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively
     2063        enclosedInScrollableAncestorView:scrollViewCanScroll([self _scroller])];
    19832064}
    19842065
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h

    r200390 r200470  
    100100
    101101- (void)_updateVisibleContentRects;
     102- (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView;
     103- (void)_updateContentRectsWithState:(BOOL)inStableState;
    102104
    103105- (void)_didFinishLoadForMainFrame;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r200390 r200470  
    456456    const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
    457457
    458     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);
     458    void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
    459459    void resendLastVisibleContentRects();
    460460
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.h

    r200390 r200470  
    7171    obscuredInset:(CGSize)topInset
    7272    scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale
    73     inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively;
     73    inStableState:(BOOL)isStableState
     74    isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
     75    enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView;
    7476
    7577- (void)didFinishScrolling;
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r200390 r200470  
    357357
    358358- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
    359     obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
    360 {
     359    obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView
     360{
     361    auto drawingArea = _page->drawingArea();
     362    if (!drawingArea)
     363        return;
     364
    361365    double timestamp = monotonicallyIncreasingTime();
    362366    HistoricalVelocityData::VelocityData velocityData;
     
    367371
    368372    FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
    369     _page->updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout, WebCore::FloatSize(obscuredInset),
    370         zoomScale, isStableState, isChangingObscuredInsetsInteractively, _webView._allowsViewportShrinkToFit, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate);
     373
     374    VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(
     375        visibleRect,
     376        unobscuredRect,
     377        unobscuredRectInScrollViewCoordinates,
     378        fixedPositionRectForLayout,
     379        WebCore::FloatSize(obscuredInset),
     380        zoomScale,
     381        isStableState,
     382        isChangingObscuredInsetsInteractively,
     383        _webView._allowsViewportShrinkToFit,
     384        enclosedInScrollableAncestorView,
     385        timestamp,
     386        velocityData.horizontalVelocity,
     387        velocityData.verticalVelocity,
     388        velocityData.scaleChangeRate,
     389        downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea).lastCommittedLayerTreeTransactionID());
     390
     391    _page->updateVisibleContentRects(visibleContentRectUpdateInfo);
    371392
    372393    RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
     
    374395    scrollingCoordinator->viewportChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), fixedPositionRect, zoomScale);
    375396
    376     if (auto drawingArea = _page->drawingArea())
    377         drawingArea->updateDebugIndicator();
    378        
     397    drawingArea->updateDebugIndicator();
     398   
    379399    [self updateFixedClippingView:fixedPositionRect];
    380400}
  • trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm

    r200390 r200470  
    183183}
    184184
    185 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)
     185void WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdate)
    186186{
    187187    if (!isValid())
    188188        return;
    189189
    190     VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, obscuredInset, scale, inStableState, isChangingObscuredInsetsInteractively, allowShrinkToFit, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).lastCommittedLayerTreeTransactionID());
    191 
    192     if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
    193         return;
    194 
    195     m_lastVisibleContentRectUpdate = visibleContentRectUpdateInfo;
    196     m_process->send(Messages::ViewUpdateDispatcher::VisibleContentRectUpdate(m_pageID, visibleContentRectUpdateInfo), 0);
     190    if (visibleContentRectUpdate == m_lastVisibleContentRectUpdate)
     191        return;
     192
     193    m_lastVisibleContentRectUpdate = visibleContentRectUpdate;
     194    m_process->send(Messages::ViewUpdateDispatcher::VisibleContentRectUpdate(m_pageID, visibleContentRectUpdate), 0);
    197195}
    198196
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm

    r200390 r200470  
    260260#if PLATFORM(IOS)
    261261        FloatPoint tiledMapLocation = m_webPageProxy.unobscuredContentRect().location();
     262        tiledMapLocation = tiledMapLocation.expandedTo(m_webPageProxy.exposedContentRect().location() + FloatSize(0, 60));
     263
    262264        float absoluteInset = indicatorInset / m_webPageProxy.displayedContentScale();
    263265        tiledMapLocation += FloatSize(absoluteInset, absoluteInset);
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r200390 r200470  
    29672967
    29682968    frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size());
    2969     frameView.platformSetObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
     2969    m_page->setObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
     2970    m_page->setEnclosedInScrollableAncestorView(visibleContentRectUpdateInfo.enclosedInScrollableAncestorView());
    29702971
    29712972    double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
Note: See TracChangeset for help on using the changeset viewer.