コード例 #1
0
void ScrollingTree::setOrClearLatchedNode(const PlatformWheelEvent& wheelEvent, ScrollingNodeID nodeID)
{
    if (wheelEvent.shouldConsiderLatching())
        setLatchedNode(nodeID);
    else if (wheelEvent.shouldResetLatching())
        clearLatchedNode();
}
コード例 #2
0
ファイル: ScrollingTree.cpp プロジェクト: cheekiatng/webkit
void ScrollingTree::removeDestroyedNodes(const ScrollingStateTree& stateTree)
{
    for (const auto& removedNodeID : stateTree.removedNodes()) {
        m_nodeMap.remove(removedNodeID);
        if (removedNodeID == m_latchedNode)
            clearLatchedNode();
    }
}
コード例 #3
0
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);
    }
}