Ejemplo n.º 1
0
SVGUseElement::~SVGUseElement()
{
    setDocumentResource(0);
#if !ENABLE(OILPAN)
    clearResourceReferences();
#endif
}
Ejemplo n.º 2
0
void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
{
    if (attrName == SVGNames::xAttr
        || attrName == SVGNames::yAttr
        || attrName == SVGNames::widthAttr
        || attrName == SVGNames::heightAttr) {
        SVGElement::InvalidationGuard invalidationGuard(this);

        if (attrName == SVGNames::xAttr
            || attrName == SVGNames::yAttr) {
            invalidateSVGPresentationAttributeStyle();
            setNeedsStyleRecalc(LocalStyleChange,
                StyleChangeReasonForTracing::fromAttribute(attrName));
        }

        updateRelativeLengthsInformation();
        if (m_targetElementInstance) {
            ASSERT(m_targetElementInstance->correspondingElement());
            transferUseWidthAndHeightIfNeeded(*this, m_targetElementInstance.get(), *m_targetElementInstance->correspondingElement());
        }

        LayoutObject* object = this->layoutObject();
        if (object)
            markForLayoutAndParentResourceInvalidation(object);
        return;
    }

    if (SVGURIReference::isKnownAttribute(attrName)) {
        SVGElement::InvalidationGuard invalidationGuard(this);
        if (isStructurallyExternal()) {
            KURL url = document().completeURL(hrefString());
            const KURL& existingURL = m_resource ? m_resource->url() : KURL();
            if (url.hasFragmentIdentifier() && !equalIgnoringFragmentIdentifier(url, existingURL)) {
                FetchRequest request(ResourceRequest(url), localName());
                setDocumentResource(DocumentResource::fetchSVGDocument(request, document().fetcher()));
            }
        } else {
            setDocumentResource(nullptr);
        }

        invalidateShadowTree();

        return;
    }

    SVGGraphicsElement::svgAttributeChanged(attrName);
}
Ejemplo n.º 3
0
void SVGUseElement::updateTargetReference() {
  SVGURLReferenceResolver resolver(hrefString(), document());
  m_elementIdentifier = resolver.fragmentIdentifier();
  m_elementIdentifierIsLocal = resolver.isLocal();
  if (m_elementIdentifierIsLocal) {
    setDocumentResource(nullptr);
    return;
  }
  KURL resolvedUrl = resolver.absoluteUrl();
  if (m_elementIdentifier.isEmpty() ||
      (m_resource &&
       equalIgnoringFragmentIdentifier(resolvedUrl, m_resource->url())))
    return;
  FetchRequest request(ResourceRequest(resolvedUrl), localName());
  setDocumentResource(
      DocumentResource::fetchSVGDocument(request, document().fetcher()));
}
Ejemplo n.º 4
0
SVGUseElement::~SVGUseElement()
{
    setDocumentResource(0);
#if !ENABLE(OILPAN)
    clearShadowTree();
    cancelShadowTreeRecreation();
    svgUseLoadEventSender().cancelEvent(this);
#endif
}
Ejemplo n.º 5
0
SVGUseElement::~SVGUseElement()
{
    setDocumentResource(0);

    clearResourceReferences();
}
Ejemplo n.º 6
0
void SVGUseElement::dispose() {
  setDocumentResource(nullptr);
}