本文整理汇总了C++中ContainerNode::isInShadowTree方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerNode::isInShadowTree方法的具体用法?C++ ContainerNode::isInShadowTree怎么用?C++ ContainerNode::isInShadowTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerNode
的用法示例。
在下文中一共展示了ContainerNode::isInShadowTree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
ComposedTreeIterator::ComposedTreeIterator(ContainerNode& root, Node& current)
: m_rootIsInShadowTree(root.isInShadowTree())
{
ASSERT(!is<ShadowRoot>(root));
ASSERT(!is<ShadowRoot>(current));
bool mayNeedShadowStack = root.shadowRoot() || (¤t != &root && current.parentNode() != &root);
if (mayNeedShadowStack)
initializeContextStack(root, current);
else
m_contextStack.uncheckedAppend(Context(root, current));
}
示例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: insertedInto
HTMLSlotElement::InsertionNotificationRequest HTMLSlotElement::insertedInto(ContainerNode& insertionPoint)
{
auto insertionResult = HTMLElement::insertedInto(insertionPoint);
ASSERT_UNUSED(insertionResult, insertionResult == InsertionDone);
// This function could be called when this element's shadow root's host or its ancestor is inserted.
// This element is new to the shadow tree (and its tree scope) only if the parent into which this element
// or its ancestor is inserted belongs to the same tree scope as this element's.
if (insertionPoint.isInShadowTree() && isInShadowTree() && &insertionPoint.treeScope() == &treeScope()) {
if (auto shadowRoot = containingShadowRoot())
shadowRoot->addSlotElementByName(attributeWithoutSynchronization(nameAttr), *this);
}
return InsertionDone;
}
示例4: 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();
}