Changeset 199259 in webkit
- Timestamp:
- Apr 8, 2016 6:18:46 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r199258 r199259 1 2016-04-08 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] WKWebViews should consult ancestor UIScrollViews to determine tiling area 4 https://bugs.webkit.org/show_bug.cgi?id=156429 5 rdar://problem/25455111 6 7 Reviewed by Tim Horton. 8 9 When a WKWebView is expanded to full size, then embedded in UIScrollView, it would 10 create huge tiles that cover the entire view area (since it considered itself non-scrollable). 11 12 Fix to always use 512x512 tiles in this configuration, and to adjust the tile coverage 13 for the area exposed through the enclosing UIScrollView. 14 15 * loader/HistoryController.cpp: 16 (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): setObscuredInset() 17 moved from FrameView to Page. 18 * page/FrameView.cpp: 19 (WebCore::FrameView::adjustTiledBackingScrollability): If we're clipped by an ancestor scrollView, 20 just assume we're scrollable on both axes. 21 * page/Page.h: 22 (WebCore::Page::obscuredInset): 23 (WebCore::Page::setObscuredInset): 24 (WebCore::Page::enclosedInScrollView): 25 (WebCore::Page::setEnclosedInScrollView): 26 * platform/ScrollView.h: 27 (WebCore::ScrollView::platformObscuredInset): Deleted. 28 (WebCore::ScrollView::platformSetObscuredInset): Deleted. 29 1 30 2016-04-08 Joseph Pecoraro <pecoraro@apple.com> 2 31 -
trunk/Source/WebCore/loader/HistoryController.cpp
r199233 r199259 80 80 else 81 81 item->setScrollPosition(frameView->scrollPosition()); 82 82 83 #if PLATFORM(IOS) 83 84 item->setExposedContentRect(frameView->exposedContentRect()); 84 85 item->setUnobscuredContentRect(frameView->unobscuredContentRect()); 85 item->setObscuredInset(frameView->platformObscuredInset());86 86 #endif 87 87 88 88 Page* page = m_frame.page(); 89 if (page && m_frame.isMainFrame()) 89 if (page && m_frame.isMainFrame()) { 90 90 item->setPageScaleFactor(page->pageScaleFactor() / page->viewScaleFactor()); 91 #if PLATFORM(IOS) 92 item->setObscuredInset(page->obscuredInset()); 93 #endif 94 } 91 95 92 96 // 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
r199200 r199259 2486 2486 bool clippedByAncestorView = static_cast<bool>(m_viewExposedRect); 2487 2487 2488 #if PLATFORM(IOS) 2489 if (Page* page = frame().page()) 2490 clippedByAncestorView |= page->enclosedInScrollView(); 2491 #endif 2492 2488 2493 if (delegatesScrolling()) { 2489 2494 IntSize documentSize = contentsSize(); -
trunk/Source/WebCore/page/Page.h
r198929 r199259 294 294 float topContentInset() const { return m_topContentInset; } 295 295 WEBCORE_EXPORT void setTopContentInset(float); 296 297 #if PLATFORM(IOS) 298 FloatSize obscuredInset() const { return m_obscuredInset; } 299 void setObscuredInset(FloatSize inset) { m_obscuredInset = inset; } 296 300 301 bool enclosedInScrollView() const { return m_enclosedInScrollView; } 302 void setEnclosedInScrollView(bool f) { m_enclosedInScrollView = f; } 303 #endif 304 297 305 #if ENABLE(IOS_TEXT_AUTOSIZING) 298 306 float textAutosizingWidth() const { return m_textAutosizingWidth; } … … 600 608 601 609 float m_topContentInset; 602 610 611 #if PLATFORM(IOS) 612 // This is only used for history scroll position restoration. 613 FloatSize m_obscuredInset; 614 bool m_enclosedInScrollView { false }; 615 #endif 616 603 617 #if ENABLE(IOS_TEXT_AUTOSIZING) 604 618 float m_textAutosizingWidth; -
trunk/Source/WebCore/platform/ScrollView.h
r199233 r199259 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 #endif385 386 381 protected: 387 382 ScrollView(); … … 459 454 FloatSize m_unobscuredContentSize; 460 455 // This is only used for history scroll position restoration. 461 FloatSize m_obscuredInset;462 456 #else 463 457 IntRect m_fixedVisibleContentRect; -
trunk/Source/WebKit2/ChangeLog
r199258 r199259 1 2016-04-08 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] WKWebViews should consult ancestor UIScrollViews to determine tiling area 4 https://bugs.webkit.org/show_bug.cgi?id=156429 5 rdar://problem/25455111 6 7 Reviewed by Tim Horton. 8 9 When a WKWebView is expanded to full size, then embedded in UIScrollView, it would 10 create huge tiles that cover the entire view area (since it considered itself non-scrollable). 11 12 Fix to always use 512x512 tiles in this configuration, and to adjust the tile coverage 13 for the area exposed through the enclosing UIScrollView. 14 15 * Shared/VisibleContentRectUpdateInfo.cpp: Add enclosedInScrollView(), which is used to 16 trigger normal-sized tiles. 17 (WebKit::VisibleContentRectUpdateInfo::encode): 18 (WebKit::VisibleContentRectUpdateInfo::decode): 19 * Shared/VisibleContentRectUpdateInfo.h: 20 (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): 21 (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): 22 (WebKit::operator==): 23 * UIProcess/API/Cocoa/WKWebView.mm: 24 (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): Pass our scrollView. 25 (-[WKWebView _didFinishScrolling]): 26 (-[WKWebView scrollViewDidScroll:]): 27 (-[WKWebView scrollViewDidZoom:]): 28 (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): 29 (-[WKWebView _scrollViewDidInterruptDecelerating:]): 30 (-[WKWebView _visibleRectInEnclosingScrollView:]): 31 (-[WKWebView _visibleContentRect]): Compute the exposed part of the content relative 32 to the WKWebView, then intersect with the exposed part via any ancestor UIScrollView. 33 (-[WKWebView _didScroll]): This is called by UIKit when some ancestor UIScrollView scrolls. 34 However, we don't get all the UIScrollView delegate callbacks, so have to use a timer to 35 trigger a call to -_updateVisibleContentRects when we're in a stable state. 36 (-[WKWebView _enclosingScrollerScrollingEnded:]): 37 (-[WKWebView _frameOrBoundsChanged]): 38 (-[WKWebView _updateVisibleContentRects]): 39 (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Get the stable state from the 40 scroll view that the user is interacting with. 41 (-[WKWebView _updateContentRectsWithState:]): 42 * UIProcess/API/Cocoa/WKWebViewInternal.h: 43 * UIProcess/WebPageProxy.h: Rather than pass a bazillion arguments through updateVisibleContentRects(), just 44 pass the VisibleContentRectUpdateInfo struct. 45 * UIProcess/ios/WKContentView.h: 46 * UIProcess/ios/WKContentView.mm: 47 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): 48 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted. 49 * UIProcess/ios/WebPageProxyIOS.mm: 50 (WebKit::WebPageProxy::updateVisibleContentRects): 51 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: 52 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): 53 (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation): 54 * WebProcess/WebPage/WebPage.cpp: 55 (WebKit::WebPage::updatePreferences): 56 * WebProcess/WebPage/ios/WebPageIOS.mm: 57 (WebKit::WebPage::updateVisibleContentRects): 58 1 59 2016-04-08 Joseph Pecoraro <pecoraro@apple.com> 2 60 … … 80 138 * UIProcess/ios/WKContentView.mm: 81 139 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): 140 Make the VisibleContentRectUpdateInfo here and pass it down. 82 141 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted. 83 142 * UIProcess/ios/WebPageProxyIOS.mm: … … 86 145 * WebProcess/WebPage/ios/WebPageIOS.mm: 87 146 (WebKit::WebPage::restorePageState): 88 (WebKit::WebPage::updateVisibleContentRects): 147 (WebKit::WebPage::updateVisibleContentRects): setObscuredInset() moved from FrameView to Page. 148 Also call setEnclosedInScrollView() on Page. 89 149 90 150 2016-04-08 Brady Eidson <beidson@apple.com> -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp
r199233 r199259 47 47 encoder << m_isChangingObscuredInsetsInteractively; 48 48 encoder << m_allowShrinkToFit; 49 encoder << m_enclosedInScrollView; 49 50 } 50 51 … … 79 80 if (!decoder.decode(result.m_allowShrinkToFit)) 80 81 return false; 82 if (!decoder.decode(result.m_enclosedInScrollView)) 83 return false; 81 84 82 85 return true; -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h
r199233 r199259 42 42 VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect, 43 43 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 enclosedInScrollView, 45 45 double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId) 46 46 : m_exposedContentRect(exposedContentRect) … … 58 58 , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively) 59 59 , m_allowShrinkToFit(allowShrinkToFit) 60 , m_enclosedInScrollView(enclosedInScrollView) 60 61 { 61 62 } … … 71 72 bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; } 72 73 bool allowShrinkToFit() const { return m_allowShrinkToFit; } 74 bool enclosedInScrollView() const { return m_enclosedInScrollView; } 73 75 74 76 double timestamp() const { return m_timestamp; } … … 97 99 bool m_isChangingObscuredInsetsInteractively { false }; 98 100 bool m_allowShrinkToFit { false }; 101 bool m_enclosedInScrollView { false }; 99 102 }; 100 103 … … 111 114 && a.scaleChangeRate() == b.scaleChangeRate() 112 115 && a.inStableState() == b.inStableState() 113 && a.allowShrinkToFit() == b.allowShrinkToFit(); 116 && a.allowShrinkToFit() == b.allowShrinkToFit() 117 && a.enclosedInScrollView() == b.enclosedInScrollView(); 114 118 } 115 119 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r199233 r199259 241 241 RetainPtr<UIView> _customContentFixedOverlayView; 242 242 243 RetainPtr<NSTimer> _enclosingScrollViewScrollTimer; 244 BOOL _didScrollSinceLastTimerFire; 245 243 246 WebCore::Color _scrollViewBackgroundColor; 244 247 … … 1007 1010 if (_hadDelayedUpdateVisibleContentRects) { 1008 1011 _hadDelayedUpdateVisibleContentRects = NO; 1009 [self _updateVisibleContentRect s];1012 [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()]; 1010 1013 } 1011 1014 } … … 1751 1754 return; 1752 1755 1753 [self _updateVisibleContentRect s];1756 [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()]; 1754 1757 [_contentView didFinishScrolling]; 1755 1758 } … … 1805 1808 [_customContentView scrollViewDidScroll:(UIScrollView *)scrollView]; 1806 1809 1807 [self _updateVisibleContentRect s];1810 [self _updateVisibleContentRectAfterScrollInView:scrollView]; 1808 1811 1809 1812 if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page->scrollingPerformanceData()) … … 1814 1817 { 1815 1818 [self _updateScrollViewBackground]; 1816 [self _updateVisibleContentRect s];1819 [self _updateVisibleContentRectAfterScrollInView:scrollView]; 1817 1820 } 1818 1821 … … 1820 1823 { 1821 1824 ASSERT(scrollView == _scrollView); 1822 [self _updateVisibleContentRect s];1825 [self _updateVisibleContentRectAfterScrollInView:scrollView]; 1823 1826 [_contentView didZoomToScale:scale]; 1824 1827 } … … 1835 1838 1836 1839 [_contentView didInterruptScrolling]; 1840 [self _updateVisibleContentRectAfterScrollInView:scrollView]; 1841 } 1842 1843 - (CGRect)_visibleRectInEnclosingScrollView:(UIScrollView *)enclosingScrollView 1844 { 1845 if (!enclosingScrollView) 1846 return self.bounds; 1847 1848 CGRect exposedRect = [enclosingScrollView convertRect:enclosingScrollView.bounds toView:self]; 1849 return CGRectIntersectsRect(exposedRect, self.bounds) ? CGRectIntersection(exposedRect, self.bounds) : CGRectZero; 1850 } 1851 1852 - (CGRect)_visibleContentRect 1853 { 1854 CGRect visibleRectInContentCoordinates = _frozenVisibleContentRect ? _frozenVisibleContentRect.value() : [self convertRect:self.bounds toView:_contentView.get()]; 1855 1856 if (UIScrollView *enclosingScroller = [self _scroller]) { 1857 CGRect viewVisibleRect = [self _visibleRectInEnclosingScrollView:enclosingScroller]; 1858 CGRect viewVisibleContentRect = [self convertRect:viewVisibleRect toView:_contentView.get()]; 1859 visibleRectInContentCoordinates = CGRectIntersection(visibleRectInContentCoordinates, viewVisibleContentRect); 1860 } 1861 1862 return visibleRectInContentCoordinates; 1863 } 1864 1865 // Called when some ancestor UIScrollView scrolls. 1866 - (void)_didScroll 1867 { 1868 [self _updateVisibleContentRectAfterScrollInView:[self _scroller]]; 1869 1870 const NSTimeInterval ScrollingEndedTimerInterval = 0.032; 1871 if (!_enclosingScrollViewScrollTimer) { 1872 _enclosingScrollViewScrollTimer = adoptNS([[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:ScrollingEndedTimerInterval] 1873 interval:0 target:self selector:@selector(_enclosingScrollerScrollingEnded:) userInfo:nil repeats:YES]); 1874 [[NSRunLoop mainRunLoop] addTimer:_enclosingScrollViewScrollTimer.get() forMode:NSDefaultRunLoopMode]; 1875 } 1876 _didScrollSinceLastTimerFire = YES; 1877 } 1878 1879 - (void)_enclosingScrollerScrollingEnded:(NSTimer *)timer 1880 { 1881 if (_didScrollSinceLastTimerFire) { 1882 _didScrollSinceLastTimerFire = NO; 1883 return; 1884 } 1885 1837 1886 [self _updateVisibleContentRects]; 1887 [_enclosingScrollViewScrollTimer invalidate]; 1888 _enclosingScrollViewScrollTimer = nil; 1838 1889 } 1839 1890 … … 1848 1899 if (!_overridesMaximumUnobscuredSize) 1849 1900 _page->setMaximumUnobscuredSize(WebCore::FloatSize(bounds.size)); 1850 if ( WebKit::DrawingAreaProxy*drawingArea = _page->drawingArea())1901 if (auto drawingArea = _page->drawingArea()) 1851 1902 drawingArea->setSize(WebCore::IntSize(bounds.size), WebCore::IntSize(), WebCore::IntSize()); 1852 1903 } … … 1878 1929 - (void)_updateVisibleContentRects 1879 1930 { 1931 // For visible rect updates not associated with a spefic UIScrollView, just consider our own scroller. 1932 [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()]; 1933 } 1934 1935 - (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView 1936 { 1937 BOOL isStableState = !([scrollView isDragging] || [scrollView isDecelerating] || [scrollView isZooming] || [scrollView _isAnimatingZoom] || [scrollView _isScrollingToTop]); 1938 1939 if (isStableState && scrollView == _scrollView.get()) 1940 isStableState = !_isChangingObscuredInsetsInteractively; 1941 1942 if (isStableState && scrollView == _scrollView.get()) 1943 isStableState = ![self _scrollViewIsRubberBanding]; 1944 1945 // FIXME: this can be made static after we stop supporting iOS 8.x. 1946 if (isStableState && [scrollView respondsToSelector:@selector(_isInterruptingDeceleration)]) 1947 isStableState = ![scrollView performSelector:@selector(_isInterruptingDeceleration)]; 1948 1949 [self _updateContentRectsWithState:isStableState]; 1950 } 1951 1952 - (void)_updateContentRectsWithState:(BOOL)inStableState 1953 { 1880 1954 if (![self usesStandardContentView]) { 1881 1955 [_customContentView web_computedContentInsetDidChange]; … … 1895 1969 1896 1970 CGRect fullViewRect = self.bounds; 1897 CGRect visibleRectInContentCoordinates = _frozenVisibleContentRect ? _frozenVisibleContentRect.value() : [self convertRect:fullViewRect toView:_contentView.get()];1971 CGRect visibleRectInContentCoordinates = [self _visibleContentRect]; 1898 1972 1899 1973 UIEdgeInsets computedContentInsetUnadjustedForKeyboard = [self _computedContentInset]; … … 1906 1980 CGFloat scaleFactor = contentZoomScale(self); 1907 1981 1908 BOOL isStableState = !(_isChangingObscuredInsetsInteractively || [_scrollView isDragging] || [_scrollView isDecelerating] || [_scrollView isZooming] || [_scrollView _isAnimatingZoom] || [_scrollView _isScrollingToTop] || [self _scrollViewIsRubberBanding]);1909 1910 // FIXME: this can be made static after we stop supporting iOS 8.x.1911 if (isStableState && [_scrollView respondsToSelector:@selector(_isInterruptingDeceleration)])1912 isStableState = ![_scrollView performSelector:@selector(_isInterruptingDeceleration)];1913 1914 1982 #if ENABLE(CSS_SCROLL_SNAP) && ENABLE(ASYNC_SCROLLING) 1915 if (i sStableState) {1983 if (inStableState) { 1916 1984 WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy(); 1917 1985 if (coordinator && coordinator->hasActiveSnapPoint()) { 1918 CGRect fullViewRect = self.bounds;1919 1986 CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, computedContentInsetUnadjustedForKeyboard); 1920 1987 … … 1937 2004 obscuredInset:CGSizeMake(_obscuredInsets.left, _obscuredInsets.top) 1938 2005 scale:scaleFactor minimumScale:[_scrollView minimumZoomScale] 1939 inStableState:isStableState 1940 isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively]; 2006 inStableState:inStableState 2007 isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively 2008 enclosedInScrollView:[self _scroller] != nil]; 1941 2009 } 1942 2010 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
r199233 r199259 100 100 101 101 - (void)_updateVisibleContentRects; 102 - (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView; 103 - (void)_updateContentRectsWithState:(BOOL)inStableState; 102 104 103 105 - (void)_didFinishLoadForMainFrame; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r199233 r199259 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, const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);455 void updateVisibleContentRects(const VisibleContentRectUpdateInfo&); 456 456 void resendLastVisibleContentRects(); 457 457 -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.h
r199233 r199259 71 71 obscuredInset:(CGSize)topInset 72 72 scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale 73 inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively; 73 inStableState:(BOOL)isStableState 74 isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively 75 enclosedInScrollView:(BOOL)enclosedInScrollView; 74 76 75 77 - (void)didFinishScrolling; -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r199233 r199259 357 357 358 358 - (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 enclosedInScrollView:(BOOL)enclosedInScrollView 360 { 361 auto drawingArea = _page->drawingArea(); 362 if (!drawingArea) 363 return; 364 361 365 double timestamp = monotonicallyIncreasingTime(); 362 366 HistoricalVelocityData::VelocityData velocityData; … … 367 371 368 372 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 enclosedInScrollView, 385 timestamp, 386 velocityData.horizontalVelocity, 387 velocityData.verticalVelocity, 388 velocityData.scaleChangeRate, 389 downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea).lastCommittedLayerTreeTransactionID()); 390 391 _page->updateVisibleContentRects(visibleContentRectUpdateInfo); 371 392 372 393 RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy(); … … 374 395 scrollingCoordinator->viewportChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), fixedPositionRect, zoomScale); 375 396 376 if (auto drawingArea = _page->drawingArea()) 377 drawingArea->updateDebugIndicator(); 378 397 drawingArea->updateDebugIndicator(); 398 379 399 [self updateFixedClippingView:fixedPositionRect]; 380 400 } -
trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
r199233 r199259 183 183 } 184 184 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)185 void WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdate) 186 186 { 187 187 if (!isValid()) 188 188 return; 189 189 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); 197 195 } 198 196 -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
r199111 r199259 260 260 #if PLATFORM(IOS) 261 261 FloatPoint tiledMapLocation = m_webPageProxy.unobscuredContentRect().location(); 262 tiledMapLocation = tiledMapLocation.expandedTo(m_webPageProxy.exposedContentRect().location() + FloatSize(0, 60)); 263 262 264 float absoluteInset = indicatorInset / m_webPageProxy.displayedContentScale(); 263 265 tiledMapLocation += FloatSize(absoluteInset, absoluteInset); -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r199233 r199259 2965 2965 2966 2966 frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size()); 2967 frameView.platformSetObscuredInset(visibleContentRectUpdateInfo.obscuredInset()); 2967 m_page->setObscuredInset(visibleContentRectUpdateInfo.obscuredInset()); 2968 m_page->setEnclosedInScrollView(visibleContentRectUpdateInfo.enclosedInScrollView()); 2968 2969 2969 2970 double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
Note: See TracChangeset
for help on using the changeset viewer.