Exemple #1
0
bool HTMLShadowElement::doesSelectFromHostChildren() const
{
    TreeScope* scope = treeScope();

    if (scope->isShadowRoot())
        return toShadowRoot(scope)->isOldest();
    return false;
}
Exemple #2
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;
}
Exemple #3
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();
}