void RemoteScrollingTreeTextStream::dump(const ScrollingStateTree& stateTree, bool changedPropertiesOnly) { RemoteScrollingTreeTextStream& ts = *this; dumpProperty(ts, "has changed properties", stateTree.hasChangedProperties()); dumpProperty(ts, "has new root node", stateTree.hasNewRootStateNode()); if (stateTree.rootStateNode()) recursiveDumpNodes(*stateTree.rootStateNode(), changedPropertiesOnly); if (!stateTree.removedNodes().isEmpty()) dumpProperty<Vector<ScrollingNodeID>>(ts, "removed-nodes", stateTree.removedNodes()); }
void ScrollingTree::removeDestroyedNodes(const ScrollingStateTree& stateTree) { for (const auto& removedNodeID : stateTree.removedNodes()) { m_nodeMap.remove(removedNodeID); if (removedNodeID == m_latchedNode) clearLatchedNode(); } }
void ScrollingTree::removeDestroyedNodes(const ScrollingStateTree& stateTree) { for (const auto& removedNode : stateTree.removedNodes()) { ScrollingTreeNode* node = m_nodeMap.take(removedNode); if (!node) continue; if (node->scrollingNodeID() == m_latchedNode) clearLatchedNode(); // Never destroy the root node. There will be a new root node in the state tree, and we will // associate it with our existing root node in updateTreeFromStateNode(). if (node->parent()) m_rootNode->removeChild(node); } }