当前位置: 首页>>代码示例>>C++>>正文


C++ ContainerNode::inDocument方法代码示例

本文整理汇总了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;
}
开发者ID:TigerWFH,项目名称:webkit,代码行数:32,代码来源:HTMLImageElement.cpp

示例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());
    }
}
开发者ID:ollie314,项目名称:webkit,代码行数:27,代码来源:ContainerNodeAlgorithms.cpp

示例3: insertedInto

Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode& rootParent)
{
    SVGElement::insertedInto(rootParent);
    if (rootParent.inDocument())
        m_styleSheetOwner.insertedIntoDocument(document(), *this);
    return InsertionDone;
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:7,代码来源:SVGStyleElement.cpp

示例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();
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:33,代码来源:DOMSelection.cpp

示例5: insertedInto

Node::InsertionNotificationRequest HTMLFrameElementBase::insertedInto(ContainerNode& insertionPoint)
{
    HTMLFrameOwnerElement::insertedInto(insertionPoint);
    if (insertionPoint.inDocument())
        return InsertionShouldCallDidNotifySubtreeInsertions;
    return InsertionDone;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:7,代码来源:HTMLFrameElementBase.cpp

示例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;
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:32,代码来源:SVGSMILElement.cpp

示例7: insertedInto

Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode& rootParent)
{
    SVGElement::insertedInto(rootParent);
    if (rootParent.inDocument())
        buildPendingResource();
    return InsertionDone;
}
开发者ID:boska,项目名称:webkit,代码行数:7,代码来源:SVGMPathElement.cpp

示例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);
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例9: removedFrom

void SVGMPathElement::removedFrom(ContainerNode& rootParent)
{
    SVGElement::removedFrom(rootParent);
    notifyParentOfPathChange(&rootParent);
    if (rootParent.inDocument())
        clearResourceReferences();
}
开发者ID:boska,项目名称:webkit,代码行数:7,代码来源:SVGMPathElement.cpp

示例10: insertedInto

Node::InsertionNotificationRequest SVGTRefElement::insertedInto(ContainerNode& rootParent)
{
    SVGElement::insertedInto(rootParent);
    if (rootParent.inDocument())
        return InsertionShouldCallFinishedInsertingSubtree;
    return InsertionDone;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:7,代码来源:SVGTRefElement.cpp

示例11: removedFrom

void HTMLStyleElement::removedFrom(ContainerNode& insertionPoint)
{
    HTMLElement::removedFrom(insertionPoint);

    if (insertionPoint.inDocument())
        m_styleSheetOwner.removedFromDocument(document(), *this);
}
开发者ID:biddyweb,项目名称:switch-oss,代码行数:7,代码来源:HTMLStyleElement.cpp

示例12: insertedInto

Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode& rootParent)
{
    SVGElement::insertedInto(rootParent);
    if (rootParent.inDocument())
        return InsertionShouldCallDidNotifySubtreeInsertions;
    return InsertionDone;
}
开发者ID:highweb-project,项目名称:highweb-parallelwebkit,代码行数:7,代码来源:SVGMPathElement.cpp

示例13: insertedInto

Node::InsertionNotificationRequest SVGScriptElement::insertedInto(ContainerNode& rootParent)
{
    SVGElement::insertedInto(rootParent);
    if (rootParent.inDocument())
        SVGExternalResourcesRequired::insertedIntoDocument(this);
    return shouldCallFinishedInsertingSubtree(rootParent) ? InsertionShouldCallFinishedInsertingSubtree : InsertionDone;
}
开发者ID:caiolima,项目名称:webkit,代码行数:7,代码来源:SVGScriptElement.cpp

示例14: insertedInto

Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode& insertionPoint)
{
    Node::InsertionNotificationRequest request = HTMLElement::insertedInto(insertionPoint);
    if (insertionPoint.inDocument())
        treeScope().addImageMap(*this);
    return request;
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:7,代码来源:HTMLMapElement.cpp

示例15: insertedInto

Node::InsertionNotificationRequest HTMLFormElement::insertedInto(ContainerNode& insertionPoint)
{
    HTMLElement::insertedInto(insertionPoint);
    if (insertionPoint.inDocument())
        document().didAssociateFormControl(this);
    return InsertionDone;
}
开发者ID:EliBing,项目名称:webkit,代码行数:7,代码来源:HTMLFormElement.cpp


注:本文中的ContainerNode::inDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。