Changeset 219137 in webkit
- Timestamp:
- Jul 5, 2017 10:56:11 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r219130 r219137 1 2017-07-05 Frederic Wang <fwang@igalia.com> 2 3 Move ScrolledContentsLayer property to ScrollingStateScrollingNode 4 https://bugs.webkit.org/show_bug.cgi?id=174134 5 6 Reviewed by Simon Fraser. 7 8 ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode both use a 9 ScrolledContentsLayer property for the same purpose. This commit moves that property into 10 their parent class ScrollingStateScrollingNode, so that more code is shared between the two 11 classes. This will also help the refactoring in bug 174130. 12 13 No new tests, only dumped tree may change a bit. 14 15 * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Remove scrolled contents layer. 16 (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): 17 (WebCore::ScrollingStateFrameScrollingNode::dumpProperties): 18 (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer): Deleted. 19 * page/scrolling/ScrollingStateFrameScrollingNode.h: Ditto. 20 * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Ditto. 21 (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode): 22 (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties): 23 (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer): Deleted. 24 * page/scrolling/ScrollingStateOverflowScrollingNode.h: Ditto. 25 (): Deleted. 26 (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer): Deleted. 27 * page/scrolling/ScrollingStateScrollingNode.cpp: Add scrolled contents layer. 28 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): 29 (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer): 30 (WebCore::ScrollingStateScrollingNode::dumpProperties): Use the label from the overflow class 31 which is different from the frame class. The dumping order may change a bit too. 32 * page/scrolling/ScrollingStateScrollingNode.h: Add ScrolledContentsLayer to the enum and 33 scrolled contents layer. 34 (WebCore::ScrollingStateScrollingNode::scrolledContentsLayer): 35 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: 36 (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): Adjust enum value 37 to use ScrollingStateScrollingNode::ScrolledContentsLayer. 38 1 39 2017-07-05 Emilio Cobos Álvarez <ecobos@igalia.com> 2 40 -
trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
r216511 r219137 65 65 , m_visualViewportEnabled(stateNode.visualViewportEnabled()) 66 66 { 67 if (hasChangedProperty(ScrolledContentsLayer))68 setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));69 70 67 if (hasChangedProperty(CounterScrollingLayer)) 71 68 setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); … … 182 179 m_topContentInset = topContentInset; 183 180 setPropertyChanged(TopContentInset); 184 }185 186 void ScrollingStateFrameScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)187 {188 if (layerRepresentation == m_scrolledContentsLayer)189 return;190 191 m_scrolledContentsLayer = layerRepresentation;192 setPropertyChanged(ScrolledContentsLayer);193 181 } 194 182 … … 272 260 ts.dumpProperty("counter scrolling layer ID", m_counterScrollingLayer.layerID()); 273 261 ts.dumpProperty("inset clip layer ID", m_insetClipLayer.layerID()); 274 ts.dumpProperty("scrolled contents layer ID", m_scrolledContentsLayer.layerID());275 262 ts.dumpProperty("content shadow layer ID", m_contentShadowLayer.layerID()); 276 263 ts.dumpProperty("header layer ID", m_headerLayer.layerID()); -
trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h
r216478 r219137 98 98 WEBCORE_EXPORT void setTopContentInset(float); 99 99 100 const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }101 WEBCORE_EXPORT void setScrolledContentsLayer(const LayerRepresentation&);102 103 100 // This is a layer moved in the opposite direction to scrolling, for example for background-attachment:fixed 104 101 const LayerRepresentation& counterScrollingLayer() const { return m_counterScrollingLayer; } … … 143 140 LayerRepresentation m_counterScrollingLayer; 144 141 LayerRepresentation m_insetClipLayer; 145 LayerRepresentation m_scrolledContentsLayer;146 142 LayerRepresentation m_contentShadowLayer; 147 143 LayerRepresentation m_headerLayer; -
trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp
r216478 r219137 47 47 : ScrollingStateScrollingNode(stateNode, adoptiveTree) 48 48 { 49 if (hasChangedProperty(ScrolledContentsLayer))50 setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));51 49 } 52 50 … … 60 58 } 61 59 62 void ScrollingStateOverflowScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)63 {64 if (layerRepresentation == m_scrolledContentsLayer)65 return;66 67 m_scrolledContentsLayer = layerRepresentation;68 setPropertyChanged(ScrolledContentsLayer);69 }70 71 60 void ScrollingStateOverflowScrollingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const 72 61 { … … 74 63 75 64 ScrollingStateScrollingNode::dumpProperties(ts, behavior); 76 77 if ((behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerIDs) && m_scrolledContentsLayer.layerID())78 ts.dumpProperty("scrolled contents layer", m_scrolledContentsLayer.layerID());79 65 } 80 66 -
trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h
r216478 r219137 40 40 virtual ~ScrollingStateOverflowScrollingNode(); 41 41 42 enum ChangedProperty {43 ScrolledContentsLayer = NumScrollingStateNodeBits44 };45 46 // This is a layer with the contents that move.47 const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }48 WEBCORE_EXPORT void setScrolledContentsLayer(const LayerRepresentation&);49 50 42 void dumpProperties(TextStream&, ScrollingStateTreeAsTextBehavior) const override; 51 43 … … 53 45 ScrollingStateOverflowScrollingNode(ScrollingStateTree&, ScrollingNodeID); 54 46 ScrollingStateOverflowScrollingNode(const ScrollingStateOverflowScrollingNode&, ScrollingStateTree&); 55 56 LayerRepresentation m_scrolledContentsLayer;57 47 }; 58 48 -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r216511 r219137 54 54 , m_expectsWheelEventTestTrigger(stateNode.expectsWheelEventTestTrigger()) 55 55 { 56 if (hasChangedProperty(ScrolledContentsLayer)) 57 setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); 56 58 } 57 59 … … 186 188 } 187 189 190 void ScrollingStateScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation) 191 { 192 if (layerRepresentation == m_scrolledContentsLayer) 193 return; 194 195 m_scrolledContentsLayer = layerRepresentation; 196 setPropertyChanged(ScrolledContentsLayer); 197 } 198 188 199 void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const 189 200 { … … 244 255 if (m_expectsWheelEventTestTrigger) 245 256 ts.dumpProperty("expects wheel event test trigger", m_expectsWheelEventTestTrigger); 257 258 if ((behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerIDs) && m_scrolledContentsLayer.layerID()) 259 ts.dumpProperty("scrolled contents layer", m_scrolledContentsLayer.layerID()); 246 260 } 247 261 -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r217610 r219137 56 56 #endif 57 57 ExpectsWheelEventTestTrigger, 58 ScrolledContentsLayer, 58 59 NumScrollingStateNodeBits // This must remain at the last position. 59 60 }; … … 104 105 WEBCORE_EXPORT void setExpectsWheelEventTestTrigger(bool); 105 106 107 // This is a layer with the contents that move. 108 const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; } 109 WEBCORE_EXPORT void setScrolledContentsLayer(const LayerRepresentation&); 110 106 111 protected: 107 112 ScrollingStateScrollingNode(ScrollingStateTree&, ScrollingNodeType, ScrollingNodeID); … … 123 128 #endif 124 129 ScrollableAreaParameters m_scrollableAreaParameters; 130 LayerRepresentation m_scrolledContentsLayer; 125 131 bool m_requestedScrollPositionRepresentsProgrammaticScroll { false }; 126 132 bool m_expectsWheelEventTestTrigger { false }; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
r217737 r219137 107 107 m_scrollLayer = scrollingStateNode.layer(); 108 108 109 if (scrollingStateNode.hasChangedProperty(ScrollingState FrameScrollingNode::ScrolledContentsLayer))109 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 110 110 m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer(); 111 111 -
trunk/Source/WebKit2/ChangeLog
r219136 r219137 1 2017-07-05 Frederic Wang <fwang@igalia.com> 2 3 Move ScrolledContentsLayer property to ScrollingStateScrollingNode 4 https://bugs.webkit.org/show_bug.cgi?id=174134 5 6 Reviewed by Simon Fraser. 7 8 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: 9 (ArgumentCoder<ScrollingStateScrollingNode>::encode): Add encoding for scrolled contents 10 layer. 11 (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): Remove encoding for scrolled 12 contents layer. 13 (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode): Ditto. 14 (ArgumentCoder<ScrollingStateScrollingNode>::decode): Add decoding for scrolled contents 15 layer. 16 (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): Remove decoding for scrolled 17 contents layer. 18 (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode): Ditto. 19 (WebKit::dump): Move dumping of scrolled contents layer from overflow/frame nodes to 20 scrolling node. 21 * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: 22 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Adjust enum value to use 23 ScrollingStateScrollingNode::ScrolledContentsLayer. 24 * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: 25 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto. 26 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: 27 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto. 28 1 29 2017-07-05 Ada Chan <adachan@apple.com> 2 30 -
trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp
r210560 r219137 136 136 SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPosition) 137 137 SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll) 138 139 if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 140 encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()); 138 141 } 139 142 … … 155 158 SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::MaxLayoutViewportOrigin, maxLayoutViewportOrigin) 156 159 157 if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))158 encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());159 160 160 if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) 161 161 encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer()); … … 171 171 { 172 172 encoder << static_cast<const ScrollingStateScrollingNode&>(node); 173 174 if (node.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))175 encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());176 173 } 177 174 … … 224 221 } 225 222 223 if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) { 224 GraphicsLayer::PlatformLayerID layerID; 225 if (!decoder.decode(layerID)) 226 return false; 227 node.setScrolledContentsLayer(layerID); 228 } 229 226 230 return true; 227 231 } … … 246 250 SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::MaxLayoutViewportOrigin, FloatPoint, setMaxLayoutViewportOrigin) 247 251 248 if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer)) {249 GraphicsLayer::PlatformLayerID layerID;250 if (!decoder.decode(layerID))251 return false;252 node.setScrolledContentsLayer(layerID);253 }254 255 252 if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) { 256 253 GraphicsLayer::PlatformLayerID layerID; … … 281 278 if (!decoder.decode(static_cast<ScrollingStateScrollingNode&>(node))) 282 279 return false; 283 284 if (node.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer)) {285 GraphicsLayer::PlatformLayerID layerID;286 if (!decoder.decode(layerID))287 return false;288 node.setScrolledContentsLayer(layerID);289 }290 280 291 281 return true; … … 484 474 ts.dumpProperty("requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll()); 485 475 } 476 477 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 478 ts.dumpProperty("scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer())); 486 479 } 487 480 … … 531 524 ts.dumpProperty("frame-scale-factor", node.frameScaleFactor()); 532 525 533 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))534 ts.dumpProperty("scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));535 536 526 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) 537 527 ts.dumpProperty("clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer())); … … 550 540 { 551 541 dump(ts, static_cast<const ScrollingStateScrollingNode&>(node), changedPropertiesOnly); 552 553 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))554 ts.dumpProperty("scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));555 542 } 556 543 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
r208985 r219137 107 107 ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode); 108 108 109 if (scrollingStateNode.hasChangedProperty(ScrollingState FrameScrollingNode::ScrolledContentsLayer))109 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 110 110 scrollingStateNode.setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer())); 111 111 … … 130 130 ScrollingStateOverflowScrollingNode& scrollingStateNode = downcast<ScrollingStateOverflowScrollingNode>(*currNode); 131 131 132 if (scrollingStateNode.hasChangedProperty(ScrollingState OverflowScrollingNode::ScrolledContentsLayer))132 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 133 133 scrollingStateNode.setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer())); 134 134 break; -
trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
r210560 r219137 173 173 m_scrollLayer = scrollingStateNode.layer(); 174 174 175 if (scrollingStateNode.hasChangedProperty(ScrollingState OverflowScrollingNode::ScrolledContentsLayer))175 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 176 176 m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer(); 177 177 } -
trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm
r216352 r219137 64 64 scrollingStateNode.setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.layer()))); 65 65 66 if (scrollingStateNode.hasChangedProperty(ScrollingState OverflowScrollingNode::ScrolledContentsLayer))66 if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 67 67 scrollingStateNode.setScrolledContentsLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer()))); 68 68 break;
Note: See TracChangeset
for help on using the changeset viewer.