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


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

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


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

示例1: wasInShadowTreeBeforeInserted

static bool wasInShadowTreeBeforeInserted(HTMLSlotElement& slot,
                                          ContainerNode& insertionPoint) {
  ShadowRoot* root1 = slot.containingShadowRoot();
  ShadowRoot* root2 = insertionPoint.containingShadowRoot();
  if (root1 && root2 && root1 == root2)
    return false;
  return root1;
}
开发者ID:ollie314,项目名称:chromium,代码行数:8,代码来源:HTMLSlotElement.cpp

示例2: removedFrom

void HTMLSlotElement::removedFrom(ContainerNode& insertionPoint)
{
    // ContainerNode::removeBetween always sets the removed child's tree scope to Document's but InShadowRoot flag is unset in Node::removedFrom.
    // So if InShadowRoot flag is set but this element's tree scope is Document's, this element has just been removed from a shadow root.
    if (insertionPoint.isInShadowTree() && isInShadowTree() && &treeScope() == &document()) {
        auto* oldShadowRoot = insertionPoint.containingShadowRoot();
        ASSERT(oldShadowRoot);
        oldShadowRoot->removeSlotElementByName(attributeWithoutSynchronization(nameAttr), *this);
    }

    HTMLElement::removedFrom(insertionPoint);
}
开发者ID:eocanha,项目名称:webkit,代码行数:12,代码来源:HTMLSlotElement.cpp

示例3: determineScopingNodeForStyleScoped

static Node* determineScopingNodeForStyleScoped(HTMLStyleElement* ownerElement, StyleSheetContents* styleSheetContents)
{
    ASSERT(ownerElement && ownerElement->isRegisteredAsScoped());

    if (ownerElement->isInShadowTree()) {
        if (hasDistributedRule(styleSheetContents)) {
            ContainerNode* scope = ownerElement;
            do {
                scope = scope->containingShadowRoot()->shadowHost();
            } while (scope->isInShadowTree());

            return scope;
        }
        if (ownerElement->isRegisteredAsScoped())
            return ownerElement->containingShadowRoot()->shadowHost();
    }

    return ownerElement->isRegisteredInShadowRoot() ? ownerElement->containingShadowRoot()->shadowHost() : ownerElement->parentNode();
}
开发者ID:Igalia,项目名称:blink,代码行数:19,代码来源:StyleInvalidationAnalysis.cpp

示例4: removedFrom

void HTMLFormControlElementWithState::removedFrom(ContainerNode& insertionPoint)
{
    if (insertionPoint.inDocument() && !containingShadowRoot() && !insertionPoint.containingShadowRoot())
        document().formController().unregisterFormElementWithState(this);
    HTMLFormControlElement::removedFrom(insertionPoint);
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:6,代码来源:HTMLFormControlElementWithState.cpp


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