Ejemplo n.º 1
0
void SVGUseElement::removedFrom(ContainerNode* rootParent) {
  SVGGraphicsElement::removedFrom(rootParent);
  if (rootParent->isConnected()) {
    clearShadowTree();
    cancelShadowTreeRecreation();
  }
}
Ejemplo n.º 2
0
void SVGUseElement::buildPendingResource()
{
    if (inUseShadowTree())
        return;
    clearShadowTree();
    cancelShadowTreeRecreation();
    if (!referencedScope() || !inDocument())
        return;

    AtomicString id;
    Element* target = SVGURIReference::targetElementFromIRIString(hrefString(), treeScope(), &id, externalDocument());
    if (!target || !target->inDocument()) {
        // If we can't find the target of an external element, just give up.
        // We can't observe if the target somewhen enters the external document, nor should we do it.
        if (externalDocument())
            return;
        if (id.isEmpty())
            return;

        referencedScope()->document().accessSVGExtensions().addPendingResource(id, this);
        ASSERT(hasPendingResources());
        return;
    }

    if (target->isSVGElement()) {
        buildShadowAndInstanceTree(toSVGElement(target));
        invalidateDependentShadowTrees();
    }

    ASSERT(!m_needsShadowTreeRecreation);
}
Ejemplo n.º 3
0
SVGUseElement::~SVGUseElement()
{
#if !ENABLE(OILPAN)
    clearShadowTree();
    cancelShadowTreeRecreation();
    svgUseLoadEventSender().cancelEvent(this);
    dispose();
#endif
}
Ejemplo n.º 4
0
SVGUseElement::~SVGUseElement()
{
    setDocumentResource(0);
#if !ENABLE(OILPAN)
    clearShadowTree();
    cancelShadowTreeRecreation();
    svgUseLoadEventSender().cancelEvent(this);
#endif
}