本文整理汇总了C++中NodeVector::append方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeVector::append方法的具体用法?C++ NodeVector::append怎么用?C++ NodeVector::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeVector
的用法示例。
在下文中一共展示了NodeVector::append方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collectTargetNodes
static void collectTargetNodes(Node* node, NodeVector& nodes)
{
if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) {
nodes.append(node);
return;
}
getChildNodes(node, nodes);
}
示例2: notifyNodeInsertedIntoDocument
void notifyNodeInsertedIntoDocument(ContainerNode& insertionPoint, Node& node, NodeVector& postInsertionNotificationTargets)
{
ASSERT(insertionPoint.inDocument());
if (node.insertedInto(insertionPoint) == Node::InsertionShouldCallFinishedInsertingSubtree)
postInsertionNotificationTargets.append(node);
if (is<ContainerNode>(node))
notifyDescendantInsertedIntoDocument(insertionPoint, downcast<ContainerNode>(node), postInsertionNotificationTargets);
}
示例3: notifyNodeInsertedIntoTree
void notifyNodeInsertedIntoTree(ContainerNode& insertionPoint, ContainerNode& node, NodeVector& postInsertionNotificationTargets)
{
NoEventDispatchAssertion assertNoEventDispatch;
ASSERT(!insertionPoint.inDocument());
if (node.insertedInto(insertionPoint) == Node::InsertionShouldCallFinishedInsertingSubtree)
postInsertionNotificationTargets.append(node);
notifyDescendantInsertedIntoTree(insertionPoint, node, postInsertionNotificationTargets);
}
示例4: collectChildrenAndRemoveFromOldParent
static void collectChildrenAndRemoveFromOldParent(Node& node, NodeVector& nodes, ExceptionCode& ec)
{
if (!node.isDocumentFragment()) {
nodes.append(node);
if (ContainerNode* oldParent = node.parentNode())
oldParent->removeChild(&node, ec);
return;
}
getChildNodes(node, nodes);
toContainerNode(node).removeChildren();
}
示例5: removeChildren
// this differs from other remove functions because it forcibly removes all the children,
// regardless of read-only status or event exceptions, e.g.
void ContainerNode::removeChildren()
{
if (!m_firstChild)
return;
// The container node can be removed from event handlers.
Ref<ContainerNode> protect(*this);
// exclude this node when looking for removed focusedNode since only children will be removed
document().removeFocusedNodeOfSubtree(this, true);
#if ENABLE(FULLSCREEN_API)
document().removeFullScreenElementOfSubtree(this, true);
#endif
// Do any prep work needed before actually starting to detach
// and remove... e.g. stop loading frames, fire unload events.
willRemoveChildren(*this);
NodeVector removedChildren;
{
WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
{
NoEventDispatchAssertion assertNoEventDispatch;
removedChildren.reserveInitialCapacity(countChildNodes());
while (RefPtr<Node> n = m_firstChild) {
removedChildren.append(*m_firstChild);
removeBetween(0, m_firstChild->nextSibling(), *m_firstChild);
}
}
ChildChange change = { AllChildrenRemoved, nullptr, nullptr, ChildChangeSourceAPI };
childrenChanged(change);
for (size_t i = 0; i < removedChildren.size(); ++i)
ChildNodeRemovalNotifier(*this).notify(removedChildren[i].get());
}
if (document().svgExtensions()) {
Element* shadowHost = this->shadowHost();
if (!shadowHost || !shadowHost->hasTagName(SVGNames::useTag))
document().accessSVGExtensions()->rebuildElements();
}
dispatchSubtreeModifiedEvent();
}