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


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

本文整理汇总了C++中ContainerNode::parentOrShadowHostNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerNode::parentOrShadowHostNode方法的具体用法?C++ ContainerNode::parentOrShadowHostNode怎么用?C++ ContainerNode::parentOrShadowHostNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContainerNode的用法示例。


在下文中一共展示了ContainerNode::parentOrShadowHostNode方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: depthCrossingShadowBoundaries

static unsigned depthCrossingShadowBoundaries(Node* node)
{
    unsigned depth = 0;
    for (ContainerNode* parent = node->parentOrShadowHostNode(); parent; parent = parent->parentOrShadowHostNode())
        ++depth;
    return depth;
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:7,代码来源:FullyClippedStateStack.cpp

示例2: setupScopedStylesTree

void ScopedStyleTree::setupScopedStylesTree(ScopedStyleResolver* target)
{
    ASSERT(target);

    const ContainerNode& scopingNode = target->scopingNode();

    // Since StyleResolver creates RuleSets according to styles' document
    // order, a parent of the given ScopedRuleData has been already
    // prepared.
    for (ContainerNode* node = scopingNode.parentOrShadowHostNode(); node; node = node->parentOrShadowHostNode()) {
        if (ScopedStyleResolver* scopedResolver = scopedStyleResolverFor(*node)) {
            target->setParent(scopedResolver);
            break;
        }
        if (node->isDocumentNode()) {
            bool dummy;
            ScopedStyleResolver* scopedResolver = addScopedStyleResolver(*node, dummy);
            target->setParent(scopedResolver);
            setupScopedStylesTree(scopedResolver);
            break;
        }
    }

    if (m_buildInDocumentOrder)
        return;

    // Reparent all nodes whose scoping node is contained by target's one.
    for (HashMap<const ContainerNode*, OwnPtr<ScopedStyleResolver> >::iterator it = m_authorStyles.begin(); it != m_authorStyles.end(); ++it) {
        if (it->value == target)
            continue;
        ASSERT(it->key->inDocument());
        if (it->value->parent() == target->parent() && scopingNode.containsIncludingShadowDOM(it->key))
            it->value->setParent(target);
    }
}
开发者ID:glenkim-dev,项目名称:blink-crosswalk,代码行数:35,代码来源:ScopedStyleTree.cpp

示例3: canLoadFrame

bool SubframeLoadingDisabler::canLoadFrame(HTMLFrameOwnerElement& owner)
{
    for (ContainerNode* node = &owner; node; node = node->parentOrShadowHostNode()) {
        if (disabledSubtreeRoots().contains(node))
            return false;
    }
    return true;
}
开发者ID:endlessm,项目名称:WebKit,代码行数:8,代码来源:HTMLFrameOwnerElement.cpp

示例4: popStyleCache

void ScopedStyleTree::popStyleCache(const ContainerNode& scopingNode)
{
    if (!cacheIsValid(&scopingNode))
        return;

    if (m_cache.scopedResolver && m_cache.scopedResolver->scopingNode() == scopingNode)
        m_cache.scopedResolver = m_cache.scopedResolver->parent();
    m_cache.nodeForScopedStyles = scopingNode.parentOrShadowHostNode();
}
开发者ID:cvsuser-chromium,项目名称:third_party_WebKit,代码行数:9,代码来源:ScopedStyleResolver.cpp

示例5: clearContentFrame

void HTMLFrameOwnerElement::clearContentFrame()
{
    if (!m_contentFrame)
        return;

    m_contentFrame = 0;

    for (ContainerNode* node = this; node; node = node->parentOrShadowHostNode())
        node->decrementConnectedSubframeCount();
}
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:10,代码来源:HTMLFrameOwnerElement.cpp

示例6: setContentFrame

void HTMLFrameOwnerElement::setContentFrame(Frame& frame)
{
    // Make sure we will not end up with two frames referencing the same owner element.
    ASSERT(!m_contentFrame || m_contentFrame->ownerElement() != this);
    // Disconnected frames should not be allowed to load.
    ASSERT(inDocument());
    m_contentFrame = &frame;

    for (ContainerNode* node = this; node; node = node->parentOrShadowHostNode())
        node->incrementConnectedSubframeCount();
}
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:11,代码来源:HTMLFrameOwnerElement.cpp

示例7: ownerSVGElement

SVGSVGElement* SVGElement::ownerSVGElement() const
{
    ContainerNode* n = parentOrShadowHostNode();
    while (n) {
        if (n->hasTagName(SVGNames::svgTag))
            return toSVGSVGElement(n);

        n = n->parentOrShadowHostNode();
    }

    return 0;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:12,代码来源:SVGElement.cpp

示例8: ownerSVGElement

SVGSVGElement* SVGElement::ownerSVGElement() const
{
    ContainerNode* n = parentOrShadowHostNode();
    while (n) {
        if (isSVGSVGElement(*n))
            return toSVGSVGElement(n);

        n = n->parentOrShadowHostNode();
    }

    return nullptr;
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:12,代码来源:SVGElement.cpp

示例9: ownerSVGElement

SVGSVGElement* SVGElement::ownerSVGElement() const
{
    ContainerNode* node = parentOrShadowHostNode();
    while (node) {
        if (is<SVGSVGElement>(*node))
            return downcast<SVGSVGElement>(node);

        node = node->parentOrShadowHostNode();
    }

    return nullptr;
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:12,代码来源:SVGElement.cpp

示例10: viewportElement

SVGElement* SVGElement::viewportElement() const
{
    // This function needs shadow tree support - as RenderSVGContainer uses this function
    // to determine the "overflow" property. <use> on <symbol> wouldn't work otherwhise.
    ContainerNode* n = parentOrShadowHostNode();
    while (n) {
        if (n->hasTagName(SVGNames::svgTag) || isSVGImageElement(n) || n->hasTagName(SVGNames::symbolTag))
            return toSVGElement(n);

        n = n->parentOrShadowHostNode();
    }

    return 0;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:14,代码来源:SVGElement.cpp

示例11: viewportElement

SVGElement* SVGElement::viewportElement() const
{
    // This function needs shadow tree support - as LayoutSVGContainer uses this function
    // to determine the "overflow" property. <use> on <symbol> wouldn't work otherwhise.
    ContainerNode* n = parentOrShadowHostNode();
    while (n) {
        if (isSVGSVGElement(*n) || isSVGImageElement(*n) || isSVGSymbolElement(*n))
            return toSVGElement(n);

        n = n->parentOrShadowHostNode();
    }

    return nullptr;
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:14,代码来源:SVGElement.cpp

示例12: viewportElement

SVGElement* SVGElement::viewportElement() const
{
    // This function needs shadow tree support - as RenderSVGContainer uses this function
    // to determine the "overflow" property. <use> on <symbol> wouldn't work otherwhise.
    ContainerNode* node = parentOrShadowHostNode();
    while (node) {
        if (is<SVGSVGElement>(*node) || is<SVGImageElement>(*node) || node->hasTagName(SVGNames::symbolTag))
            return downcast<SVGElement>(node);

        node = node->parentOrShadowHostNode();
    }

    return nullptr;
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:14,代码来源:SVGElement.cpp

示例13: setUpFullyClippedStack

void FullyClippedStateStack::setUpFullyClippedStack(Node* node)
{
    // Put the nodes in a vector so we can iterate in reverse order.
    WillBeHeapVector<RawPtrWillBeMember<ContainerNode>, 100> ancestry;
    for (ContainerNode* parent = node->parentOrShadowHostNode(); parent; parent = parent->parentOrShadowHostNode())
        ancestry.append(parent);

    // Call pushFullyClippedState on each node starting with the earliest ancestor.
    size_t ancestrySize = ancestry.size();
    for (size_t i = 0; i < ancestrySize; ++i)
        pushFullyClippedState(ancestry[ancestrySize - i - 1]);
    pushFullyClippedState(node);

    ASSERT(size() == 1 + depthCrossingShadowBoundaries(node));
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:15,代码来源:FullyClippedStateStack.cpp

示例14: getEventListeners

void EventListenerInfo::getEventListeners(EventTarget* target, WillBeHeapVector<EventListenerInfo>& eventInformation, bool includeAncestors)
{
    // The Node's Ancestors including self.
    WillBeHeapVector<RawPtrWillBeMember<EventTarget>> ancestors;
    ancestors.append(target);
    if (includeAncestors) {
        Node* node = target->toNode();
        for (ContainerNode* ancestor = node ? node->parentOrShadowHostNode() : nullptr; ancestor; ancestor = ancestor->parentOrShadowHostNode())
            ancestors.append(ancestor);
    }

    // Nodes and their Listeners for the concerned event types (order is top to bottom)
    for (size_t i = ancestors.size(); i; --i) {
        EventTarget* ancestor = ancestors[i - 1];
        Vector<AtomicString> eventTypes = ancestor->eventTypes();
        for (size_t j = 0; j < eventTypes.size(); ++j) {
            AtomicString& type = eventTypes[j];
            EventListenerVector* listeners = ancestor->getEventListeners(type);
            if (!listeners)
                continue;
            EventListenerVector filteredListeners;
            filteredListeners.reserveCapacity(listeners->size());
            for (size_t k = 0; k < listeners->size(); ++k) {
                if (listeners->at(k).listener->type() == EventListener::JSEventListenerType)
                    filteredListeners.append(listeners->at(k));
            }
            if (!filteredListeners.isEmpty())
                eventInformation.append(EventListenerInfo(ancestor, type, filteredListeners));
        }
    }
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:31,代码来源:EventListenerInfo.cpp


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