Changeset 167262 in webkit
- Timestamp:
- Apr 14, 2014 12:49:37 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167261 r167262 1 2014-04-14 Simon Fraser <simon.fraser@apple.com> 2 3 [WK2 iOS] Scrolling to anchor links is broken 4 https://bugs.webkit.org/show_bug.cgi?id=131618 5 <rdar://problem/16599144> 6 7 Reviewed by Tim Horton. 8 9 Have ScrollingTreeScrollingNode pass RequestedScrollPosition updates 10 to the scrolling tree, so that the scrolling tree can have custom behavior 11 for them if necessary. 12 13 * page/scrolling/ScrollingTree.h: 14 (WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll): 15 * page/scrolling/ScrollingTreeScrollingNode.cpp: 16 (WebCore::ScrollingTreeScrollingNode::updateAfterChildren): 17 * page/scrolling/ScrollingTreeScrollingNode.h: 18 1 19 2014-04-14 Brian J. Burg <burg@cs.washington.edu> 2 20 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r166531 r167262 75 75 // Updates FrameView/RenderLayer scrolling state and GraphicsLayers. 76 76 virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) = 0; 77 78 // Called for requested scroll position updates. 79 virtual void scrollingTreeNodeRequestsScroll(ScrollingNodeID, const FloatPoint& /*scrollPosition*/, bool /*representsProgrammaticScroll*/) { } 77 80 78 81 // Delegated scrolling/zooming has caused the viewport to change, so update viewport-constrained layers -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r166293 r167262 88 88 } 89 89 90 void ScrollingTreeScrollingNode::updateAfterChildren(const ScrollingStateNode& stateNode) 91 { 92 const ScrollingStateScrollingNode& scrollingStateNode = toScrollingStateScrollingNode(stateNode); 93 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) 94 scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), scrollingStateNode.requestedScrollPosition(), scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll()); 95 } 96 90 97 } // namespace WebCore 91 98 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r166531 r167262 46 46 47 47 virtual void updateBeforeChildren(const ScrollingStateNode&) override; 48 virtual void updateAfterChildren(const ScrollingStateNode&) override; 48 49 49 50 // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children. -
trunk/Source/WebKit2/ChangeLog
r167256 r167262 1 2014-04-14 Simon Fraser <simon.fraser@apple.com> 2 3 [WK2 iOS] Scrolling to anchor links is broken 4 https://bugs.webkit.org/show_bug.cgi?id=131618 5 <rdar://problem/16599144> 6 7 Reviewed by Tim Horton. 8 9 The RemoteScrollingTree implements scrollingTreeNodeRequestsScroll 10 to get informed about requested scroll position updates, and passes 11 them along via the RemoteScrollingCoordinatorProxy, WebPageProxy and PageClient 12 to the WKWebView, which performs a scroll. 13 14 * UIProcess/API/Cocoa/WKWebView.mm: 15 (-[WKWebView _scrollToContentOffset:WebCore::]): Scroll to content offset, 16 taking page scale and insets into account. 17 * UIProcess/API/Cocoa/WKWebViewInternal.h: 18 * UIProcess/CoordinatedGraphics/WebView.cpp: 19 (WebKit::WebView::requestScroll): 20 * UIProcess/CoordinatedGraphics/WebView.h: 21 * UIProcess/PageClient.h: 22 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: 23 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll): 24 Pass scrolls along to the WebPageProxy for the root node. We will also need 25 to handle programmatic scrolls for overflow soon. 26 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: 27 * UIProcess/Scrolling/RemoteScrollingTree.cpp: 28 (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll): 29 * UIProcess/Scrolling/RemoteScrollingTree.h: 30 * UIProcess/WebPageProxy.cpp: 31 (WebKit::WebPageProxy::requestScroll): 32 * UIProcess/WebPageProxy.h: 33 * UIProcess/ios/PageClientImplIOS.h: 34 * UIProcess/ios/PageClientImplIOS.mm: 35 (WebKit::PageClientImpl::canScrollView): 36 (WebKit::PageClientImpl::requestScroll): 37 * UIProcess/mac/PageClientImpl.mm: 38 (WebKit::PageClientImpl::requestScroll): 39 1 40 2014-04-12 Antti Koivisto <antti@apple.com> 2 41 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r167060 r167262 545 545 } 546 546 547 - (void)_scrollToContentOffset:(WebCore::FloatPoint)contentOffset 548 { 549 WebCore::FloatPoint scaledOffset = contentOffset; 550 CGFloat zoomScale = contentZoomScale(self); 551 scaledOffset.scale(zoomScale, zoomScale); 552 553 UIEdgeInsets inset = [_scrollView contentInset]; 554 scaledOffset += WebCore::FloatSize(-inset.left, -inset.top); 555 556 [_scrollView setContentOffset:scaledOffset]; 557 } 558 547 559 - (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance 548 560 { -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
r167060 r167262 65 65 - (RetainPtr<CGImageRef>)_takeViewSnapshot; 66 66 67 - (void)_scrollToContentOffset:(WebCore::FloatPoint)contentOffset; 67 68 - (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance; 68 69 - (BOOL)_zoomToRect:(WebCore::FloatRect)targetRect withOrigin:(WebCore::FloatPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(float)minimumScrollDistance; -
trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
r165760 r167262 84 84 } 85 85 86 void PageClientImpl::requestScroll(const WebCore::FloatPoint&, bool) 87 { 88 notImplemented(); 89 } 90 86 91 WebCore::IntSize PageClientImpl::viewSize() 87 92 { -
trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
r165707 r167262 66 66 virtual bool canScrollView() override { return false; } 67 67 virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) override; 68 virtual void requestScroll(const WebCore::FloatPoint& scrollPosition, bool isProgrammaticScroll) override; 68 69 virtual WebCore::IntSize viewSize() override; 69 70 virtual bool isViewWindowActive() override; -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
r166572 r167262 305 305 } 306 306 307 void WebView::requestScroll(const WebCore::FloatPoint&, bool) 308 { 309 notImplemented(); 310 } 311 307 312 WebCore::IntSize WebView::viewSize() 308 313 { -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
r165313 r167262 132 132 virtual bool canScrollView() override { return false; } 133 133 virtual void scrollView(const WebCore::IntRect&, const WebCore::IntSize&) override; 134 virtual void requestScroll(const WebCore::FloatPoint&, bool) override; 134 135 135 136 virtual WebCore::IntSize viewSize() override; -
trunk/Source/WebKit2/UIProcess/PageClient.h
r167155 r167262 94 94 // Tell the view to scroll scrollRect by scrollOffset. 95 95 virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) = 0; 96 // Tell the view to scroll to the given position, and whether this was a programmatic scroll. 97 virtual void requestScroll(const WebCore::FloatPoint& scrollPosition, bool isProgrammaticScroll) = 0; 96 98 97 99 // Return the size of the view the page is associated with. -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
r166531 r167262 161 161 } 162 162 163 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll) 164 { 165 if (scrolledNodeID == rootScrollingNodeID()) 166 m_webPageProxy.requestScroll(scrollPosition, representsProgrammaticScroll); 167 } 168 163 169 } // namespace WebKit 164 170 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
r166531 r167262 54 54 // Inform the web process that the scroll position changed (called from the scrolling tree) 55 55 void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition); 56 void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll); 56 57 57 58 bool isPointInNonFastScrollableRegion(const WebCore::IntPoint&) const; -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
r166531 r167262 83 83 } 84 84 85 void RemoteScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll) 86 { 87 m_scrollingCoordinatorProxy.scrollingTreeNodeRequestsScroll(nodeID, scrollPosition, representsProgrammaticScroll); 88 } 89 85 90 PassOwnPtr<ScrollingTreeNode> RemoteScrollingTree::createNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID) 86 91 { -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h
r166531 r167262 48 48 49 49 virtual void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) override; 50 virtual void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll) override; 50 51 51 52 private: -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r167253 r167262 1009 1009 } 1010 1010 1011 void WebPageProxy::requestScroll(const FloatPoint& scrollPosition, bool isProgrammaticScroll) 1012 { 1013 m_pageClient.requestScroll(scrollPosition, isProgrammaticScroll); 1014 } 1015 1011 1016 void WebPageProxy::updateViewState(ViewState::Flags flagsToUpdate) 1012 1017 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r167253 r167262 546 546 void displayView(); 547 547 bool canScrollView(); 548 void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset); 548 void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset); // FIXME: CoordinatedGraphics should use requestScroll(). 549 void requestScroll(const WebCore::FloatPoint& scrollPosition, bool isProgrammaticScroll); 549 550 550 551 void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; } -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
r167155 r167262 54 54 virtual bool canScrollView() override; 55 55 virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) override; 56 virtual void requestScroll(const WebCore::FloatPoint& scrollPosition, bool isProgrammaticScroll) override; 56 57 virtual WebCore::IntSize viewSize() override; 57 58 virtual bool isViewWindowActive() override; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r167154 r167262 83 83 } 84 84 85 bool PageClientImpl::canScrollView() 86 { 87 notImplemented(); 88 return false; 89 } 90 85 91 void PageClientImpl::scrollView(const IntRect&, const IntSize&) 86 92 { … … 88 94 } 89 95 90 bool PageClientImpl::canScrollView()91 { 92 notImplemented();93 return false;96 void PageClientImpl::requestScroll(const FloatPoint& scrollPosition, bool isProgrammaticScroll) 97 { 98 UNUSED_PARAM(isProgrammaticScroll); 99 [m_webView _scrollToContentOffset:scrollPosition]; 94 100 } 95 101 -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm
r166466 r167262 171 171 } 172 172 173 void PageClientImpl::requestScroll(const FloatPoint& scrollPosition, bool isProgrammaticScroll) 174 { 175 ASSERT_NOT_REACHED(); 176 } 177 173 178 IntSize PageClientImpl::viewSize() 174 179 {
Note: See TracChangeset
for help on using the changeset viewer.