示例#1
0
void ElementShadow::detach()
{
    for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
        if (root->attached())
            root->detach();
    }
}
示例#2
0
static void detachShadowRoot(ShadowRoot& shadowRoot, DetachType detachType)
{
    if (!shadowRoot.attached())
        return;
    detachChildren(shadowRoot, detachType);

    shadowRoot.setAttached(false);
}
示例#3
0
void ElementShadow::attach()
{
    ContentDistributor::ensureDistribution(youngestShadowRoot());

    for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
        if (!root->attached())
            root->attach();
    }
}
示例#4
0
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();
}
示例#5
0
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);
}