Changeset 151581 in webkit
- Timestamp:
- Jun 13, 2013 9:58:11 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r151580 r151581 1 2013-06-13 Simon Fraser <simon.fraser@apple.com> 2 3 Sometimes we stick in slow scrolling mode even after leaving a page 4 https://bugs.webkit.org/show_bug.cgi?id=117622 5 6 Reviewed by Sam Weinig. 7 8 ScrollingCoordinator, and thus the scrolling state tree, is owned by Page, 9 and so persists when navigating between cached pages. We do give the ScrollingStateTree 10 a new ScrollingStateScrollingNode on navigation, however the ScrollingStateScrollingNode 11 would not have dirty flags set for, say, WheelEventHandlerCount if the document had 12 no wheel handlers. And because that dirty flag wasn't set, ScrollingTree::commitNewTreeState() 13 would fail to update m_hasWheelEventHandlers, so we'd remain in slow scrolling. 14 15 Fix by having ScrollingStateTree remember if it's been given a new root ScrollingStateScrollingNode, 16 and making ScrollingTree::commitNewTreeState() to the right thing in that case. 17 18 Also fix a couple of issues with the tiled scrolling indicator. First, on cached page 19 navigation, the indicator color would show the state for the old page, because 20 ScrollingCoordinatorMac::commitTreeState() checked scrollingTree()->hasWheelEventHandlers() 21 before the scrolling thread has committed the new scrolling tree. 22 23 Second, the color change would animate, so stop that. 24 25 Not testable, since tests can only dump the scrolling state tree. 26 27 * page/scrolling/ScrollingStateTree.cpp: 28 (WebCore::ScrollingStateTree::ScrollingStateTree): 29 (WebCore::ScrollingStateTree::attachNode): 30 (WebCore::ScrollingStateTree::commit): 31 * page/scrolling/ScrollingStateTree.h: 32 (WebCore::ScrollingStateTree::hasNewRootStateNode): 33 * page/scrolling/ScrollingTree.cpp: 34 (WebCore::ScrollingTree::commitNewTreeState): 35 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 36 (WebCore::ScrollingCoordinatorMac::commitTreeState): 37 * platform/graphics/ca/mac/TileController.mm: 38 (-[WebTiledScrollingIndicatorLayer init]): Turn off borderColor implicit animations. 39 1 40 2013-06-13 Peter Gal <galpeter@inf.u-szeged.hu> 2 41 -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
r148298 r151581 42 42 ScrollingStateTree::ScrollingStateTree() 43 43 : m_hasChangedProperties(false) 44 , m_hasNewRootStateNode(false) 44 45 { 45 46 } … … 71 72 setRootStateNode(ScrollingStateScrollingNode::create(this, newNodeID)); 72 73 newNode = rootStateNode(); 74 m_hasNewRootStateNode = true; 73 75 } else { 74 76 ScrollingStateNode* parent = stateNodeForID(parentID); … … 137 139 m_hasChangedProperties = false; 138 140 141 treeStateClone->m_hasNewRootStateNode = m_hasNewRootStateNode; 142 m_hasNewRootStateNode = false; 143 139 144 return treeStateClone.release(); 140 145 } -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.h
r148298 r151581 63 63 bool hasChangedProperties() const { return m_hasChangedProperties; } 64 64 65 bool hasNewRootStateNode() const { return m_hasNewRootStateNode; } 66 65 67 private: 66 68 ScrollingStateTree(); … … 76 78 Vector<ScrollingNodeID> m_nodesRemovedSinceLastCommit; 77 79 bool m_hasChangedProperties; 80 bool m_hasNewRootStateNode; 78 81 }; 79 82 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r147749 r151581 133 133 ASSERT(ScrollingThread::isCurrentThread()); 134 134 135 bool rootStateNodeChanged = scrollingStateTree->hasNewRootStateNode(); 136 135 137 ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode(); 136 138 if (rootNode 137 && (rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount) 139 && (rootStateNodeChanged 140 || rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount) 138 141 || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion) 139 142 || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))) { 140 143 MutexLocker lock(m_mutex); 141 144 142 if (root Node->hasChangedProperty(ScrollingStateNode::ScrollLayer))145 if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) 143 146 m_mainFrameScrollPosition = IntPoint(); 144 if (root Node->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount))147 if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)) 145 148 m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount(); 146 if (root Node->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion))149 if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion)) 147 150 m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion(); 148 151 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r150043 r151581 443 443 if (shouldUpdateScrollLayerPositionOnMainThread()) 444 444 indicatorMode = MainThreadScrollingBecauseOfStyleIndication; 445 else if ( scrollingTree() && scrollingTree()->hasWheelEventHandlers())445 else if (m_scrollingStateTree->rootStateNode()->wheelEventHandlerCount()) 446 446 indicatorMode = MainThreadScrollingBecauseOfEventHandlersIndication; 447 447 else -
trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm
r149768 r151581 64 64 65 65 _visibleRectFrameLayer = [CALayer layer]; 66 [_visibleRectFrameLayer setStyle:[NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNull null], @"bounds", [NSNull null], @"position", nil] forKey:@"actions"]];66 [_visibleRectFrameLayer setStyle:[NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNull null], @"bounds", [NSNull null], @"position", [NSNull null], @"borderColor", nil] forKey:@"actions"]]; 67 67 [self addSublayer:_visibleRectFrameLayer]; 68 68 [_visibleRectFrameLayer setBorderColor:WebCore::cachedCGColor(WebCore::Color(255, 0, 0), WebCore::ColorSpaceDeviceRGB)];
Note: See TracChangeset
for help on using the changeset viewer.