void EventPath::buildRelatedNodeMap(const Node& relatedNode, RelatedTargetMap& relatedTargetMap) { EventPath relatedTargetEventPath(const_cast<Node&>(relatedNode)); for (size_t i = 0; i < relatedTargetEventPath.m_treeScopeEventContexts.size(); ++i) { TreeScopeEventContext* treeScopeEventContext = relatedTargetEventPath.m_treeScopeEventContexts[i].get(); relatedTargetMap.add(&treeScopeEventContext->treeScope(), treeScopeEventContext->target()); } }
void EventPath::buildRelatedNodeMap(const Node* relatedNode, RelatedTargetMap& relatedTargetMap) { TreeScope* lastTreeScope = 0; EventPath eventPath(const_cast<Node*>(relatedNode)); for (size_t i = 0; i < eventPath.size(); ++i) { TreeScope* treeScope = &eventPath[i].node()->treeScope(); if (treeScope != lastTreeScope) relatedTargetMap.add(treeScope, eventPath[i].target()); lastTreeScope = treeScope; } }
void EventPath::buildRelatedNodeMap(const Node& relatedNode, RelatedTargetMap& relatedTargetMap) { OwnPtrWillBeRawPtr<EventPath> relatedTargetEventPath = adoptPtrWillBeNoop(new EventPath(const_cast<Node&>(relatedNode))); for (size_t i = 0; i < relatedTargetEventPath->m_treeScopeEventContexts.size(); ++i) { TreeScopeEventContext* treeScopeEventContext = relatedTargetEventPath->m_treeScopeEventContexts[i].get(); relatedTargetMap.add(&treeScopeEventContext->treeScope(), treeScopeEventContext->target()); } #if ENABLE(OILPAN) // Oilpan: It is important to explicitly clear the vectors to reuse // the memory in subsequent event dispatchings. relatedTargetEventPath->clear(); #endif }