Changeset 199233 in webkit


Ignore:
Timestamp:
Apr 8, 2016 10:22:19 AM (8 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Stop using exposedContentRect for history scroll state restoration
https://bugs.webkit.org/show_bug.cgi?id=156392

Reviewed by Tim Horton.

A future commit will alter the meaning of exposedContentRect on iOS to take into
account clipped out parts of the WKWebView. To achieve this, wean history restoration
off of using exposedContentRect for scroll state restoration. It did this to restore
the page to the same position relative to the view's top-left (to avoid jiggles caused
by changing obscured insets).

Do this by pushing the left/top obscured insets down with visible content rects updates,
storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
for scroll state restoration in WKWebView.

Source/WebCore:

  • history/HistoryItem.cpp:

(WebCore::HistoryItem::HistoryItem):

  • history/HistoryItem.h:

(WebCore::HistoryItem::obscuredInset):
(WebCore::HistoryItem::setObscuredInset):

  • loader/HistoryController.cpp:

(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):

  • platform/ScrollView.h:

(WebCore::ScrollView::platformObscuredInset):
(WebCore::ScrollView::platformSetObscuredInset):

Source/WebKit2:

  • Shared/VisibleContentRectUpdateInfo.cpp: Add FloatSize for obscuredInset.

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

  • Shared/VisibleContentRectUpdateInfo.h:

(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::obscuredInset):
(WebKit::operator==):

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _processDidExit]): Rename _needsToRestoreExposedRect to _needsToRestoreScrollPosition
(-[WKWebView _didCommitLayerTree:]): Restore the scroll position using the scaled scrollOffset minus
the old obscuredInset.
(-[WKWebView _layerTreeCommitComplete]):
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
(-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _restorePageStateToExposedRect:scrollOrigin:scale:]): Deleted.

  • UIProcess/API/Cocoa/WKWebViewInternal.h:
  • UIProcess/PageClient.h:
  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/ios/PageClientImplIOS.h:
  • UIProcess/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::restorePageState):

  • UIProcess/ios/WKContentView.h:
  • UIProcess/ios/WKContentView.mm:

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

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::updateVisibleContentRects):
(WebKit::WebPageProxy::restorePageState):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::restorePageState):
(WebKit::WebPage::updateVisibleContentRects):

