Changeset 171560 in webkit
- Timestamp:
- Jul 24, 2014 5:24:56 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r171557 r171560 1 2014-07-24 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding 4 https://bugs.webkit.org/show_bug.cgi?id=135221 5 <rdar://problem/17542454> 6 7 Reviewed by Benjamin Poulain. 8 9 The call to didCommitLayerTree() can cause one or two visible rect updates, 10 via changes to the UIScrollView contentSize and contentOffset. As a result, we 11 would notify the scrolling tree about a viewport change, but using the old 12 scrolling tree rather than the new one, so we could move layers around for 13 nodes which are about to be removed from the tree. 14 15 However, we also have to ensure that programmatic scrolls are applied after 16 didCommitLayerTree() has updated the view size, so have RemoteScrollingCoordinatorProxy 17 store data about programmatic scrolls and return them to the caller, which 18 can apply them after didCommitLayerTree(). 19 20 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: Store a pointer to a RequestedScrollInfo 21 for the duration of the tree update, so that we can store requested scroll info in it. 22 (WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy): 23 (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): 24 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll): 25 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: 26 * UIProcess/WebPageProxy.cpp: 27 (WebKit::WebPageProxy::didCommitLayerTree): Give Mac a stub implementation. 28 * UIProcess/WebPageProxy.h: Group some editing-related functions together. 29 (WebKit::WebPageProxy::editorState): 30 (WebKit::WebPageProxy::canDelete): 31 (WebKit::WebPageProxy::hasSelectedRange): 32 (WebKit::WebPageProxy::isContentEditable): 33 (WebKit::WebPageProxy::maintainsInactiveSelection): 34 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: 35 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Ordering change: update 36 the layer tree, then call didCommitLayerTree(), then do the viewport update, followed 37 by any programmatic scroll. 38 1 39 2014-07-24 Peyton Randolph <prandolph@apple.com> 2 40 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
r171532 r171560 50 50 : m_webPageProxy(webPageProxy) 51 51 , m_scrollingTree(RemoteScrollingTree::create(*this)) 52 , m_requestedScrollInfo(nullptr) 52 53 , m_propagatesMainFrameScrolls(true) 53 54 { … … 78 79 } 79 80 80 void RemoteScrollingCoordinatorProxy::updateScrollingTree(const RemoteScrollingCoordinatorTransaction& transaction )81 void RemoteScrollingCoordinatorProxy::updateScrollingTree(const RemoteScrollingCoordinatorTransaction& transaction, RequestedScrollInfo& requestedScrollInfo) 81 82 { 83 m_requestedScrollInfo = &requestedScrollInfo; 84 82 85 OwnPtr<ScrollingStateTree> stateTree = const_cast<RemoteScrollingCoordinatorTransaction&>(transaction).scrollingStateTree().release(); 83 86 … … 90 93 connectStateNodeLayers(*stateTree, *layerTreeHost); 91 94 m_scrollingTree->commitNewTreeState(stateTree.release()); 95 96 m_requestedScrollInfo = nullptr; 92 97 } 93 98 … … 170 175 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll) 171 176 { 172 if (scrolledNodeID == rootScrollingNodeID()) 173 m_webPageProxy.requestScroll(scrollPosition, representsProgrammaticScroll); 177 if (scrolledNodeID == rootScrollingNodeID() && m_requestedScrollInfo) { 178 m_requestedScrollInfo->requestsScrollPositionUpdate = true; 179 m_requestedScrollInfo->requestIsProgrammaticScroll = representsProgrammaticScroll; 180 m_requestedScrollInfo->requestedScrollPosition = scrollPosition; 181 } 174 182 } 175 183 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
r171532 r171560 69 69 const RemoteLayerTreeHost* layerTreeHost() const; 70 70 71 void updateScrollingTree(const RemoteScrollingCoordinatorTransaction&); 71 struct RequestedScrollInfo { 72 bool requestsScrollPositionUpdate { }; 73 bool requestIsProgrammaticScroll { }; 74 WebCore::FloatPoint requestedScrollPosition; 75 }; 76 void updateScrollingTree(const RemoteScrollingCoordinatorTransaction&, RequestedScrollInfo&); 72 77 73 78 void setPropagatesMainFrameScrolls(bool propagatesMainFrameScrolls) { m_propagatesMainFrameScrolls = propagatesMainFrameScrolls; } … … 87 92 WebPageProxy& m_webPageProxy; 88 93 RefPtr<RemoteScrollingTree> m_scrollingTree; 94 RequestedScrollInfo* m_requestedScrollInfo; 89 95 bool m_propagatesMainFrameScrolls; 90 96 }; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r171471 r171560 1314 1314 m_process->send(Messages::WebPage::ExecuteEditCommand(commandName), m_pageID); 1315 1315 } 1316 1316 1317 #if !PLATFORM(IOS) 1318 void WebPageProxy::didCommitLayerTree(const RemoteLayerTreeTransaction&) 1319 { 1320 } 1321 #endif 1322 1317 1323 #if USE(TILED_BACKING_STORE) 1318 1324 void WebPageProxy::commitPageTransitionViewport() -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r171471 r171560 378 378 void executeEditCommand(const String& commandName); 379 379 void validateCommand(const String& commandName, std::function<void (const String&, bool, int32_t, CallbackBase::Error)>); 380 381 const EditorState& editorState() const { return m_editorState; } 382 bool canDelete() const { return hasSelectedRange() && isContentEditable(); } 383 bool hasSelectedRange() const { return m_editorState.selectionIsRange; } 384 bool isContentEditable() const { return m_editorState.isContentEditable; } 385 386 bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; } 387 void setMaintainsInactiveSelection(bool); 388 380 389 #if PLATFORM(IOS) 381 390 void executeEditCommand(const String& commandName, std::function<void (CallbackBase::Error)>); … … 403 412 int32_t deviceOrientation() const { return m_deviceOrientation; } 404 413 void willCommitLayerTree(uint64_t transactionID); 405 void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);406 414 407 415 void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>); … … 443 451 #endif 444 452 445 const EditorState& editorState() const { return m_editorState; } 446 bool canDelete() const { return hasSelectedRange() && isContentEditable(); } 447 bool hasSelectedRange() const { return m_editorState.selectionIsRange; } 448 bool isContentEditable() const { return m_editorState.isContentEditable; } 449 450 bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; } 451 void setMaintainsInactiveSelection(bool); 453 void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&); 454 452 455 #if USE(TILED_BACKING_STORE) 453 456 void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect); -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
r171532 r171560 201 201 m_webPageProxy->setAcceleratedCompositingRootLayer(m_remoteLayerTreeHost.rootLayer()); 202 202 203 #if PLATFORM(IOS) 203 #if ENABLE(ASYNC_SCROLLING) 204 RemoteScrollingCoordinatorProxy::RequestedScrollInfo requestedScrollInfo; 205 m_webPageProxy->scrollingCoordinatorProxy()->updateScrollingTree(scrollingTreeTransaction, requestedScrollInfo); 206 #endif 207 204 208 m_webPageProxy->didCommitLayerTree(layerTreeTransaction); 205 #endif206 209 207 210 #if ENABLE(ASYNC_SCROLLING) 208 m_webPageProxy->scrollingCoordinatorProxy()->updateScrollingTree(scrollingTreeTransaction);209 210 211 #if PLATFORM(IOS) 211 212 if (m_webPageProxy->scrollingCoordinatorProxy()->hasFixedOrSticky()) { 213 // If we got a new layer for a fixed or sticky node, its position from the WebProcess is probably stale. We need to re-run the "viewport" changed logic to udpate it with our UI-side state. 212 214 FloatRect customFixedPositionRect = m_webPageProxy->computeCustomFixedPositionRect(m_webPageProxy->unobscuredContentRect(), m_webPageProxy->displayedContentScale()); 213 // If we got a new layer for a fixed or sticky node, its position from the WebProcess is probably stale. We need to re-run the "viewport" changed logic to udpate it with our UI-side state.214 215 m_webPageProxy->scrollingCoordinatorProxy()->viewportChangedViaDelegatedScrolling(m_webPageProxy->scrollingCoordinatorProxy()->rootScrollingNodeID(), customFixedPositionRect, m_webPageProxy->displayedContentScale()); 215 216 } 216 217 #endif 218 219 // Handle requested scroll position updates from the scrolling tree transaction after didCommitLayerTree() 220 // has updated the view size based on the content size. 221 if (requestedScrollInfo.requestsScrollPositionUpdate) 222 m_webPageProxy->requestScroll(requestedScrollInfo.requestedScrollPosition, requestedScrollInfo.requestIsProgrammaticScroll); 217 223 #endif // ENABLE(ASYNC_SCROLLING) 218 224
Note: See TracChangeset
for help on using the changeset viewer.