ShadowRoot* InsertionPoint::assignedFrom() const { Node* treeScopeRoot = treeScope()->rootNode(); if (!treeScopeRoot->isShadowRoot()) return 0; ShadowRoot* olderShadowRoot = toShadowRoot(treeScopeRoot)->olderShadowRoot(); if (olderShadowRoot && olderShadowRoot->assignedTo() == this) return olderShadowRoot; return 0; }
ShadowRoot* InsertionPoint::assignedFrom() const { TreeScope* scope = treeScope(); if (!scope->isShadowRoot()) return 0; ShadowRoot* olderShadowRoot = toShadowRoot(scope)->olderShadowRoot(); if (olderShadowRoot && olderShadowRoot->assignedTo() == this) return olderShadowRoot; return 0; }
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 = parentShadowRoot->assignedTo(); ASSERT(assignedInsertionPoint); return traverseSiblingInCurrentTree(assignedInsertionPoint, direction); } } return 0; }