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

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

Issue 18676002: Refactoring: Decouple ScriptElement from HTMLScriptElement and SVGScriptElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed points Created 7 years, 5 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') | no next file » | 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 5076a3ccaa3ddd485697c7b2a1de5029e3db5ae8..d7c68faba3e0a1eb29e6e655f2986ceb0e0e1579 100644
--- a/Source/core/svg/SVGScriptElement.cpp
+++ b/Source/core/svg/SVGScriptElement.cpp
@@ -44,8 +44,8 @@ END_REGISTER_ANIMATED_PROPERTIES
inline SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document* document, bool wasInsertedByParser, bool alreadyStarted)
: SVGElement(tagName, document)
- , ScriptElement(this, wasInsertedByParser, alreadyStarted)
, m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired)
+ , m_scriptElement(ScriptElement::create(this, wasInsertedByParser, alreadyStarted))
{
ASSERT(hasTagName(SVGNames::scriptTag));
ScriptWrappable::init(this);
@@ -107,7 +107,7 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
return;
if (SVGURIReference::isKnownAttribute(attrName)) {
- handleSourceAttribute(href());
+ m_scriptElement->handleSourceAttribute(href());
return;
}
@@ -120,7 +120,7 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
Node::InsertionNotificationRequest SVGScriptElement::insertedInto(ContainerNode* rootParent)
{
SVGElement::insertedInto(rootParent);
- ScriptElement::insertedInto(rootParent);
+ m_scriptElement->insertedInto(rootParent);
if (rootParent->inDocument())
SVGExternalResourcesRequired::insertedIntoDocument(this);
return InsertionDone;
@@ -129,7 +129,7 @@ Node::InsertionNotificationRequest SVGScriptElement::insertedInto(ContainerNode*
void SVGScriptElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- ScriptElement::childrenChanged();
+ m_scriptElement->childrenChanged();
}
bool SVGScriptElement::isURLAttribute(const Attribute& attribute) const
@@ -207,7 +207,27 @@ bool SVGScriptElement::hasSourceAttribute() const
PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
{
- return adoptRef(new SVGScriptElement(tagQName(), document(), false, alreadyStarted()));
+ return adoptRef(new SVGScriptElement(tagQName(), document(), false, m_scriptElement->alreadyStarted()));
+}
+
+void SVGScriptElement::setHaveFiredLoadEvent(bool haveFiredLoadEvent)
+{
+ m_scriptElement->setHaveFiredLoadEvent(haveFiredLoadEvent);
+}
+
+bool SVGScriptElement::isParserInserted() const
+{
+ return m_scriptElement->isParserInserted();
+}
+
+bool SVGScriptElement::haveFiredLoadEvent() const
+{
+ return m_scriptElement->haveFiredLoadEvent();
+}
+
+Timer<SVGElement>* SVGScriptElement::svgLoadEventTimer()
+{
+ return &m_svgLoadEventTimer;
}
}
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698