void ElementShadow::detach() { for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { if (root->attached()) root->detach(); } }
static void detachShadowRoot(ShadowRoot& shadowRoot, DetachType detachType) { if (!shadowRoot.attached()) return; detachChildren(shadowRoot, detachType); shadowRoot.setAttached(false); }
void ElementShadow::attach() { ContentDistributor::ensureDistribution(youngestShadowRoot()); for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { if (!root->attached()) root->attach(); } }
void ShadowTree::attach() { // Children of m_selector is populated lazily in // ensureSelector(), and here we just ensure that it is in clean state. ASSERT(!selector().hasPopulated()); selector().willSelect(); for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { if (!root->attached()) root->attach(); } selector().didSelect(); }
static void attachShadowRoot(ShadowRoot& shadowRoot) { if (shadowRoot.attached()) return; StyleResolver& styleResolver = shadowRoot.document().ensureStyleResolver(); styleResolver.pushParentShadowRoot(&shadowRoot); attachChildren(shadowRoot); styleResolver.popParentShadowRoot(&shadowRoot); shadowRoot.clearNeedsStyleRecalc(); shadowRoot.setAttached(true); }