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


C++ ShadowRoot类代码示例

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


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

示例1: toShadowRoot

inline Node* ComposedTreeWalker::traverseParentOrHost(const Node* node) const
{
    Node* parent = node->parentNode();
    if (!parent)
        return 0;
    if (!parent->isShadowRoot())
        return parent;
    ShadowRoot* shadowRoot = toShadowRoot(parent);
    ASSERT(!shadowRoot->shadowInsertionPointOfYoungerShadowRoot());
    if (!shadowRoot->isYoungest())
        return 0;
    return shadowRoot->host();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:13,代码来源:ComposedTreeWalker.cpp

示例2: shadowRoot

Node::InsertionNotificationRequest HTMLContentElement::insertedInto(ContainerNode* insertionPoint)
{
    InsertionPoint::insertedInto(insertionPoint);

    if (insertionPoint->inDocument() && isActive()) {
        ShadowRoot* root = shadowRoot();
        root->registerContentElement();
        root->owner()->setShouldCollectSelectFeatureSet();
        m_registeredWithShadowRoot = true;
    }

    return InsertionDone;
}
开发者ID:dog-god,项目名称:iptv,代码行数:13,代码来源:HTMLContentElement.cpp

示例3: authorShadowRootOf

// FIXME: Move the following helper functions, authorShadowRootOf, firstWithinTraversingShadowTree,
// nextTraversingShadowTree to the best place, e.g. NodeTraversal.
static ShadowRoot* authorShadowRootOf(const ContainerNode& node)
{
    if (!node.isElementNode() || !isShadowHost(&node))
        return nullptr;

    ElementShadow* shadow = toElement(node).shadow();
    ASSERT(shadow);
    for (ShadowRoot* shadowRoot = shadow->oldestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->youngerShadowRoot()) {
        if (shadowRoot->type() == ShadowRootType::OpenByDefault || shadowRoot->type() == ShadowRootType::Open)
            return shadowRoot;
    }
    return nullptr;
}
开发者ID:dstockwell,项目名称:blink,代码行数:15,代码来源:SelectorQuery.cpp

示例4: setNeedsStyleRecalcForViewportUnits

void TreeScope::setNeedsStyleRecalcForViewportUnits() {
  for (Element* element = ElementTraversal::firstWithin(rootNode()); element;
       element = ElementTraversal::nextIncludingPseudo(*element)) {
    for (ShadowRoot* root = element->youngestShadowRoot(); root;
         root = root->olderShadowRoot())
      root->setNeedsStyleRecalcForViewportUnits();
    const ComputedStyle* style = element->computedStyle();
    if (style && style->hasViewportUnits())
      element->setNeedsStyleRecalc(LocalStyleChange,
                                   StyleChangeReasonForTracing::create(
                                       StyleChangeReason::ViewportUnits));
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:13,代码来源:TreeScope.cpp

示例5: ASSERT

void SVGTRefElement::updateReferencedText()
{
    String textContent;
    if (Element* target = SVGURIReference::targetElementFromIRIString(href(), document()))
        textContent = target->textContent();

    ASSERT(hasShadowRoot());
    ShadowRoot* root = shadowTree()->oldestShadowRoot();
    if (!root->firstChild())
        root->appendChild(SVGShadowText::create(document(), textContent), ASSERT_NO_EXCEPTION);
    else
        root->firstChild()->setTextContent(textContent, ASSERT_NO_EXCEPTION);
}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:13,代码来源:SVGTRefElement.cpp

示例6: host

void ShadowRoot::removedFrom(ContainerNode* insertionPoint)
{
    if (insertionPoint->inDocument() && m_registeredWithParentShadowRoot) {
        ShadowRoot* root = host()->containingShadowRoot();
        if (!root)
            root = insertionPoint->containingShadowRoot();
        if (root)
            root->removeChildShadowRoot();
        m_registeredWithParentShadowRoot = false;
    }

    DocumentFragment::removedFrom(insertionPoint);
}
开发者ID:jeremyroman,项目名称:blink,代码行数:13,代码来源:ShadowRoot.cpp

示例7: toShadowRoot

ContainerNode* ComposedTreeTraversal::traverseParentOrHost(const Node& node)
{
    ContainerNode* parent = node.parentNode();
    if (!parent)
        return nullptr;
    if (!parent->isShadowRoot())
        return parent;
    ShadowRoot* shadowRoot = toShadowRoot(parent);
    ASSERT(!shadowRoot->shadowInsertionPointOfYoungerShadowRoot());
    if (!shadowRoot->isYoungest())
        return nullptr;
    return shadowRoot->host();
}
开发者ID:JiangSuyong,项目名称:chromium,代码行数:13,代码来源:ComposedTreeTraversal.cpp

示例8: host

void ShadowRoot::removedFrom(ContainerNode* insertionPoint)
{
    ShadowRoot* root = host()->containingShadowRoot();
    if (!root)
        root = insertionPoint->containingShadowRoot();
    if (root)
        root->removeChildShadowRoot();

    if (inActiveDocument())
        document().styleEngine()->removeTreeScope(*this);

    DocumentFragment::removedFrom(insertionPoint);
}
开发者ID:Jamesducque,项目名称:mojo,代码行数:13,代码来源:ShadowRoot.cpp

示例9: ASSERT

void ShadowTree::attach()
{
    // Children of m_selector is populated lazily in
    // ensureSelector(), and here we just ensure that it is in clean state.
    ASSERT(!selector().hasPopulated());

    selector().willSelect();
    for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
        if (!root->attached())
            root->attach();
    }
    selector().didSelect();
}
开发者ID:Moondee,项目名称:Artemis,代码行数:13,代码来源:ShadowTree.cpp

示例10: ASSERT

Node* ComposedTreeWalker::traverseBackToYoungerShadowRoot(const Node* node, TraversalDirection direction)
{
    ASSERT(node);
    if (node->parentNode() && node->parentNode()->isShadowRoot()) {
        ShadowRoot* parentShadowRoot = toShadowRoot(node->parentNode());
        if (!parentShadowRoot->isYoungest()) {
            HTMLShadowElement* assignedInsertionPoint = parentShadowRoot->shadowInsertionPointOfYoungerShadowRoot();
            ASSERT(assignedInsertionPoint);
            return traverseSiblingInCurrentTree(assignedInsertionPoint, direction);
        }
    }
    return 0;
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:13,代码来源:ComposedTreeWalker.cpp

示例11: ASSERT

Node* ComposedShadowTreeWalker::traverseBackToYoungerShadowRoot(const Node* node, TraversalDirection direction)
{
    ASSERT(node);
    if (node->parentNode() && node->parentNode()->isShadowRoot()) {
        ShadowRoot* parentShadowRoot = toShadowRoot(node->parentNode());
        if (!parentShadowRoot->isYoungest()) {
            InsertionPoint* assignedInsertionPoint = ScopeContentDistribution::assignedTo(parentShadowRoot);
            ASSERT(assignedInsertionPoint);
            return traverseSiblingInCurrentTree(assignedInsertionPoint, direction);
        }
    }
    return 0;
}
开发者ID:harlanlewis,项目名称:webkit,代码行数:13,代码来源:ComposedShadowTreeWalker.cpp

示例12: containingShadowRoot

ShadowRoot* HTMLShadowElement::olderShadowRoot()
{
    ShadowRoot* containingRoot = containingShadowRoot();
    if (!containingRoot)
        return 0;

    ContentDistributor::ensureDistribution(containingRoot);

    ShadowRoot* older = containingRoot->olderShadowRoot();
    if (!older || older->type() != ShadowRoot::AuthorShadowRoot || ScopeContentDistribution::assignedTo(older) != this)
        return 0;

    return older;
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例13: shouldBypassMainWorldCSP

static bool shouldBypassMainWorldCSP(Element* element)
{
    // Main world CSP is bypassed within an isolated world.
    LocalFrame* frame = element->document().frame();
    if (frame && frame->script().shouldBypassMainWorldCSP())
        return true;

    // Main world CSP is bypassed for style elements in user agent shadow DOM.
    ShadowRoot* root = element->containingShadowRoot();
    if (root && root->type() == ShadowRootType::UserAgent)
        return true;

    return false;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:14,代码来源:StyleElement.cpp

示例14: attachShadowRoot

static void attachShadowRoot(ShadowRoot& shadowRoot)
{
    if (shadowRoot.attached())
        return;
    StyleResolver& styleResolver = shadowRoot.document().ensureStyleResolver();
    styleResolver.pushParentShadowRoot(&shadowRoot);

    attachChildren(shadowRoot);

    styleResolver.popParentShadowRoot(&shadowRoot);

    shadowRoot.clearNeedsStyleRecalc();
    shadowRoot.setAttached(true);
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例15: TEST

TEST(TreeScopeTest, CommonAncestorOfInclusiveTrees) {
  //  document
  //     |      : Common ancestor is document.
  // shadowRoot

  Document* document = Document::create();
  Element* html = document->createElement("html", StringOrDictionary());
  document->appendChild(html);
  ShadowRoot* shadowRoot =
      html->createShadowRootInternal(ShadowRootType::V0, ASSERT_NO_EXCEPTION);

  EXPECT_EQ(document, document->commonAncestorTreeScope(*shadowRoot));
  EXPECT_EQ(document, shadowRoot->commonAncestorTreeScope(*document));
}
开发者ID:,项目名称:,代码行数:14,代码来源:


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