本文整理汇总了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;
}
示例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);
}
示例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();
}
示例4: removedFrom
void HTMLFormControlElementWithState::removedFrom(ContainerNode& insertionPoint)
{
if (insertionPoint.inDocument() && !containingShadowRoot() && !insertionPoint.containingShadowRoot())
document().formController().unregisterFormElementWithState(this);
HTMLFormControlElement::removedFrom(insertionPoint);
}