Location:
trunk/Source
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r199232 r199233  
     12016-04-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Stop using exposedContentRect for history scroll state restoration
     4        https://bugs.webkit.org/show_bug.cgi?id=156392
     5
     6        Reviewed by Tim Horton.
     7
     8        A future commit will alter the meaning of exposedContentRect on iOS to take into
     9        account clipped out parts of the WKWebView. To achieve this, wean history restoration
     10        off of using exposedContentRect for scroll state restoration. It did this to restore
     11        the page to the same position relative to the view's top-left (to avoid jiggles caused
     12        by changing obscured insets).
     13
     14        Do this by pushing the left/top obscured insets down with visible content rects updates,
     15        storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
     16        for scroll state restoration in WKWebView.
     17
     18        * history/HistoryItem.cpp:
     19        (WebCore::HistoryItem::HistoryItem):
     20        * history/HistoryItem.h:
     21        (WebCore::HistoryItem::obscuredInset):
     22        (WebCore::HistoryItem::setObscuredInset):
     23        * loader/HistoryController.cpp:
     24        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
     25        * platform/ScrollView.h:
     26        (WebCore::ScrollView::platformObscuredInset):
     27        (WebCore::ScrollView::platformSetObscuredInset):
     28
    1292016-04-08  Brady Eidson  <beidson@apple.com>
    230
  • trunk/Source/WebCore/history/HistoryItem.cpp

    r195452 r199233  
    6363    , m_documentSequenceNumber(generateSequenceNumber())
    6464    , m_pruningReason(PruningReason::None)
    65 #if PLATFORM(IOS)
    66     , m_scale(0)
    67     , m_scaleIsInitial(false)
    68     , m_bookmarkID(0)
    69 #endif
    7065{
    7166}
     
    8176    , m_documentSequenceNumber(generateSequenceNumber())
    8277    , m_pruningReason(PruningReason::None)
    83 #if PLATFORM(IOS)
    84     , m_scale(0)
    85     , m_scaleIsInitial(false)
    86     , m_bookmarkID(0)
    87 #endif
    88 {   
     78{
    8979    iconDatabase().retainIconForPageURL(m_urlString);
    9080}
     
    10191    , m_documentSequenceNumber(generateSequenceNumber())
    10292    , m_pruningReason(PruningReason::None)
    103 #if PLATFORM(IOS)
    104     , m_scale(0)
    105     , m_scaleIsInitial(false)
    106     , m_bookmarkID(0)
    107 #endif
    10893{
    10994    iconDatabase().retainIconForPageURL(m_urlString);
     
    133118    , m_pruningReason(PruningReason::None)
    134119#if PLATFORM(IOS)
     120    , m_obscuredInset(item.m_obscuredInset)
    135121    , m_scale(item.m_scale)
    136122    , m_scaleIsInitial(item.m_scaleIsInitial)
  • trunk/Source/WebCore/history/HistoryItem.h

    r197244 r199233  
    180180    void setUnobscuredContentRect(IntRect unobscuredContentRect) { m_unobscuredContentRect = unobscuredContentRect; }
    181181
     182    FloatSize obscuredInset() const { return m_obscuredInset; }
     183    void setObscuredInset(const FloatSize& inset) { m_obscuredInset = inset; }
     184
    182185    FloatSize minimumLayoutSizeInScrollViewCoordinates() const { return m_minimumLayoutSizeInScrollViewCoordinates; }
    183186    void setMinimumLayoutSizeInScrollViewCoordinates(FloatSize minimumLayoutSizeInScrollViewCoordinates) { m_minimumLayoutSizeInScrollViewCoordinates = minimumLayoutSizeInScrollViewCoordinates; }
     
    266269    FloatSize m_minimumLayoutSizeInScrollViewCoordinates;
    267270    IntSize m_contentSize;
    268     float m_scale;
    269     bool m_scaleIsInitial;
     271    FloatSize m_obscuredInset;
     272    float m_scale { 1 };
     273    bool m_scaleIsInitial { false };
    270274    ViewportArguments m_viewportArguments;
    271275
    272     uint32_t m_bookmarkID;
     276    uint32_t m_bookmarkID { 0 };
    273277    String m_sharedLinkUniqueIdentifier;
    274278#endif
  • trunk/Source/WebCore/loader/HistoryController.cpp

    r196807 r199233  
    8383    item->setExposedContentRect(frameView->exposedContentRect());
    8484    item->setUnobscuredContentRect(frameView->unobscuredContentRect());
     85    item->setObscuredInset(frameView->platformObscuredInset());
    8586#endif
    8687
  • trunk/Source/WebCore/platform/ScrollView.h

    r198841 r199233  
    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
    381386protected:
    382387    ScrollView();
     
    448453    bool m_canBlitOnScroll;
    449454
     455#if PLATFORM(IOS)
    450456    // FIXME: exposedContentRect is a very similar concept to fixedVisibleContentRect except it does not differentiate
    451457    // between exposed and unobscured areas. The two attributes should eventually be merged.
    452 #if PLATFORM(IOS)
    453458    FloatRect m_exposedContentRect;
    454459    FloatSize m_unobscuredContentSize;
     460    // This is only used for history scroll position restoration.
     461    FloatSize m_obscuredInset;
    455462#else
    456463    IntRect m_fixedVisibleContentRect;
  • trunk/Source/WebKit2/ChangeLog

    r199230 r199233  
     12016-04-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Stop using exposedContentRect for history scroll state restoration
     4        https://bugs.webkit.org/show_bug.cgi?id=156392
     5
     6        Reviewed by Tim Horton.
     7
     8        A future commit will alter the meaning of exposedContentRect on iOS to take into
     9        account clipped out parts of the WKWebView. To achieve this, wean history restoration
     10        off of using exposedContentRect for scroll state restoration. It did this to restore
     11        the page to the same position relative to the view's top-left (to avoid jiggles caused
     12        by changing obscured insets).
     13
     14        Do this by pushing the left/top obscured insets down with visible content rects updates,
     15        storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
     16        for scroll state restoration in WKWebView.
     17
     18        * Shared/VisibleContentRectUpdateInfo.cpp: Add FloatSize for obscuredInset.
     19        (WebKit::VisibleContentRectUpdateInfo::encode):
     20        (WebKit::VisibleContentRectUpdateInfo::decode):
     21        * Shared/VisibleContentRectUpdateInfo.h:
     22        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
     23        (WebKit::VisibleContentRectUpdateInfo::obscuredInset):
     24        (WebKit::operator==):
     25        * UIProcess/API/Cocoa/WKWebView.mm:
     26        (-[WKWebView _processDidExit]): Rename _needsToRestoreExposedRect to _needsToRestoreScrollPosition
     27        (-[WKWebView _didCommitLayerTree:]): Restore the scroll position using the scaled scrollOffset minus
     28        the old obscuredInset.
     29        (-[WKWebView _layerTreeCommitComplete]):
     30        (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
     31        (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
     32        (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
     33        (-[WKWebView _updateVisibleContentRects]):
     34        (-[WKWebView _restorePageStateToExposedRect:scrollOrigin:scale:]): Deleted.
     35        * UIProcess/API/Cocoa/WKWebViewInternal.h:
     36        * UIProcess/PageClient.h:
     37        * UIProcess/WebPageProxy.h:
     38        * UIProcess/WebPageProxy.messages.in:
     39        * UIProcess/ios/PageClientImplIOS.h:
     40        * UIProcess/ios/PageClientImplIOS.mm:
     41        (WebKit::PageClientImpl::restorePageState):
     42        * UIProcess/ios/WKContentView.h:
     43        * UIProcess/ios/WKContentView.mm:
     44        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
     45        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
     46        * UIProcess/ios/WebPageProxyIOS.mm:
     47        (WebKit::WebPageProxy::updateVisibleContentRects):
     48        (WebKit::WebPageProxy::restorePageState):
     49        * WebProcess/WebPage/ios/WebPageIOS.mm:
     50        (WebKit::WebPage::restorePageState):
     51        (WebKit::WebPage::updateVisibleContentRects):
     52
    1532016-04-08  Brady Eidson  <beidson@apple.com>
    254
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp

    r199111 r199233  
    3737    encoder << m_unobscuredRectInScrollViewCoordinates;
    3838    encoder << m_customFixedPositionRect;
     39    encoder << m_obscuredInset;
    3940    encoder << m_lastLayerTreeTransactionID;
    4041    encoder << m_scale;
     
    5758        return false;
    5859    if (!decoder.decode(result.m_customFixedPositionRect))
     60        return false;
     61    if (!decoder.decode(result.m_obscuredInset))
    5962        return false;
    6063    if (!decoder.decode(result.m_lastLayerTreeTransactionID))
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h

    r199111 r199233  
    4040    VisibleContentRectUpdateInfo() = default;
    4141
    42     VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
     42    VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect,
     43        const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect,
     44        const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit,
     45        double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
    4346        : m_exposedContentRect(exposedContentRect)
    4447        , m_unobscuredContentRect(unobscuredContentRect)
    4548        , m_unobscuredRectInScrollViewCoordinates(unobscuredRectInScrollViewCoordinates)
    4649        , m_customFixedPositionRect(customFixedPositionRect)
     50        , m_obscuredInset(obscuredInset)
    4751        , m_lastLayerTreeTransactionID(lastLayerTreeTransactionId)
    4852        , m_scale(scale)
     
    6165    const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates() const { return m_unobscuredRectInScrollViewCoordinates; }
    6266    const WebCore::FloatRect& customFixedPositionRect() const { return m_customFixedPositionRect; }
     67    const WebCore::FloatSize obscuredInset() const { return m_obscuredInset; }
     68
    6369    double scale() const { return m_scale; }
    6470    bool inStableState() const { return m_inStableState; }
     
    8187    WebCore::FloatRect m_unobscuredRectInScrollViewCoordinates;
    8288    WebCore::FloatRect m_customFixedPositionRect;
     89    WebCore::FloatSize m_obscuredInset;
    8390    uint64_t m_lastLayerTreeTransactionID { 0 };
    8491    double m_scale { -1 };
     
    99106        && a.unobscuredContentRect() == b.unobscuredContentRect()
    100107        && a.customFixedPositionRect() == b.customFixedPositionRect()
     108        && a.obscuredInset() == b.obscuredInset()
    101109        && a.horizontalVelocity() == b.horizontalVelocity()
    102110        && a.verticalVelocity() == b.verticalVelocity()
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r198724 r199233  
    225225    Optional<CGRect> _frozenUnobscuredContentRect;
    226226
    227     BOOL _needsToRestoreExposedRect;
    228     BOOL _commitDidRestoreExposedRect;
    229     WebCore::FloatRect _exposedRectToRestore;
     227    BOOL _needsToRestoreScrollPosition;
     228    BOOL _commitDidRestoreScrollPosition;
     229    WebCore::FloatPoint _scrollOffsetToRestore;
     230    WebCore::FloatSize _obscuredInsetWhenSaved;
     231
    230232    BOOL _needsToRestoreUnobscuredCenter;
    231233    WebCore::FloatPoint _unobscuredCenterToRestore;
     
    11131115    _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
    11141116    [_contentView setHidden:NO];
    1115     _needsToRestoreExposedRect = NO;
     1117    _needsToRestoreScrollPosition = NO;
    11161118    _needsToRestoreUnobscuredCenter = NO;
    11171119    _scrollViewBackgroundColor = WebCore::Color();
     
    12121214    bool isTransactionAfterPageRestore = layerTreeTransaction.transactionID() >= _firstTransactionIDAfterPageRestore;
    12131215
    1214     if (_needsToRestoreExposedRect && isTransactionAfterPageRestore) {
    1215         _needsToRestoreExposedRect = NO;
     1216    if (_needsToRestoreScrollPosition && isTransactionAfterPageRestore) {
     1217        _needsToRestoreScrollPosition = NO;
    12161218
    12171219        if (areEssentiallyEqualAsFloat(contentZoomScale(self), _scaleToRestore)) {
    1218             WebCore::FloatPoint exposedPosition = _exposedRectToRestore.location();
    1219             exposedPosition.scale(_scaleToRestore, _scaleToRestore);
    1220 
    1221             changeContentOffsetBoundedInValidRange(_scrollView.get(), exposedPosition);
    1222             _commitDidRestoreExposedRect = YES;
     1220            WebCore::FloatPoint scaledScrollOffset = _scrollOffsetToRestore;
     1221            scaledScrollOffset.scale(_scaleToRestore, _scaleToRestore);
     1222            WebCore::FloatPoint contentOffsetInScrollViewCoordinates = scaledScrollOffset - _obscuredInsetWhenSaved;
     1223
     1224            changeContentOffsetBoundedInValidRange(_scrollView.get(), contentOffsetInScrollViewCoordinates);
     1225            _commitDidRestoreScrollPosition = YES;
     1226
    12231227            if (_gestureController)
    12241228                _gestureController->didRestoreScrollPosition();
     
    12511255- (void)_layerTreeCommitComplete
    12521256{
    1253     _commitDidRestoreExposedRect = NO;
     1257    _commitDidRestoreScrollPosition = NO;
    12541258}
    12551259
     
    12811285}
    12821286
    1283 - (void)_restorePageStateToExposedRect:(WebCore::FloatRect)exposedRect scrollOrigin:(WebCore::IntPoint)scrollOrigin scale:(double)scale
     1287- (void)_restorePageScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)obscuredInset scale:(double)scale
    12841288{
    12851289    if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
     
    12901294
    12911295    _needsToRestoreUnobscuredCenter = NO;
    1292     _needsToRestoreExposedRect = YES;
     1296    _needsToRestoreScrollPosition = YES;
    12931297    _firstTransactionIDAfterPageRestore = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).nextLayerTreeTransactionID();
    12941298   
    1295     // Move the exposed rect into scrollView coordinates.
    1296     exposedRect.move(toFloatSize(scrollOrigin));
    1297     _exposedRectToRestore = exposedRect;
     1299    _scrollOffsetToRestore = WebCore::ScrollableArea::scrollOffsetFromPosition(WebCore::FloatPoint(scrollPosition), WebCore::toFloatSize(scrollOrigin));
     1300    _obscuredInsetWhenSaved = obscuredInset;
    12981301    _scaleToRestore = scale;
    12991302}
     
    13071310        return;
    13081311
    1309     _needsToRestoreExposedRect = NO;
     1312    _needsToRestoreScrollPosition = NO;
    13101313    _needsToRestoreUnobscuredCenter = YES;
    13111314    _firstTransactionIDAfterPageRestore = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).nextLayerTreeTransactionID();
     
    14061409- (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin
    14071410{
    1408     if (_commitDidRestoreExposedRect || _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
     1411    if (_commitDidRestoreScrollPosition || _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
    14091412        return;
    14101413
     
    19321935        unobscuredRect:unobscuredRectInContentCoordinates
    19331936        unobscuredRectInScrollViewCoordinates:unobscuredRect
     1937        obscuredInset:CGSizeMake(_obscuredInsets.left, _obscuredInsets.top)
    19341938        scale:scaleFactor minimumScale:[_scrollView minimumZoomScale]
    19351939        inStableState:isStableState
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h

    r198455 r199233  
    8080- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID;
    8181- (void)_couldNotRestorePageState;
    82 - (void)_restorePageStateToExposedRect:(WebCore::FloatRect)exposedRect scrollOrigin:(WebCore::IntPoint)scrollOrigin scale:(double)scale;
     82- (void)_restorePageScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)topInset scale:(double)scale;
    8383- (void)_restorePageStateToUnobscuredCenter:(WebCore::FloatPoint)center scale:(double)scale; // FIXME: needs scroll origin?
    8484
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r199022 r199233  
    286286    virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) = 0;
    287287    virtual void couldNotRestorePageState() = 0;
    288     virtual void restorePageState(const WebCore::FloatRect& exposedContentRect, const WebCore::IntPoint& scrollOrigin, double scale) = 0;
    289     virtual void restorePageCenterAndScale(const WebCore::FloatPoint&, double) = 0;
     288    virtual void restorePageState(const WebCore::FloatPoint& scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale) = 0;
     289    virtual void restorePageCenterAndScale(const WebCore::FloatPoint& center, double scale) = 0;
    290290
    291291    virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) = 0;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r199111 r199233  
    453453    const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
    454454
    455     void updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
     455    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);
    456456    void resendLastVisibleContentRects();
    457457
     
    14111411    void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
    14121412    void couldNotRestorePageState();
    1413     void restorePageState(const WebCore::FloatRect& exposedContentRect, const WebCore::IntPoint& scrollOrigin, double scale);
     1413    void restorePageState(const WebCore::FloatPoint& scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale);
    14141414    void restorePageCenterAndScale(const WebCore::FloatPoint&, double scale);
    14151415
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r198455 r199233  
    359359    DynamicViewportUpdateChangedTarget(double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t dynamicViewportSizeUpdateID)
    360360    CouldNotRestorePageState()
    361     RestorePageState(WebCore::FloatRect exposedContentRect, WebCore::IntPoint scrollOrigin, double scale)
     361    RestorePageState(WebCore::FloatPoint scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::FloatSize obscuredInsetOnSave, double scale)
    362362    RestorePageCenterAndScale(WebCore::FloatPoint unobscuredCenter, double scale)
    363363    DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector<WebCore::FloatQuad> geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius)
  • trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h

    r198580 r199233  
    120120    void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) override;
    121121    void couldNotRestorePageState() override;
    122     void restorePageState(const WebCore::FloatRect&, const WebCore::IntPoint&, double) override;
     122    void restorePageState(const WebCore::FloatPoint&, const WebCore::FloatPoint&, const WebCore::FloatSize&, double) override;
    123123    void restorePageCenterAndScale(const WebCore::FloatPoint&, double) override;
    124124
  • trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm

    r198580 r199233  
    512512}
    513513
    514 void PageClientImpl::restorePageState(const WebCore::FloatRect& exposedContentRect, const WebCore::IntPoint& scrollOrigin, double scale)
    515 {
    516     [m_webView _restorePageStateToExposedRect:exposedContentRect scrollOrigin:scrollOrigin scale:scale];
     514void PageClientImpl::restorePageState(const WebCore::FloatPoint& scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale)
     515{
     516    [m_webView _restorePageScrollPosition:scrollPosition scrollOrigin:scrollOrigin previousObscuredInset:obscuredInsetOnSave scale:scale];
    517517}
    518518
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.h

    r198455 r199233  
    6969- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect
    7070    unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
     71    obscuredInset:(CGSize)topInset
    7172    scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale
    7273    inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively;
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r198455 r199233  
    357357
    358358- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
    359     scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
     359    obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
    360360{
    361361    double timestamp = monotonicallyIncreasingTime();
     
    367367
    368368    FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
    369     _page->updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout,
     369    _page->updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout, WebCore::FloatSize(obscuredInset),
    370370        zoomScale, isStableState, isChangingObscuredInsetsInteractively, _webView._allowsViewportShrinkToFit, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate);
    371371
  • trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm

    r198455 r199233  
    183183}
    184184
    185 void WebPageProxy::updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate)
     185void 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)
    186186{
    187187    if (!isValid())
    188188        return;
    189189
    190     VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, scale, inStableState, isChangingObscuredInsetsInteractively, allowShrinkToFit, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).lastCommittedLayerTreeTransactionID());
     190    VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, obscuredInset, scale, inStableState, isChangingObscuredInsetsInteractively, allowShrinkToFit, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).lastCommittedLayerTreeTransactionID());
    191191
    192192    if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
     
    820820}
    821821
    822 void WebPageProxy::restorePageState(const WebCore::FloatRect& exposedContentRect, const WebCore::IntPoint& scrollOrigin, double scale)
    823 {
    824     m_pageClient.restorePageState(exposedContentRect, scrollOrigin, scale);
     822void WebPageProxy::restorePageState(const WebCore::FloatPoint& scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale)
     823{
     824    m_pageClient.restorePageState(scrollPosition, scrollOrigin, obscuredInsetOnSave, scale);
    825825}
    826826
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r199111 r199233  
    300300        m_drawingArea->setExposedContentRect(historyItem.exposedContentRect());
    301301
    302         send(Messages::WebPageProxy::RestorePageState(historyItem.exposedContentRect(), frameView.scrollOrigin(), boundedScale));
     302        send(Messages::WebPageProxy::RestorePageState(historyItem.scrollPosition(), frameView.scrollOrigin(), historyItem.obscuredInset(), boundedScale));
    303303    } else {
    304304        IntSize oldContentSize = historyItem.contentSize();
     
    29652965
    29662966    frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size());
     2967    frameView.platformSetObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
    29672968
    29682969    double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
Note: See TracChangeset for help on using the changeset viewer.