本文整理汇总了C++中ContainerNode::inDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerNode::inDocument方法的具体用法?C++ ContainerNode::inDocument怎么用?C++ ContainerNode::inDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerNode
的用法示例。
在下文中一共展示了ContainerNode::inDocument方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertedInto
Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode& insertionPoint)
{
if (m_formSetByParser) {
m_form = m_formSetByParser;
m_formSetByParser = nullptr;
m_form->registerImgElement(this);
}
if (!m_form) {
m_form = HTMLFormElement::findClosestFormAncestor(*this);
if (m_form)
m_form->registerImgElement(this);
}
// Insert needs to complete first, before we start updating the loader. Loader dispatches events which could result
// in callbacks back to this node.
Node::InsertionNotificationRequest insertNotificationRequest = HTMLElement::insertedInto(insertionPoint);
if (insertionPoint.inDocument() && !m_lowercasedUsemap.isNull())
document().addImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
if (is<HTMLPictureElement>(parentNode())) {
setPictureElement(&downcast<HTMLPictureElement>(*parentNode()));
selectImageSource();
}
// If we have been inserted from a renderer-less document,
// our loader may have not fetched the image, so do it now.
if (insertionPoint.inDocument() && !m_imageLoader.image())
m_imageLoader.updateFromElement();
return insertNotificationRequest;
}
示例2: notifyNodeRemovedFromDocument
void notifyNodeRemovedFromDocument(ContainerNode& insertionPoint, Node& node)
{
ASSERT(insertionPoint.inDocument());
node.removedFrom(insertionPoint);
if (!is<ContainerNode>(node))
return;
ChildNodesLazySnapshot snapshot(node);
while (RefPtr<Node> child = snapshot.nextNode()) {
// If we have been added to the document during this loop, then we
// don't want to tell the rest of our children that they've been
// removed from the document because they haven't.
if (!node.inDocument() && child->parentNode() == &node)
notifyNodeRemovedFromDocument(insertionPoint, *child.get());
}
if (!is<Element>(node))
return;
if (node.document().cssTarget() == &node)
node.document().setCSSTarget(nullptr);
if (RefPtr<ShadowRoot> root = downcast<Element>(node).shadowRoot()) {
if (!node.inDocument() && root->host() == &node)
notifyNodeRemovedFromDocument(insertionPoint, *root.get());
}
}
示例3: insertedInto
Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode& rootParent)
{
SVGElement::insertedInto(rootParent);
if (rootParent.inDocument())
m_styleSheetOwner.insertedIntoDocument(document(), *this);
return InsertionDone;
}
示例4: containsNode
bool DOMSelection::containsNode(Node& node, bool allowPartial) const
{
if (!m_frame)
return false;
FrameSelection& selection = m_frame->selection();
if (m_frame->document() != &node.document() || selection.isNone())
return false;
Ref<Node> protectedNode(node);
RefPtr<Range> selectedRange = selection.selection().toNormalizedRange();
ContainerNode* parentNode = node.parentNode();
if (!parentNode || !parentNode->inDocument())
return false;
unsigned nodeIndex = node.computeNodeIndex();
ExceptionCode ec = 0;
bool nodeFullySelected = Range::compareBoundaryPoints(parentNode, nodeIndex, &selectedRange->startContainer(), selectedRange->startOffset(), ec) >= 0 && !ec
&& Range::compareBoundaryPoints(parentNode, nodeIndex + 1, &selectedRange->endContainer(), selectedRange->endOffset(), ec) <= 0 && !ec;
ASSERT(!ec);
if (nodeFullySelected)
return true;
bool nodeFullyUnselected = (Range::compareBoundaryPoints(parentNode, nodeIndex, &selectedRange->endContainer(), selectedRange->endOffset(), ec) > 0 && !ec)
|| (Range::compareBoundaryPoints(parentNode, nodeIndex + 1, &selectedRange->startContainer(), selectedRange->startOffset(), ec) < 0 && !ec);
ASSERT(!ec);
if (nodeFullyUnselected)
return false;
return allowPartial || node.isTextNode();
}
示例5: insertedInto
Node::InsertionNotificationRequest HTMLFrameElementBase::insertedInto(ContainerNode& insertionPoint)
{
HTMLFrameOwnerElement::insertedInto(insertionPoint);
if (insertionPoint.inDocument())
return InsertionShouldCallDidNotifySubtreeInsertions;
return InsertionDone;
}
示例6: insertedInto
Node::InsertionNotificationRequest SVGSMILElement::insertedInto(ContainerNode& rootParent)
{
SVGElement::insertedInto(rootParent);
if (!rootParent.inDocument())
return InsertionDone;
// Verify we are not in <use> instance tree.
ASSERT(!isInShadowTree());
setAttributeName(constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr)));
SVGSVGElement* owner = ownerSVGElement();
if (!owner)
return InsertionDone;
m_timeContainer = owner->timeContainer();
ASSERT(m_timeContainer);
m_timeContainer->setDocumentOrderIndexesDirty();
// "If no attribute is present, the default begin value (an offset-value of 0) must be evaluated."
if (!fastHasAttribute(SVGNames::beginAttr))
m_beginTimes.append(SMILTimeWithOrigin());
if (m_isWaitingForFirstInterval)
resolveFirstInterval();
if (m_timeContainer)
m_timeContainer->notifyIntervalsChanged();
buildPendingResource();
return InsertionDone;
}
示例7: insertedInto
Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode& rootParent)
{
SVGElement::insertedInto(rootParent);
if (rootParent.inDocument())
buildPendingResource();
return InsertionDone;
}
示例8: insertedInto
Node::InsertionNotificationRequest MathMLMathElement::insertedInto(ContainerNode& insertionPoint)
{
// There are sibling rules in the MathML default style.
if (insertionPoint.inDocument())
document().styleSheetCollection().setUsesSiblingRulesOverride(true);
return MathMLInlineContainerElement::insertedInto(insertionPoint);
}
示例9: removedFrom
void SVGMPathElement::removedFrom(ContainerNode& rootParent)
{
SVGElement::removedFrom(rootParent);
notifyParentOfPathChange(&rootParent);
if (rootParent.inDocument())
clearResourceReferences();
}
示例10: insertedInto
Node::InsertionNotificationRequest SVGTRefElement::insertedInto(ContainerNode& rootParent)
{
SVGElement::insertedInto(rootParent);
if (rootParent.inDocument())
return InsertionShouldCallFinishedInsertingSubtree;
return InsertionDone;
}
示例11: removedFrom
void HTMLStyleElement::removedFrom(ContainerNode& insertionPoint)
{
HTMLElement::removedFrom(insertionPoint);
if (insertionPoint.inDocument())
m_styleSheetOwner.removedFromDocument(document(), *this);
}
示例12: insertedInto
Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode& rootParent)
{
SVGElement::insertedInto(rootParent);
if (rootParent.inDocument())
return InsertionShouldCallDidNotifySubtreeInsertions;
return InsertionDone;
}
示例13: insertedInto
Node::InsertionNotificationRequest SVGScriptElement::insertedInto(ContainerNode& rootParent)
{
SVGElement::insertedInto(rootParent);
if (rootParent.inDocument())
SVGExternalResourcesRequired::insertedIntoDocument(this);
return shouldCallFinishedInsertingSubtree(rootParent) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone;
}
示例14: insertedInto
Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode& insertionPoint)
{
Node::InsertionNotificationRequest request = HTMLElement::insertedInto(insertionPoint);
if (insertionPoint.inDocument())
treeScope().addImageMap(*this);
return request;
}
示例15: insertedInto
Node::InsertionNotificationRequest HTMLFormElement::insertedInto(ContainerNode& insertionPoint)
{
HTMLElement::insertedInto(insertionPoint);
if (insertionPoint.inDocument())
document().didAssociateFormControl(this);
return InsertionDone;
}