Changeset 199233 in webkit
- Timestamp:
- Apr 8, 2016 10:22:19 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r199232 r199233 1 2016-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 1 29 2016-04-08 Brady Eidson <beidson@apple.com> 2 30 -
trunk/Source/WebCore/history/HistoryItem.cpp
r195452 r199233 63 63 , m_documentSequenceNumber(generateSequenceNumber()) 64 64 , m_pruningReason(PruningReason::None) 65 #if PLATFORM(IOS)66 , m_scale(0)67 , m_scaleIsInitial(false)68 , m_bookmarkID(0)69 #endif70 65 { 71 66 } … … 81 76 , m_documentSequenceNumber(generateSequenceNumber()) 82 77 , m_pruningReason(PruningReason::None) 83 #if PLATFORM(IOS) 84 , m_scale(0) 85 , m_scaleIsInitial(false) 86 , m_bookmarkID(0) 87 #endif 88 { 78 { 89 79 iconDatabase().retainIconForPageURL(m_urlString); 90 80 } … … 101 91 , m_documentSequenceNumber(generateSequenceNumber()) 102 92 , m_pruningReason(PruningReason::None) 103 #if PLATFORM(IOS)104 , m_scale(0)105 , m_scaleIsInitial(false)106 , m_bookmarkID(0)107 #endif108 93 { 109 94 iconDatabase().retainIconForPageURL(m_urlString); … … 133 118 , m_pruningReason(PruningReason::None) 134 119 #if PLATFORM(IOS) 120 , m_obscuredInset(item.m_obscuredInset) 135 121 , m_scale(item.m_scale) 136 122 , m_scaleIsInitial(item.m_scaleIsInitial) -
trunk/Source/WebCore/history/HistoryItem.h
r197244 r199233 180 180 void setUnobscuredContentRect(IntRect unobscuredContentRect) { m_unobscuredContentRect = unobscuredContentRect; } 181 181 182 FloatSize obscuredInset() const { return m_obscuredInset; } 183 void setObscuredInset(const FloatSize& inset) { m_obscuredInset = inset; } 184 182 185 FloatSize minimumLayoutSizeInScrollViewCoordinates() const { return m_minimumLayoutSizeInScrollViewCoordinates; } 183 186 void setMinimumLayoutSizeInScrollViewCoordinates(FloatSize minimumLayoutSizeInScrollViewCoordinates) { m_minimumLayoutSizeInScrollViewCoordinates = minimumLayoutSizeInScrollViewCoordinates; } … … 266 269 FloatSize m_minimumLayoutSizeInScrollViewCoordinates; 267 270 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 }; 270 274 ViewportArguments m_viewportArguments; 271 275 272 uint32_t m_bookmarkID ;276 uint32_t m_bookmarkID { 0 }; 273 277 String m_sharedLinkUniqueIdentifier; 274 278 #endif -
trunk/Source/WebCore/loader/HistoryController.cpp
r196807 r199233 83 83 item->setExposedContentRect(frameView->exposedContentRect()); 84 84 item->setUnobscuredContentRect(frameView->unobscuredContentRect()); 85 item->setObscuredInset(frameView->platformObscuredInset()); 85 86 #endif 86 87 -
trunk/Source/WebCore/platform/ScrollView.h
r198841 r199233 379 379 WEBCORE_EXPORT void scrollOffsetChangedViaPlatformWidget(const ScrollOffset& oldOffset, const ScrollOffset& newOffset); 380 380 381 #if PLATFORM(IOS) 382 FloatSize platformObscuredInset() const { return m_obscuredInset; } 383 void platformSetObscuredInset(FloatSize inset) { m_obscuredInset = inset; } 384 #endif 385 381 386 protected: 382 387 ScrollView(); … … 448 453 bool m_canBlitOnScroll; 449 454 455 #if PLATFORM(IOS) 450 456 // FIXME: exposedContentRect is a very similar concept to fixedVisibleContentRect except it does not differentiate 451 457 // between exposed and unobscured areas. The two attributes should eventually be merged. 452 #if PLATFORM(IOS)453 458 FloatRect m_exposedContentRect; 454 459 FloatSize m_unobscuredContentSize; 460 // This is only used for history scroll position restoration. 461 FloatSize m_obscuredInset; 455 462 #else 456 463 IntRect m_fixedVisibleContentRect; -
trunk/Source/WebKit2/ChangeLog
r199230 r199233 1 2016-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 1 53 2016-04-08 Brady Eidson <beidson@apple.com> 2 54 -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp
r199111 r199233 37 37 encoder << m_unobscuredRectInScrollViewCoordinates; 38 38 encoder << m_customFixedPositionRect; 39 encoder << m_obscuredInset; 39 40 encoder << m_lastLayerTreeTransactionID; 40 41 encoder << m_scale; … … 57 58 return false; 58 59 if (!decoder.decode(result.m_customFixedPositionRect)) 60 return false; 61 if (!decoder.decode(result.m_obscuredInset)) 59 62 return false; 60 63 if (!decoder.decode(result.m_lastLayerTreeTransactionID)) -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h
r199111 r199233 40 40 VisibleContentRectUpdateInfo() = default; 41 41 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) 43 46 : m_exposedContentRect(exposedContentRect) 44 47 , m_unobscuredContentRect(unobscuredContentRect) 45 48 , m_unobscuredRectInScrollViewCoordinates(unobscuredRectInScrollViewCoordinates) 46 49 , m_customFixedPositionRect(customFixedPositionRect) 50 , m_obscuredInset(obscuredInset) 47 51 , m_lastLayerTreeTransactionID(lastLayerTreeTransactionId) 48 52 , m_scale(scale) … … 61 65 const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates() const { return m_unobscuredRectInScrollViewCoordinates; } 62 66 const WebCore::FloatRect& customFixedPositionRect() const { return m_customFixedPositionRect; } 67 const WebCore::FloatSize obscuredInset() const { return m_obscuredInset; } 68 63 69 double scale() const { return m_scale; } 64 70 bool inStableState() const { return m_inStableState; } … … 81 87 WebCore::FloatRect m_unobscuredRectInScrollViewCoordinates; 82 88 WebCore::FloatRect m_customFixedPositionRect; 89 WebCore::FloatSize m_obscuredInset; 83 90 uint64_t m_lastLayerTreeTransactionID { 0 }; 84 91 double m_scale { -1 }; … … 99 106 && a.unobscuredContentRect() == b.unobscuredContentRect() 100 107 && a.customFixedPositionRect() == b.customFixedPositionRect() 108 && a.obscuredInset() == b.obscuredInset() 101 109 && a.horizontalVelocity() == b.horizontalVelocity() 102 110 && a.verticalVelocity() == b.verticalVelocity() -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r198724 r199233 225 225 Optional<CGRect> _frozenUnobscuredContentRect; 226 226 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 230 232 BOOL _needsToRestoreUnobscuredCenter; 231 233 WebCore::FloatPoint _unobscuredCenterToRestore; … … 1113 1115 _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing; 1114 1116 [_contentView setHidden:NO]; 1115 _needsToRestore ExposedRect= NO;1117 _needsToRestoreScrollPosition = NO; 1116 1118 _needsToRestoreUnobscuredCenter = NO; 1117 1119 _scrollViewBackgroundColor = WebCore::Color(); … … 1212 1214 bool isTransactionAfterPageRestore = layerTreeTransaction.transactionID() >= _firstTransactionIDAfterPageRestore; 1213 1215 1214 if (_needsToRestore ExposedRect&& isTransactionAfterPageRestore) {1215 _needsToRestore ExposedRect= NO;1216 if (_needsToRestoreScrollPosition && isTransactionAfterPageRestore) { 1217 _needsToRestoreScrollPosition = NO; 1216 1218 1217 1219 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 1223 1227 if (_gestureController) 1224 1228 _gestureController->didRestoreScrollPosition(); … … 1251 1255 - (void)_layerTreeCommitComplete 1252 1256 { 1253 _commitDidRestore ExposedRect= NO;1257 _commitDidRestoreScrollPosition = NO; 1254 1258 } 1255 1259 … … 1281 1285 } 1282 1286 1283 - (void)_restorePageS tateToExposedRect:(WebCore::FloatRect)exposedRect scrollOrigin:(WebCore::IntPoint)scrollOriginscale:(double)scale1287 - (void)_restorePageScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)obscuredInset scale:(double)scale 1284 1288 { 1285 1289 if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) … … 1290 1294 1291 1295 _needsToRestoreUnobscuredCenter = NO; 1292 _needsToRestore ExposedRect= YES;1296 _needsToRestoreScrollPosition = YES; 1293 1297 _firstTransactionIDAfterPageRestore = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).nextLayerTreeTransactionID(); 1294 1298 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; 1298 1301 _scaleToRestore = scale; 1299 1302 } … … 1307 1310 return; 1308 1311 1309 _needsToRestore ExposedRect= NO;1312 _needsToRestoreScrollPosition = NO; 1310 1313 _needsToRestoreUnobscuredCenter = YES; 1311 1314 _firstTransactionIDAfterPageRestore = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).nextLayerTreeTransactionID(); … … 1406 1409 - (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin 1407 1410 { 1408 if (_commitDidRestore ExposedRect|| _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)1411 if (_commitDidRestoreScrollPosition || _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) 1409 1412 return; 1410 1413 … … 1932 1935 unobscuredRect:unobscuredRectInContentCoordinates 1933 1936 unobscuredRectInScrollViewCoordinates:unobscuredRect 1937 obscuredInset:CGSizeMake(_obscuredInsets.left, _obscuredInsets.top) 1934 1938 scale:scaleFactor minimumScale:[_scrollView minimumZoomScale] 1935 1939 inStableState:isStableState -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
r198455 r199233 80 80 - (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID; 81 81 - (void)_couldNotRestorePageState; 82 - (void)_restorePageS tateToExposedRect:(WebCore::FloatRect)exposedRect scrollOrigin:(WebCore::IntPoint)scrollOriginscale:(double)scale;82 - (void)_restorePageScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)topInset scale:(double)scale; 83 83 - (void)_restorePageStateToUnobscuredCenter:(WebCore::FloatPoint)center scale:(double)scale; // FIXME: needs scroll origin? 84 84 -
trunk/Source/WebKit2/UIProcess/PageClient.h
r199022 r199233 286 286 virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) = 0; 287 287 virtual void couldNotRestorePageState() = 0; 288 virtual void restorePageState(const WebCore::Float Rect& 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; 290 290 291 291 virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r199111 r199233 453 453 const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); } 454 454 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); 456 456 void resendLastVisibleContentRects(); 457 457 … … 1411 1411 void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID); 1412 1412 void couldNotRestorePageState(); 1413 void restorePageState(const WebCore::Float Rect& exposedContentRect, const WebCore::IntPoint& scrollOrigin, double scale);1413 void restorePageState(const WebCore::FloatPoint& scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale); 1414 1414 void restorePageCenterAndScale(const WebCore::FloatPoint&, double scale); 1415 1415 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r198455 r199233 359 359 DynamicViewportUpdateChangedTarget(double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t dynamicViewportSizeUpdateID) 360 360 CouldNotRestorePageState() 361 RestorePageState(WebCore::Float Rect exposedContentRect, WebCore::IntPoint scrollOrigin, double scale)361 RestorePageState(WebCore::FloatPoint scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::FloatSize obscuredInsetOnSave, double scale) 362 362 RestorePageCenterAndScale(WebCore::FloatPoint unobscuredCenter, double scale) 363 363 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 120 120 void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) override; 121 121 void couldNotRestorePageState() override; 122 void restorePageState(const WebCore::Float Rect&, const WebCore::IntPoint&, double) override;122 void restorePageState(const WebCore::FloatPoint&, const WebCore::FloatPoint&, const WebCore::FloatSize&, double) override; 123 123 void restorePageCenterAndScale(const WebCore::FloatPoint&, double) override; 124 124 -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r198580 r199233 512 512 } 513 513 514 void PageClientImpl::restorePageState(const WebCore::Float Rect& exposedContentRect, const WebCore::IntPoint& scrollOrigin, double scale)515 { 516 [m_webView _restorePageS tateToExposedRect:exposedContentRect scrollOrigin:scrollOriginscale:scale];514 void 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]; 517 517 } 518 518 -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.h
r198455 r199233 69 69 - (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect 70 70 unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates 71 obscuredInset:(CGSize)topInset 71 72 scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale 72 73 inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively; -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r198455 r199233 357 357 358 358 - (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates 359 scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively359 obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively 360 360 { 361 361 double timestamp = monotonicallyIncreasingTime(); … … 367 367 368 368 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), 370 370 zoomScale, isStableState, isChangingObscuredInsetsInteractively, _webView._allowsViewportShrinkToFit, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate); 371 371 -
trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
r198455 r199233 183 183 } 184 184 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)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) 186 186 { 187 187 if (!isValid()) 188 188 return; 189 189 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()); 191 191 192 192 if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate) … … 820 820 } 821 821 822 void WebPageProxy::restorePageState(const WebCore::Float Rect& exposedContentRect, const WebCore::IntPoint& scrollOrigin, double scale)823 { 824 m_pageClient.restorePageState( exposedContentRect, scrollOrigin, scale);822 void 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); 825 825 } 826 826 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r199111 r199233 300 300 m_drawingArea->setExposedContentRect(historyItem.exposedContentRect()); 301 301 302 send(Messages::WebPageProxy::RestorePageState(historyItem. exposedContentRect(), frameView.scrollOrigin(), boundedScale));302 send(Messages::WebPageProxy::RestorePageState(historyItem.scrollPosition(), frameView.scrollOrigin(), historyItem.obscuredInset(), boundedScale)); 303 303 } else { 304 304 IntSize oldContentSize = historyItem.contentSize(); … … 2965 2965 2966 2966 frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size()); 2967 frameView.platformSetObscuredInset(visibleContentRectUpdateInfo.obscuredInset()); 2967 2968 2968 2969 double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
Note: See TracChangeset
for help on using the changeset viewer.