Changeset 141704 in webkit
- Timestamp:
- Feb 2, 2013 1:04:52 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141703 r141704 1 2013-02-02 Simon Fraser <simon.fraser@apple.com> 2 3 Clean up the storage of dirty bits on nodes in the scrolling state tree 4 https://bugs.webkit.org/show_bug.cgi?id=108744 5 6 Reviewed by Sam Weinig. 7 8 ScrollingStateNode and its subclasses used different techniques for 9 tracking which properties changed. ScrollingStateNode tracked its layers 10 via a bool member and some layer-specific methods, but also had virtual 11 methods to allow subclasses to track properties via a bit mask. 12 13 Clean this up by having the base class store the bit mask, and use 14 enums to specify bits for the various properties. All properties are thus 15 tracked in the same way. Bits are read and written through non-virtual member 16 functions on ScrollingStateNode. All bit checking is done via hasChangedProperty(). 17 18 * page/scrolling/ScrollingStateFixedNode.cpp: 19 (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode): m_changedProperties is now on the base class. 20 (WebCore::ScrollingStateFixedNode::updateConstraints): Use setPropertyChanged() 21 * page/scrolling/ScrollingStateFixedNode.h: Remove overrides that are no longer needed. 22 * page/scrolling/ScrollingStateNode.cpp: 23 (WebCore::ScrollingStateNode::ScrollingStateNode): Initialize m_changedProperties, 24 m_scrollLayerDidChange no longer tracked separately. 25 (WebCore::ScrollingStateNode::cloneAndReset): 26 * page/scrolling/ScrollingStateNode.h: 27 (WebCore::ScrollingStateNode::hasChangedProperties): 28 (WebCore::ScrollingStateNode::hasChangedProperty): Tests the bit. 29 (WebCore::ScrollingStateNode::resetChangedProperties): Set all bits to 0. 30 (WebCore::ScrollingStateNode::setPropertyChanged): Set the bit. 31 (WebCore::ScrollingStateNode::changedProperties): Private to discourage incorrect usage 32 (changeProperties() & foo). 33 * page/scrolling/ScrollingStateScrollingNode.cpp: 34 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): Base class does the copying now. 35 (WebCore::ScrollingStateScrollingNode::setViewportRect): Use setPropertyChanged(). 36 (WebCore::ScrollingStateScrollingNode::setContentsSize): Ditto. 37 (WebCore::ScrollingStateScrollingNode::setFrameScaleFactor): Etc. 38 (WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion): 39 (WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount): 40 (WebCore::ScrollingStateScrollingNode::setShouldUpdateScrollLayerPositionOnMainThread): 41 (WebCore::ScrollingStateScrollingNode::setHorizontalScrollElasticity): 42 (WebCore::ScrollingStateScrollingNode::setVerticalScrollElasticity): 43 (WebCore::ScrollingStateScrollingNode::setHasEnabledHorizontalScrollbar): 44 (WebCore::ScrollingStateScrollingNode::setHasEnabledVerticalScrollbar): 45 (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarMode): 46 (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarMode): 47 (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition): 48 (WebCore::ScrollingStateScrollingNode::setScrollOrigin): 49 * page/scrolling/ScrollingStateScrollingNode.h: 50 (ScrollingStateScrollingNode): 51 * page/scrolling/ScrollingStateStickyNode.cpp: 52 (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode): 53 (WebCore::ScrollingStateStickyNode::updateConstraints): 54 * page/scrolling/ScrollingStateStickyNode.h: 55 * page/scrolling/ScrollingTree.cpp: 56 (WebCore::ScrollingTree::commitNewTreeState): 57 * page/scrolling/ScrollingTreeScrollingNode.cpp: 58 (WebCore::ScrollingTreeScrollingNode::update): 59 * page/scrolling/mac/ScrollingStateNodeMac.mm: 60 (WebCore::ScrollingStateNode::setScrollLayer): 61 * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: 62 (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer): 63 * page/scrolling/mac/ScrollingTreeFixedNode.mm: 64 (WebCore::ScrollingTreeFixedNode::update): 65 * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm: 66 (WebCore::ScrollingTreeScrollingNodeMac::update): 67 * page/scrolling/mac/ScrollingTreeStickyNode.mm: 68 (WebCore::ScrollingTreeStickyNode::update): 69 1 70 2013-02-02 Simon Fraser <simon.fraser@apple.com> 2 71 -
trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp
r138076 r141704 43 43 ScrollingStateFixedNode::ScrollingStateFixedNode(ScrollingStateTree* tree, ScrollingNodeID nodeID) 44 44 : ScrollingStateNode(tree, nodeID) 45 , m_changedProperties(0)46 45 { 47 46 } … … 50 49 : ScrollingStateNode(node) 51 50 , m_constraints(FixedPositionViewportConstraints(node.viewportConstraints())) 52 , m_changedProperties(node.changedProperties())53 51 { 54 52 } … … 69 67 70 68 m_constraints = constraints; 71 m_changedProperties = ViewportConstraints;69 setPropertyChanged(ViewportConstraints); 72 70 m_scrollingStateTree->setHasChangedProperties(true); 73 71 } -
trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h
r141516 r141704 46 46 virtual ~ScrollingStateFixedNode(); 47 47 48 enum ChangedPropertyForFixed{49 ViewportConstraints = 1 << 048 enum { 49 ViewportConstraints = NumStateNodeBits 50 50 }; 51 52 virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }53 51 54 52 void updateConstraints(const FixedPositionViewportConstraints&); … … 61 59 virtual bool isFixedNode() OVERRIDE { return true; } 62 60 63 virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }64 virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }65 61 virtual void syncLayerPositionForViewportRect(const LayoutRect& viewportRect) OVERRIDE; 66 62 … … 68 64 69 65 FixedPositionViewportConstraints m_constraints; 70 unsigned m_changedProperties;71 66 }; 72 67 -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
r140223 r141704 40 40 : m_scrollingStateTree(scrollingStateTree) 41 41 , m_nodeID(nodeID) 42 , m_changedProperties(0) 42 43 , m_parent(0) 43 , m_scrollLayerDidChange(false)44 44 { 45 45 } … … 51 51 : m_scrollingStateTree(0) 52 52 , m_nodeID(stateNode.scrollingNodeID()) 53 , m_changedProperties(stateNode.changedProperties()) 53 54 , m_parent(0) 54 , m_scrollLayerDidChange(stateNode.scrollLayerDidChange())55 55 { 56 56 // FIXME: why doesn't this set the GraphicsLayer? … … 67 67 68 68 // Now that this node is cloned, reset our change properties. 69 setScrollLayerDidChange(false);70 69 resetChangedProperties(); 71 70 -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r140223 r141704 58 58 void cloneAndResetChildren(ScrollingStateNode*); 59 59 60 virtual bool hasChangedProperties() const = 0; 61 virtual unsigned changedProperties() const = 0; 62 virtual void resetChangedProperties() = 0; 63 virtual void setHasChangedProperties() { setScrollLayerDidChange(true); } 60 enum { 61 ScrollLayer = 0, 62 NumStateNodeBits = 1 63 }; 64 typedef unsigned ChangedProperties; 65 66 bool hasChangedProperties() const { return m_changedProperties; } 67 bool hasChangedProperty(unsigned propertyBit) { return m_changedProperties & (1 << propertyBit); } 68 void resetChangedProperties() { m_changedProperties = 0; } 69 void setPropertyChanged(unsigned propertyBit) { m_changedProperties |= (1 << propertyBit); } 64 70 65 71 virtual void syncLayerPositionForViewportRect(const LayoutRect& /*viewportRect*/) { } … … 69 75 void setScrollLayer(GraphicsLayer*); 70 76 void setScrollPlatformLayer(PlatformLayer*); 71 72 bool scrollLayerDidChange() const { return m_scrollLayerDidChange; }73 void setScrollLayerDidChange(bool scrollLayerDidChange) { m_scrollLayerDidChange = scrollLayerDidChange; }74 77 75 78 ScrollingStateTree* scrollingStateTree() const { return m_scrollingStateTree; } … … 99 102 100 103 virtual void dumpProperties(TextStream&, int indent) const = 0; 104 ChangedProperties changedProperties() const { return m_changedProperties; } 101 105 102 106 ScrollingNodeID m_nodeID; 107 ChangedProperties m_changedProperties; 103 108 104 109 ScrollingStateNode* m_parent; 105 110 OwnPtr<Vector<OwnPtr<ScrollingStateNode> > > m_children; 106 107 bool m_scrollLayerDidChange;108 111 109 112 #if PLATFORM(MAC) -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r140223 r141704 42 42 ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree* stateTree, ScrollingNodeID nodeID) 43 43 : ScrollingStateNode(stateTree, nodeID) 44 , m_changedProperties(0)45 44 , m_counterScrollingLayer(0) 46 45 , m_frameScaleFactor(1) … … 52 51 , m_hasEnabledVerticalScrollbar(false) 53 52 , m_requestedScrollPositionRepresentsProgrammaticScroll(false) 54 , m_counterScrollingLayerDidChange(false)55 53 , m_horizontalScrollbarMode(ScrollbarAuto) 56 54 , m_verticalScrollbarMode(ScrollbarAuto) … … 60 58 ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScrollingNode& stateNode) 61 59 : ScrollingStateNode(stateNode) 62 , m_changedProperties(stateNode.changedProperties())63 60 , m_viewportRect(stateNode.viewportRect()) 64 61 , m_contentsSize(stateNode.contentsSize()) … … 72 69 , m_hasEnabledVerticalScrollbar(stateNode.hasEnabledVerticalScrollbar()) 73 70 , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll()) 74 , m_counterScrollingLayerDidChange(stateNode.counterScrollingLayerDidChange())75 71 , m_horizontalScrollbarMode(stateNode.horizontalScrollbarMode()) 76 72 , m_verticalScrollbarMode(stateNode.verticalScrollbarMode()) … … 96 92 97 93 m_viewportRect = viewportRect; 98 m_changedProperties |= ViewportRect;94 setPropertyChanged(ViewportRect); 99 95 m_scrollingStateTree->setHasChangedProperties(true); 100 96 } … … 106 102 107 103 m_contentsSize = contentsSize; 108 m_changedProperties |= ContentsSize;104 setPropertyChanged(ContentsSize); 109 105 m_scrollingStateTree->setHasChangedProperties(true); 110 106 } … … 117 113 m_frameScaleFactor = scaleFactor; 118 114 119 m_changedProperties |= FrameScaleFactor;115 setPropertyChanged(FrameScaleFactor); 120 116 m_scrollingStateTree->setHasChangedProperties(true); 121 117 } … … 127 123 128 124 m_nonFastScrollableRegion = nonFastScrollableRegion; 129 m_changedProperties |= NonFastScrollableRegion;125 setPropertyChanged(NonFastScrollableRegion); 130 126 m_scrollingStateTree->setHasChangedProperties(true); 131 127 } … … 137 133 138 134 m_wheelEventHandlerCount = wheelEventHandlerCount; 139 m_changedProperties |= WheelEventHandlerCount;135 setPropertyChanged(WheelEventHandlerCount); 140 136 m_scrollingStateTree->setHasChangedProperties(true); 141 137 } … … 147 143 148 144 m_shouldUpdateScrollLayerPositionOnMainThread = reasons; 149 m_changedProperties |= ShouldUpdateScrollLayerPositionOnMainThread;145 setPropertyChanged(ShouldUpdateScrollLayerPositionOnMainThread); 150 146 m_scrollingStateTree->setHasChangedProperties(true); 151 147 } … … 157 153 158 154 m_horizontalScrollElasticity = horizontalScrollElasticity; 159 m_changedProperties |= HorizontalScrollElasticity;155 setPropertyChanged(HorizontalScrollElasticity); 160 156 m_scrollingStateTree->setHasChangedProperties(true); 161 157 } … … 167 163 168 164 m_verticalScrollElasticity = verticalScrollElasticity; 169 m_changedProperties |= VerticalScrollElasticity;165 setPropertyChanged(VerticalScrollElasticity); 170 166 m_scrollingStateTree->setHasChangedProperties(true); 171 167 } … … 177 173 178 174 m_hasEnabledHorizontalScrollbar = hasEnabledHorizontalScrollbar; 179 m_changedProperties |= HasEnabledHorizontalScrollbar;175 setPropertyChanged(HasEnabledHorizontalScrollbar); 180 176 m_scrollingStateTree->setHasChangedProperties(true); 181 177 } … … 187 183 188 184 m_hasEnabledVerticalScrollbar = hasEnabledVerticalScrollbar; 189 m_changedProperties |= HasEnabledVerticalScrollbar;185 setPropertyChanged(HasEnabledVerticalScrollbar); 190 186 m_scrollingStateTree->setHasChangedProperties(true); 191 187 } … … 197 193 198 194 m_horizontalScrollbarMode = horizontalScrollbarMode; 199 m_changedProperties |= HorizontalScrollbarMode;195 setPropertyChanged(HorizontalScrollbarMode); 200 196 m_scrollingStateTree->setHasChangedProperties(true); 201 197 } … … 207 203 208 204 m_verticalScrollbarMode = verticalScrollbarMode; 209 m_changedProperties |= VerticalScrollbarMode;205 setPropertyChanged(VerticalScrollbarMode); 210 206 m_scrollingStateTree->setHasChangedProperties(true); 211 207 } … … 215 211 m_requestedScrollPosition = requestedScrollPosition; 216 212 m_requestedScrollPositionRepresentsProgrammaticScroll = representsProgrammaticScroll; 217 m_changedProperties |= RequestedScrollPosition;213 setPropertyChanged(RequestedScrollPosition); 218 214 m_scrollingStateTree->setHasChangedProperties(true); 219 215 } … … 225 221 226 222 m_scrollOrigin = scrollOrigin; 227 m_changedProperties |= ScrollOrigin;223 setPropertyChanged(ScrollOrigin); 228 224 m_scrollingStateTree->setHasChangedProperties(true); 229 225 } -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r141516 r141704 47 47 48 48 enum ChangedProperty { 49 ViewportRect = 1 << 0,50 ContentsSize = 1 << 1,51 FrameScaleFactor = 1 << 2,52 NonFastScrollableRegion = 1 << 3,53 WheelEventHandlerCount = 1 << 4,54 ShouldUpdateScrollLayerPositionOnMainThread = 1 << 5,55 HorizontalScrollElasticity = 1 << 6,56 VerticalScrollElasticity = 1 << 7,57 HasEnabledHorizontalScrollbar = 1 << 8,58 HasEnabledVerticalScrollbar = 1 << 9,59 HorizontalScrollbarMode = 1 << 10,60 VerticalScrollbarMode = 1 << 11,61 ScrollOrigin = 1 << 12,62 RequestedScrollPosition = 1 << 13,63 CounterScrollingLayer = 1 << 14,49 ViewportRect = NumStateNodeBits, 50 ContentsSize, 51 FrameScaleFactor, 52 NonFastScrollableRegion, 53 WheelEventHandlerCount, 54 ShouldUpdateScrollLayerPositionOnMainThread, 55 HorizontalScrollElasticity, 56 VerticalScrollElasticity, 57 HasEnabledHorizontalScrollbar, 58 HasEnabledVerticalScrollbar, 59 HorizontalScrollbarMode, 60 VerticalScrollbarMode, 61 ScrollOrigin, 62 RequestedScrollPosition, 63 CounterScrollingLayer 64 64 }; 65 65 66 66 virtual bool isScrollingNode() OVERRIDE { return true; } 67 68 virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }69 virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }70 virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }71 67 72 68 const IntRect& viewportRect() const { return m_viewportRect; } … … 117 113 PlatformLayer* counterScrollingPlatformLayer() const; 118 114 119 bool counterScrollingLayerDidChange() const { return m_counterScrollingLayerDidChange; }120 121 115 bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; } 122 116 … … 126 120 ScrollingStateScrollingNode(ScrollingStateTree*, ScrollingNodeID); 127 121 ScrollingStateScrollingNode(const ScrollingStateScrollingNode&); 128 129 unsigned m_changedProperties;130 122 131 123 GraphicsLayer* m_counterScrollingLayer; … … 151 143 bool m_hasEnabledVerticalScrollbar; 152 144 bool m_requestedScrollPositionRepresentsProgrammaticScroll; 153 bool m_counterScrollingLayerDidChange;154 145 155 146 ScrollbarMode m_horizontalScrollbarMode; -
trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp
r138076 r141704 43 43 ScrollingStateStickyNode::ScrollingStateStickyNode(ScrollingStateTree* tree, ScrollingNodeID nodeID) 44 44 : ScrollingStateNode(tree, nodeID) 45 , m_changedProperties(0)46 45 { 47 46 } … … 50 49 : ScrollingStateNode(node) 51 50 , m_constraints(StickyPositionViewportConstraints(node.viewportConstraints())) 52 , m_changedProperties(node.changedProperties())53 51 { 54 52 } … … 69 67 70 68 m_constraints = constraints; 71 m_changedProperties = ViewportConstraints;69 setPropertyChanged(ViewportConstraints); 72 70 m_scrollingStateTree->setHasChangedProperties(true); 73 71 } -
trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h
r141516 r141704 46 46 virtual ~ScrollingStateStickyNode(); 47 47 48 enum ChangedPropertyForSticky{49 ViewportConstraints = 1 << 048 enum { 49 ViewportConstraints = NumStateNodeBits 50 50 }; 51 52 virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }53 51 54 52 void updateConstraints(const StickyPositionViewportConstraints&); … … 61 59 virtual bool isStickyNode() OVERRIDE { return true; } 62 60 63 virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }64 virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }65 61 virtual void syncLayerPositionForViewportRect(const LayoutRect& viewportRect) OVERRIDE; 66 62 … … 68 64 69 65 StickyPositionViewportConstraints m_constraints; 70 unsigned m_changedProperties;71 66 }; 72 67 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r141703 r141704 128 128 ASSERT(ScrollingThread::isCurrentThread()); 129 129 130 if (scrollingStateTree->rootStateNode()->changedProperties() & (ScrollingStateScrollingNode::WheelEventHandlerCount | ScrollingStateScrollingNode::NonFastScrollableRegion) || scrollingStateTree->rootStateNode()->scrollLayerDidChange()) { 130 ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode(); 131 if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount) || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion) || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) { 131 132 MutexLocker lock(m_mutex); 132 133 133 if ( scrollingStateTree->rootStateNode()->scrollLayerDidChange())134 if (rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) 134 135 m_mainFrameScrollPosition = IntPoint(); 135 if ( scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::WheelEventHandlerCount)136 if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)) 136 137 m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount(); 137 if ( scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::NonFastScrollableRegion)138 if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion)) 138 139 m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion(); 139 140 } 140 141 141 TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollingStateTree->rootStateNode()->requestedScrollPositionRepresentsProgrammaticScroll());142 TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, rootNode->requestedScrollPositionRepresentsProgrammaticScroll()); 142 143 143 144 removeDestroyedNodes(scrollingStateTree.get()); 144 updateTreeFromStateNode( scrollingStateTree->rootStateNode());145 updateTreeFromStateNode(rootNode); 145 146 } 146 147 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r141703 r141704 54 54 ScrollingStateScrollingNode* state = toScrollingStateScrollingNode(stateNode); 55 55 56 if (state-> changedProperties() & ScrollingStateScrollingNode::ViewportRect)56 if (state->hasChangedProperty(ScrollingStateScrollingNode::ViewportRect)) 57 57 m_viewportRect = state->viewportRect(); 58 58 59 if (state-> changedProperties() & ScrollingStateScrollingNode::ContentsSize)59 if (state->hasChangedProperty(ScrollingStateScrollingNode::ContentsSize)) 60 60 m_contentsSize = state->contentsSize(); 61 61 62 if (state-> changedProperties() & ScrollingStateScrollingNode::FrameScaleFactor)62 if (state->hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor)) 63 63 m_frameScaleFactor = state->frameScaleFactor(); 64 64 65 if (state-> changedProperties() & ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)65 if (state->hasChangedProperty(ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)) 66 66 m_shouldUpdateScrollLayerPositionOnMainThread = state->shouldUpdateScrollLayerPositionOnMainThread(); 67 67 68 if (state-> changedProperties() & ScrollingStateScrollingNode::HorizontalScrollElasticity)68 if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollElasticity)) 69 69 m_horizontalScrollElasticity = state->horizontalScrollElasticity(); 70 70 71 if (state-> changedProperties() & ScrollingStateScrollingNode::VerticalScrollElasticity)71 if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollElasticity)) 72 72 m_verticalScrollElasticity = state->verticalScrollElasticity(); 73 73 74 if (state-> changedProperties() & ScrollingStateScrollingNode::HasEnabledHorizontalScrollbar)74 if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledHorizontalScrollbar)) 75 75 m_hasEnabledHorizontalScrollbar = state->hasEnabledHorizontalScrollbar(); 76 76 77 if (state-> changedProperties() & ScrollingStateScrollingNode::HasEnabledVerticalScrollbar)77 if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledVerticalScrollbar)) 78 78 m_hasEnabledVerticalScrollbar = state->hasEnabledVerticalScrollbar(); 79 79 80 if (state-> changedProperties() & ScrollingStateScrollingNode::HorizontalScrollbarMode)80 if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollbarMode)) 81 81 m_horizontalScrollbarMode = state->horizontalScrollbarMode(); 82 82 83 if (state-> changedProperties() & ScrollingStateScrollingNode::VerticalScrollbarMode)83 if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollbarMode)) 84 84 m_verticalScrollbarMode = state->verticalScrollbarMode(); 85 85 86 if (state-> changedProperties() & ScrollingStateScrollingNode::ScrollOrigin)86 if (state->hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin)) 87 87 m_scrollOrigin = state->scrollOrigin(); 88 88 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingStateNodeMac.mm
r140223 r141704 54 54 m_graphicsLayer = graphicsLayer; 55 55 56 m_scrollLayerDidChange = true;56 setPropertyChanged(ScrollLayer); 57 57 m_scrollingStateTree->setHasChangedProperties(true); 58 58 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm
r140223 r141704 48 48 m_counterScrollingLayer = graphicsLayer; 49 49 50 m_counterScrollingLayerDidChange = true;50 setPropertyChanged(CounterScrollingLayer); 51 51 if (m_scrollingStateTree) 52 52 m_scrollingStateTree->setHasChangedProperties(true); -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm
r141703 r141704 50 50 void ScrollingTreeFixedNode::update(ScrollingStateNode* stateNode) 51 51 { 52 ScrollingStateFixedNode* state = toScrollingStateFixedNode(stateNode);52 ScrollingStateFixedNode* fixedStateNode = toScrollingStateFixedNode(stateNode); 53 53 54 if ( state->scrollLayerDidChange())55 m_layer = state->platformScrollLayer();54 if (fixedStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) 55 m_layer = fixedStateNode->platformScrollLayer(); 56 56 57 if (stateNode-> changedProperties() & ScrollingStateFixedNode::ViewportConstraints)58 m_constraints = state->viewportConstraints();57 if (stateNode->hasChangedProperty(ScrollingStateFixedNode::ViewportConstraints)) 58 m_constraints = fixedStateNode->viewportConstraints(); 59 59 } 60 60 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
r141703 r141704 69 69 { 70 70 ScrollingTreeScrollingNode::update(stateNode); 71 ScrollingStateScrollingNode* s tate = toScrollingStateScrollingNode(stateNode);72 73 if (s tate->scrollLayerDidChange())74 m_scrollLayer = s tate->platformScrollLayer();75 76 if (s tate->counterScrollingLayerDidChange())77 m_counterScrollingLayer = s tate->counterScrollingPlatformLayer();78 79 if (s tate->changedProperties() & ScrollingStateScrollingNode::RequestedScrollPosition)80 setScrollPosition(s tate->requestedScrollPosition());81 82 if (s tate->scrollLayerDidChange() || state->changedProperties() & (ScrollingStateScrollingNode::ContentsSize |ScrollingStateScrollingNode::ViewportRect))71 ScrollingStateScrollingNode* scrollingStateNode = toScrollingStateScrollingNode(stateNode); 72 73 if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) 74 m_scrollLayer = scrollingStateNode->platformScrollLayer(); 75 76 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) 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 83 updateMainFramePinState(scrollPosition()); 84 84 85 if ( (state->changedProperties() &ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)) {85 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)) { 86 86 unsigned mainThreadScrollingReasons = this->shouldUpdateScrollLayerPositionOnMainThread(); 87 87 … … 89 89 // We're transitioning to the slow "update scroll layer position on the main thread" mode. 90 90 // Initialize the probable main thread scroll position with the current scroll layer position. 91 if (s tate->changedProperties() & ScrollingStateScrollingNode::RequestedScrollPosition)92 m_probableMainThreadScrollPosition = s tate->requestedScrollPosition();91 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) 92 m_probableMainThreadScrollPosition = scrollingStateNode->requestedScrollPosition(); 93 93 else { 94 94 CGPoint scrollLayerPosition = m_scrollLayer.get().position; … … 101 101 } 102 102 103 if ( (state->changedProperties() &ScrollingStateScrollingNode::WheelEventHandlerCount)) {103 if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)) { 104 104 if (scrollingTree()->scrollingPerformanceLoggingEnabled()) 105 logWheelEventHandlerCountChanged(s tate->wheelEventHandlerCount());105 logWheelEventHandlerCountChanged(scrollingStateNode->wheelEventHandlerCount()); 106 106 } 107 107 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm
r141703 r141704 50 50 void ScrollingTreeStickyNode::update(ScrollingStateNode* stateNode) 51 51 { 52 ScrollingStateStickyNode* st ate = toScrollingStateStickyNode(stateNode);52 ScrollingStateStickyNode* stickyStateNode = toScrollingStateStickyNode(stateNode); 53 53 54 if (st ate->scrollLayerDidChange())55 m_layer = st ate->platformScrollLayer();54 if (stickyStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) 55 m_layer = stickyStateNode->platformScrollLayer(); 56 56 57 if (stateNode-> changedProperties() & ScrollingStateStickyNode::ViewportConstraints)58 m_constraints = st ate->viewportConstraints();57 if (stateNode->hasChangedProperty(ScrollingStateStickyNode::ViewportConstraints)) 58 m_constraints = stickyStateNode->viewportConstraints(); 59 59 } 60 60
Note: See TracChangeset
for help on using the changeset viewer.