bool HTMLShadowElement::doesSelectFromHostChildren() const { TreeScope* scope = treeScope(); if (scope->isShadowRoot()) return toShadowRoot(scope)->isOldest(); return false; }
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; }
void InsertionPoint::attach() { TreeScope* scope = treeScope(); if (scope->isShadowRoot()) { ShadowRoot* root = toShadowRoot(scope); if (doesSelectFromHostChildren()) { distributeHostChildren(root->tree()); attachDistributedNode(); } else if (!root->olderShadowRoot()->assignedTo()) { ASSERT(!root->olderShadowRoot()->attached()); assignShadowRoot(root->olderShadowRoot()); root->olderShadowRoot()->attach(); } } HTMLElement::attach(); }