Changeset 142520 in webkit
- Timestamp:
- Feb 11, 2013 2:57:36 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142517 r142520 1 2013-02-11 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r133807): Sticky-position review bar on bugzilla review page is jumpy 4 https://bugs.webkit.org/show_bug.cgi?id=104276 5 <rdar://problem/12827187> 6 7 Reviewed by Tim Horton. 8 9 When committing new scrolling tree state, if the root node has a scroll 10 position update, we would handle that before updating the state of child 11 nodes (with possibly new viewport constraints). That would cause incorrect 12 child layer updates. 13 14 Fix by adding a second 'update' phase that happens after child nodes, 15 and moving the scroll position update into that. 16 17 Scrolling tests only dump the state tree, so cannot test the bug. 18 19 * page/FrameView.cpp: 20 (WebCore::FrameView::setScrollPosition): If the scroll position didn't 21 actually change, don't request a scroll position update from the ScrollingCoordinator. 22 * page/scrolling/ScrollingTree.cpp: 23 (WebCore::ScrollingTree::updateTreeFromStateNode): Keep track of the scrolling node so 24 that we can call updateAfterChildren() on it. 25 * page/scrolling/ScrollingTreeNode.h: 26 (ScrollingTreeNode): 27 (WebCore::ScrollingTreeNode::updateAfterChildren): 28 * page/scrolling/ScrollingTreeScrollingNode.cpp: 29 (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): 30 * page/scrolling/ScrollingTreeScrollingNode.h: 31 (ScrollingTreeScrollingNode): 32 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 33 (WebCore::ScrollingCoordinatorMac::updateViewportConstrainedNode): 34 In the current bug the scrolling tree was scheduled for commit because of a 35 scroll position request, but if only the viewport constraints change, we also need 36 to commit the tree. 37 * page/scrolling/mac/ScrollingTreeFixedNode.h: 38 (ScrollingTreeFixedNode): 39 * page/scrolling/mac/ScrollingTreeFixedNode.mm: 40 (WebCore::ScrollingTreeFixedNode::updateBeforeChildren): 41 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h: 42 (ScrollingTreeScrollingNodeMac): 43 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm: 44 (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren): 45 (WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren): Move code here 46 that updates things that have to happen after children. 47 * page/scrolling/mac/ScrollingTreeStickyNode.h: 48 (ScrollingTreeStickyNode): 49 * page/scrolling/mac/ScrollingTreeStickyNode.mm: 50 (WebCore::ScrollingTreeStickyNode::updateBeforeChildren): 51 1 52 2013-02-11 Roger Fong <roger_fong@apple.com> 2 53 -
trunk/Source/WebCore/page/FrameView.cpp
r142416 r142520 1776 1776 void FrameView::setScrollPosition(const IntPoint& scrollPoint) 1777 1777 { 1778 if (scrollPoint == scrollPosition()) 1779 return; 1780 1778 1781 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true); 1779 1782 m_maintainScrollPositionAnchor = 0; -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r142505 r142520 152 152 ScrollingTreeNodeMap::const_iterator it = m_nodeMap.find(stateNode->scrollingNodeID()); 153 153 154 ScrollingTreeNode* node; 154 155 if (it != m_nodeMap.end()) { 155 ScrollingTreeNode*node = it->value;156 node->update (stateNode);156 node = it->value; 157 node->updateBeforeChildren(stateNode); 157 158 } else { 158 159 // If the node isn't found, it's either new and needs to be added to the tree, or there is a new ID for our … … 165 166 m_rootNode = ScrollingTreeScrollingNode::create(this, nodeID); 166 167 m_nodeMap.set(nodeID, m_rootNode.get()); 167 m_rootNode->update(stateNode); 168 m_rootNode->updateBeforeChildren(stateNode); 169 node = m_rootNode.get(); 168 170 } else { 169 171 OwnPtr<ScrollingTreeNode> newNode; … … 177 179 ASSERT_NOT_REACHED(); 178 180 179 ScrollingTreeNode* newNodeRawPtr= newNode.get();180 m_nodeMap.set(nodeID, n ewNodeRawPtr);181 node = newNode.get(); 182 m_nodeMap.set(nodeID, node); 181 183 ScrollingTreeNodeMap::const_iterator it = m_nodeMap.find(stateNode->parent()->scrollingNodeID()); 182 184 ASSERT(it != m_nodeMap.end()); … … 186 188 parent->appendChild(newNode.release()); 187 189 } 188 n ewNodeRawPtr->update(stateNode);190 node->updateBeforeChildren(stateNode); 189 191 } 190 192 } … … 198 200 for (size_t i = 0; i < size; ++i) 199 201 updateTreeFromStateNode(stateNodeChildren->at(i).get()); 202 203 node->updateAfterChildren(stateNode); 200 204 } 201 205 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.h
r141703 r142520 45 45 virtual ~ScrollingTreeNode(); 46 46 47 virtual void update(ScrollingStateNode*) = 0; 47 virtual void updateBeforeChildren(ScrollingStateNode*) = 0; 48 virtual void updateAfterChildren(ScrollingStateNode*) { } 48 49 49 50 virtual void parentScrollPositionDidChange(const IntRect& viewportRect, const FloatSize& cumulativeDelta) = 0; -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r141704 r142520 50 50 } 51 51 52 void ScrollingTreeScrollingNode::update (ScrollingStateNode* stateNode)52 void ScrollingTreeScrollingNode::updateBeforeChildren(ScrollingStateNode* stateNode) 53 53 { 54 54 ScrollingStateScrollingNode* state = toScrollingStateScrollingNode(stateNode); -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r141703 r142520 46 46 virtual ~ScrollingTreeScrollingNode(); 47 47 48 virtual void update (ScrollingStateNode*) OVERRIDE;48 virtual void updateBeforeChildren(ScrollingStateNode*) OVERRIDE; 49 49 50 50 // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children. -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r142505 r142520 362 362 } 363 363 } 364 scheduleTreeStateCommit(); 364 365 } 365 366 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h
r141703 r142520 48 48 ScrollingTreeFixedNode(ScrollingTree*, ScrollingNodeID); 49 49 50 virtual void update (ScrollingStateNode*) OVERRIDE;50 virtual void updateBeforeChildren(ScrollingStateNode*) OVERRIDE; 51 51 virtual void parentScrollPositionDidChange(const IntRect& viewportRect, const FloatSize& cumulativeDelta) OVERRIDE; 52 52 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm
r141704 r142520 48 48 } 49 49 50 void ScrollingTreeFixedNode::update (ScrollingStateNode* stateNode)50 void ScrollingTreeFixedNode::updateBeforeChildren(ScrollingStateNode* stateNode) 51 51 { 52 52 ScrollingStateFixedNode* fixedStateNode = toScrollingStateFixedNode(stateNode); -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h
r141703 r142520 44 44 private: 45 45 // ScrollingTreeNode member functions. 46 virtual void update(ScrollingStateNode*) OVERRIDE; 46 virtual void updateBeforeChildren(ScrollingStateNode*) OVERRIDE; 47 virtual void updateAfterChildren(ScrollingStateNode*) OVERRIDE; 47 48 virtual void handleWheelEvent(const PlatformWheelEvent&) OVERRIDE; 48 49 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
r141704 r142520 66 66 } 67 67 68 void ScrollingTreeScrollingNodeMac::update (ScrollingStateNode* stateNode)69 { 70 ScrollingTreeScrollingNode::update (stateNode);68 void ScrollingTreeScrollingNodeMac::updateBeforeChildren(ScrollingStateNode* stateNode) 69 { 70 ScrollingTreeScrollingNode::updateBeforeChildren(stateNode); 71 71 ScrollingStateScrollingNode* scrollingStateNode = toScrollingStateScrollingNode(stateNode); 72 72 … … 76 76 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) 77 77 m_counterScrollingLayer = scrollingStateNode->counterScrollingPlatformLayer(); 78 79 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))80 setScrollPosition(scrollingStateNode->requestedScrollPosition());81 82 if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ContentsSize) || scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ViewportRect))83 updateMainFramePinState(scrollPosition());84 78 85 79 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)) { … … 105 99 logWheelEventHandlerCountChanged(scrollingStateNode->wheelEventHandlerCount()); 106 100 } 101 } 102 103 void ScrollingTreeScrollingNodeMac::updateAfterChildren(ScrollingStateNode* stateNode) 104 { 105 ScrollingTreeScrollingNode::updateAfterChildren(stateNode); 106 107 ScrollingStateScrollingNode* scrollingStateNode = toScrollingStateScrollingNode(stateNode); 108 109 // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens. 110 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) 111 setScrollPosition(scrollingStateNode->requestedScrollPosition()); 112 113 if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ContentsSize) || scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ViewportRect)) 114 updateMainFramePinState(scrollPosition()); 107 115 } 108 116 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h
r141703 r142520 48 48 ScrollingTreeStickyNode(ScrollingTree*, ScrollingNodeID); 49 49 50 virtual void update (ScrollingStateNode*) OVERRIDE;50 virtual void updateBeforeChildren(ScrollingStateNode*) OVERRIDE; 51 51 virtual void parentScrollPositionDidChange(const IntRect& viewportRect, const FloatSize& cumulativeDelta) OVERRIDE; 52 52 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm
r141704 r142520 48 48 } 49 49 50 void ScrollingTreeStickyNode::update (ScrollingStateNode* stateNode)50 void ScrollingTreeStickyNode::updateBeforeChildren(ScrollingStateNode* stateNode) 51 51 { 52 52 ScrollingStateStickyNode* stickyStateNode = toScrollingStateStickyNode(stateNode);
Note: See TracChangeset
for help on using the changeset viewer.