Chromium Code Reviews| Index: Source/core/svg/SVGScriptElement.cpp |
| diff --git a/Source/core/svg/SVGScriptElement.cpp b/Source/core/svg/SVGScriptElement.cpp |
| index 832dfba8a2aaab7a6ec9b92df0b105173b0f85a4..d4e5c364b6b2f6d1bb490a11eb3b4dfc8d77790b 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(const QualifiedName& tagName, Document& document, bool wasInsertedByParser, bool alreadyStarted) |
| @@ -63,7 +61,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); |
| } |
| @@ -89,8 +86,6 @@ void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicStr |
| if (SVGURIReference::parseAttribute(name, value)) |
| return; |
| - if (SVGExternalResourcesRequired::parseAttribute(name, value)) |
| - return; |
| ASSERT_NOT_REACHED(); |
| } |
| @@ -112,9 +107,6 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName) |
| return; |
| } |
| - if (SVGExternalResourcesRequired::handleAttributeChange(this, attrName)) |
| - return; |
| - |
| ASSERT_NOT_REACHED(); |
| } |
| @@ -127,7 +119,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) |
| @@ -144,7 +140,7 @@ bool SVGScriptElement::isURLAttribute(const Attribute& attribute) const |
| void SVGScriptElement::finishParsingChildren() |
| { |
| SVGElement::finishParsingChildren(); |
| - SVGExternalResourcesRequired::finishParsingChildren(); |
| + m_loader->setHaveFiredLoadEvent(true); |
| } |
| String SVGScriptElement::type() const |
| @@ -164,6 +160,11 @@ void SVGScriptElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons |
| addSubresourceURL(urls, document().completeURL(hrefCurrentValue())); |
| } |
| +bool SVGScriptElement::haveLoadedRequiredResources() |
| +{ |
| + return m_loader->haveFiredLoadEvent(); |
| +} |
| + |
| String SVGScriptElement::sourceAttributeValue() const |
| { |
| return hrefCurrentValue(); |
| @@ -214,24 +215,12 @@ PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren() |
| return adoptRef(new SVGScriptElement(tagQName(), 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 |
| +void SVGScriptElement::dispatchLoadEvent() |
|
Stephen Chennney
2013/11/06 16:45:43
This effectively does nothing except assert. What
Erik Dahlström (inactive)
2013/11/07 09:38:04
I've copied the code from SVGExternalResourcesRequ
|
| { |
| - return m_loader->haveFiredLoadEvent(); |
| -} |
| - |
| -Timer<SVGElement>* SVGScriptElement::svgLoadEventTimer() |
| -{ |
| - return &m_svgLoadEventTimer; |
| + if (!m_loader->isParserInserted()) |
| + ASSERT(m_loader->haveFiredLoadEvent()); |
| + else if (m_loader->haveFiredLoadEvent()) |
| + return; |
| } |
| } |