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

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

Issue 62083002: Remove support for the externalResourcesRequired attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline test Created 6 years, 11 months 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
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | Source/core/svg/SVGScriptElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGScriptElement.cpp
diff --git a/Source/core/svg/SVGScriptElement.cpp b/Source/core/svg/SVGScriptElement.cpp
index f5956167dc25fe0052ffa6cf5fad8e074494eba0..5563f095c1d033d7a87ac0194078615ae647f49c 100644
--- a/Source/core/svg/SVGScriptElement.cpp
+++ b/Source/core/svg/SVGScriptElement.cpp
@@ -36,11 +36,9 @@ namespace WebCore {
// Animated property definitions
DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href)
-DEFINE_ANIMATED_BOOLEAN(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(href)
- REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGScriptElement::SVGScriptElement(Document& document, bool wasInsertedByParser, bool alreadyStarted)
@@ -62,7 +60,6 @@ bool SVGScriptElement::isSupportedAttribute(const QualifiedName& attrName)
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
if (supportedAttributes.isEmpty()) {
SVGURIReference::addSupportedAttributes(supportedAttributes);
- SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
supportedAttributes.add(SVGNames::typeAttr);
supportedAttributes.add(HTMLNames::onerrorAttr);
}
@@ -88,8 +85,6 @@ void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicStr
if (SVGURIReference::parseAttribute(name, value))
return;
- if (SVGExternalResourcesRequired::parseAttribute(name, value))
- return;
ASSERT_NOT_REACHED();
}
@@ -111,9 +106,6 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
return;
}
- if (SVGExternalResourcesRequired::handleAttributeChange(this, attrName))
- return;
-
ASSERT_NOT_REACHED();
}
@@ -126,7 +118,11 @@ Node::InsertionNotificationRequest SVGScriptElement::insertedInto(ContainerNode*
void SVGScriptElement::didNotifySubtreeInsertionsToDocument()
{
m_loader->didNotifySubtreeInsertionsToDocument();
- SVGExternalResourcesRequired::insertedIntoDocument(this);
+
+ if (!m_loader->isParserInserted()) {
+ m_loader->setHaveFiredLoadEvent(true);
+ sendSVGLoadEventIfPossibleAsynchronously();
+ }
}
void SVGScriptElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
@@ -143,7 +139,7 @@ bool SVGScriptElement::isURLAttribute(const Attribute& attribute) const
void SVGScriptElement::finishParsingChildren()
{
SVGElement::finishParsingChildren();
- SVGExternalResourcesRequired::finishParsingChildren();
+ m_loader->setHaveFiredLoadEvent(true);
}
String SVGScriptElement::type() const
@@ -156,6 +152,11 @@ void SVGScriptElement::setType(const String& type)
m_type = type;
}
+bool SVGScriptElement::haveLoadedRequiredResources()
+{
+ return m_loader->haveFiredLoadEvent();
+}
+
String SVGScriptElement::sourceAttributeValue() const
{
return hrefCurrentValue();
@@ -206,24 +207,9 @@ PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
return adoptRef(new SVGScriptElement(document(), false, m_loader->alreadyStarted()));
}
-void SVGScriptElement::setHaveFiredLoadEvent(bool haveFiredLoadEvent)
-{
- m_loader->setHaveFiredLoadEvent(haveFiredLoadEvent);
-}
-
-bool SVGScriptElement::isParserInserted() const
-{
- return m_loader->isParserInserted();
-}
-
-bool SVGScriptElement::haveFiredLoadEvent() const
-{
- return m_loader->haveFiredLoadEvent();
-}
-
-Timer<SVGElement>* SVGScriptElement::svgLoadEventTimer()
+void SVGScriptElement::dispatchLoadEvent()
{
- return &m_svgLoadEventTimer;
+ dispatchEvent(Event::create(EventTypeNames::load));
}
}
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | Source/core/svg/SVGScriptElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698