예제 #1
0
void SVGSMILElement::removedFrom(ContainerNode* rootParent) {
  if (rootParent->isConnected()) {
    clearResourceAndEventBaseReferences();
    clearConditions();
    setTargetElement(nullptr);
    setAttributeName(anyQName());
    animationAttributeChanged();
    m_timeContainer = nullptr;
  }

  SVGElement::removedFrom(rootParent);
}
SVGSMILElement::~SVGSMILElement()
{
#if !ENABLE(OILPAN)
    clearResourceAndEventBaseReferences();
    smilEndEventSender().cancelEvent(this);
    smilBeginEventSender().cancelEvent(this);
    smilRepeatEventSender().cancelEvent(this);
    smilRepeatNEventSender().cancelEvent(this);
    clearConditions();

    unscheduleIfScheduled();
#endif
}
예제 #3
0
SVGSMILElement::~SVGSMILElement()
{
#if !ENABLE(OILPAN)
    clearResourceAndEventBaseReferences();
#endif
    smilEndEventSender().cancelEvent(this);
    smilBeginEventSender().cancelEvent(this);
    smilRepeatEventSender().cancelEvent(this);
    smilRepeatNEventSender().cancelEvent(this);
#if !ENABLE(OILPAN)
    clearConditions();

    if (m_timeContainer && m_targetElement && hasValidAttributeName())
        m_timeContainer->unschedule(this, m_targetElement, m_attributeName);
#endif
}
예제 #4
0
void SVGSMILElement::buildPendingResource() {
  clearResourceAndEventBaseReferences();

  if (!isConnected()) {
    // Reset the target element if we are no longer in the document.
    setTargetElement(nullptr);
    return;
  }

  AtomicString id;
  const AtomicString& href = SVGURIReference::legacyHrefString(*this);
  Element* target;
  if (href.isEmpty())
    target = parentNode() && parentNode()->isElementNode()
                 ? toElement(parentNode())
                 : nullptr;
  else
    target =
        SVGURIReference::targetElementFromIRIString(href, treeScope(), &id);
  SVGElement* svgTarget =
      target && target->isSVGElement() ? toSVGElement(target) : nullptr;

  if (svgTarget && !svgTarget->isConnected())
    svgTarget = nullptr;

  if (svgTarget != targetElement())
    setTargetElement(svgTarget);

  if (!svgTarget) {
    // Do not register as pending if we are already pending this resource.
    if (document().accessSVGExtensions().isElementPendingResource(this, id))
      return;

    if (!id.isEmpty()) {
      document().accessSVGExtensions().addPendingResource(id, this);
      ASSERT(hasPendingResources());
    }
  } else {
    // Register us with the target in the dependencies map. Any change of
    // hrefElement that leads to relayout/repainting now informs us, so we can
    // react to it.
    addReferenceTo(svgTarget);
  }
  connectEventBaseConditions();
}