Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1937)

Unified Diff: Source/core/svg/SVGUseElement.cpp

Issue 62083002: Remove support for the externalResourcesRequired attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGUseElement.cpp
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index fc7fc1166b0c7c15448318a815cb8f0f86a6429d..2f6e9281a358c08ba40416ab3241c2ce3e553b63 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -59,7 +59,6 @@ DEFINE_ANIMATED_LENGTH(SVGUseElement, SVGNames::yAttr, Y, y)
DEFINE_ANIMATED_LENGTH(SVGUseElement, SVGNames::widthAttr, Width, width)
DEFINE_ANIMATED_LENGTH(SVGUseElement, SVGNames::heightAttr, Height, height)
DEFINE_ANIMATED_STRING(SVGUseElement, XLinkNames::hrefAttr, Href, href)
-DEFINE_ANIMATED_BOOLEAN(SVGUseElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGUseElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(x)
@@ -67,7 +66,6 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGUseElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(width)
REGISTER_LOCAL_ANIMATED_PROPERTY(height)
REGISTER_LOCAL_ANIMATED_PROPERTY(href)
- REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
@@ -126,7 +124,6 @@ bool SVGUseElement::isSupportedAttribute(const QualifiedName& attrName)
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
if (supportedAttributes.isEmpty()) {
SVGLangSpace::addSupportedAttributes(supportedAttributes);
- SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
SVGURIReference::addSupportedAttributes(supportedAttributes);
supportedAttributes.add(SVGNames::xAttr);
supportedAttributes.add(SVGNames::yAttr);
@@ -151,7 +148,6 @@ void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString
else if (name == SVGNames::heightAttr)
setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
else if (SVGLangSpace::parseAttribute(name, value)
- || SVGExternalResourcesRequired::parseAttribute(name, value)
|| SVGURIReference::parseAttribute(name, value)) {
} else
ASSERT_NOT_REACHED();
@@ -174,9 +170,13 @@ Node::InsertionNotificationRequest SVGUseElement::insertedInto(ContainerNode* ro
return InsertionDone;
ASSERT(!m_targetElementInstance || !isWellFormedDocument(&document()));
ASSERT(!hasPendingResources() || !isWellFormedDocument(&document()));
- if (!m_wasInsertedByParser)
+ if (!m_wasInsertedByParser) {
buildPendingResource();
- SVGExternalResourcesRequired::insertedIntoDocument(this);
+
+ m_haveFiredLoadEvent = true;
+ sendSVGLoadEventIfPossibleAsynchronously();
+ }
+
return InsertionDone;
}
@@ -226,9 +226,6 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
return;
}
- if (SVGExternalResourcesRequired::handleAttributeChange(this, attrName))
- return;
-
if (SVGURIReference::isKnownAttribute(attrName)) {
bool isExternalReference = isExternalURIReference(hrefCurrentValue(), document());
if (isExternalReference) {
@@ -250,8 +247,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
if (!renderer)
return;
- if (SVGLangSpace::isKnownAttribute(attrName)
- || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
+ if (SVGLangSpace::isKnownAttribute(attrName)) {
invalidateShadowTree();
return;
}
@@ -951,8 +947,12 @@ void SVGUseElement::notifyFinished(Resource* resource)
invalidateShadowTree();
if (resource->errorOccurred())
dispatchEvent(Event::create(EventTypeNames::error));
- else if (!resource->wasCanceled())
- SVGExternalResourcesRequired::dispatchLoadEvent(this);
+ else if (!resource->wasCanceled()) {
+ if (!m_wasInsertedByParser)
+ ASSERT(m_haveFiredLoadEvent);
+ else if (m_haveFiredLoadEvent)
+ return;
+ }
}
bool SVGUseElement::resourceIsStillLoading()
@@ -978,7 +978,7 @@ bool SVGUseElement::instanceTreeIsLoading(SVGElementInstance* targetElementInsta
void SVGUseElement::finishParsingChildren()
{
SVGGraphicsElement::finishParsingChildren();
- SVGExternalResourcesRequired::finishParsingChildren();
+ m_haveFiredLoadEvent = true;
if (m_wasInsertedByParser) {
buildPendingResource();
m_wasInsertedByParser = false;

Powered by Google App Engine
This is Rietveld 408576698