本文整理汇总了C++中ShadowRoot::isV1方法的典型用法代码示例。如果您正苦于以下问题:C++ ShadowRoot::isV1方法的具体用法?C++ ShadowRoot::isV1怎么用?C++ ShadowRoot::isV1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShadowRoot
的用法示例。
在下文中一共展示了ShadowRoot::isV1方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findHostChildWithSameSlotName
bool HTMLSlotElement::findHostChildWithSameSlotName() const {
ShadowRoot* root = containingShadowRoot();
DCHECK(root);
DCHECK(root->isV1());
SlotAssignment& assignment = root->ensureSlotAssignment();
return assignment.findHostChildBySlotName(name());
}
示例2: removedFrom
void HTMLSlotElement::removedFrom(ContainerNode* insertionPoint) {
// `removedFrom` is called after the node is removed from the tree.
// That means:
// 1. If this slot is still in a tree scope, it means the slot has been in a
// shadow tree. An inclusive shadow-including ancestor of the shadow host was
// originally removed from its parent.
// 2. Or (this slot is now not in a tree scope), this slot's inclusive
// ancestor was orginally removed from its parent (== insertion point). This
// slot and the originally removed node was in the same tree.
ShadowRoot* root = containingShadowRootBeforeRemoved(*this, *insertionPoint);
if (root) {
if (ElementShadow* rootOwner = root->owner())
rootOwner->setNeedsDistributionRecalc();
}
// Since this insertion point is no longer visible from the shadow subtree, it
// need to clean itself up.
clearDistribution();
if (root && root->isV1() && root == insertionPoint->treeScope().rootNode()) {
// This slot was in a shadow tree and got disconnected from the shadow root.
root->ensureSlotAssignment().slotRemoved(*this);
}
HTMLElement::removedFrom(insertionPoint);
}
示例3: canBeActive
bool InsertionPoint::canBeActive() const
{
ShadowRoot* shadowRoot = containingShadowRoot();
if (!shadowRoot)
return false;
if (shadowRoot->isV1())
return false;
return !Traversal<InsertionPoint>::firstAncestor(*this);
}
示例4: hasAssignedNodesSlow
bool HTMLSlotElement::hasAssignedNodesSlow() const {
ShadowRoot* root = containingShadowRoot();
DCHECK(root);
DCHECK(root->isV1());
SlotAssignment& assignment = root->ensureSlotAssignment();
if (assignment.findSlotByName(name()) != this)
return false;
return assignment.findHostChildBySlotName(name());
}
示例5: enqueueSlotChangeEvent
void HTMLSlotElement::enqueueSlotChangeEvent() {
if (!m_slotchangeEventEnqueued) {
Microtask::enqueueMicrotask(WTF::bind(
&HTMLSlotElement::dispatchSlotChangeEvent, wrapPersistent(this)));
m_slotchangeEventEnqueued = true;
}
ShadowRoot* root = containingShadowRoot();
DCHECK(root);
DCHECK(root->isV1());
root->owner()->setNeedsDistributionRecalc();
// Check slotchange recursively since this slotchange may cause another
// slotchange.
checkSlotChange();
}
示例6: insertedInto
Node::InsertionNotificationRequest HTMLSlotElement::insertedInto(
ContainerNode* insertionPoint) {
HTMLElement::insertedInto(insertionPoint);
ShadowRoot* root = containingShadowRoot();
if (root) {
DCHECK(root->owner());
root->owner()->setNeedsDistributionRecalc();
// Relevant DOM Standard: https://dom.spec.whatwg.org/#concept-node-insert
// - 6.4: Run assign slotables for a tree with node's tree and a set
// containing each inclusive descendant of node that is a slot.
if (root->isV1() && !wasInShadowTreeBeforeInserted(*this, *insertionPoint))
root->ensureSlotAssignment().slotAdded(*this);
}
// We could have been distributed into in a detached subtree, make sure to
// clear the distribution when inserted again to avoid cycles.
clearDistribution();
return InsertionDone;
}