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

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

Issue 18676002: Refactoring: Decouple ScriptElement from HTMLScriptElement and SVGScriptElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed a crash 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
Index: Source/core/svg/SVGScriptElement.h
diff --git a/Source/core/svg/SVGScriptElement.h b/Source/core/svg/SVGScriptElement.h
index 820d5b24dc1a756f3214037edfd458619f56bae3..4e80db423029e1f16391538064ab14c7c68f3778 100644
--- a/Source/core/svg/SVGScriptElement.h
+++ b/Source/core/svg/SVGScriptElement.h
@@ -31,16 +31,19 @@
namespace WebCore {
-class SVGScriptElement FINAL : public SVGElement
- , public SVGURIReference
- , public SVGExternalResourcesRequired
- , public ScriptElement {
+class SVGScriptElement FINAL
+ : public SVGElement
+ , public SVGURIReference
+ , public SVGExternalResourcesRequired
+ , public ScriptElementClient {
public:
static PassRefPtr<SVGScriptElement> create(const QualifiedName&, Document*, bool wasInsertedByParser);
String type() const;
void setType(const String&);
+ ScriptElement* scriptElement() const { return m_scriptElement.get(); }
+
private:
SVGScriptElement(const QualifiedName&, Document*, bool wasInsertedByParser, bool alreadyStarted);
@@ -72,9 +75,9 @@ private:
virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren();
// SVGExternalResourcesRequired
- virtual void setHaveFiredLoadEvent(bool haveFiredLoadEvent) { ScriptElement::setHaveFiredLoadEvent(haveFiredLoadEvent); }
- virtual bool isParserInserted() const { return ScriptElement::isParserInserted(); }
- virtual bool haveFiredLoadEvent() const { return ScriptElement::haveFiredLoadEvent(); }
+ virtual void setHaveFiredLoadEvent(bool haveFiredLoadEvent) { m_scriptElement->setHaveFiredLoadEvent(haveFiredLoadEvent); }
+ virtual bool isParserInserted() const { return m_scriptElement->isParserInserted(); }
+ virtual bool haveFiredLoadEvent() const { return m_scriptElement->haveFiredLoadEvent(); }
abarth-chromium 2013/07/08 18:47:12 I would move these into the CPP file.
virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadEventTimer; }
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGScriptElement)
@@ -84,6 +87,7 @@ private:
String m_type;
Timer<SVGElement> m_svgLoadEventTimer;
+ OwnPtr<ScriptElement> m_scriptElement;
};
inline SVGScriptElement* toSVGScriptElement(Node* node)

Powered by Google App Engine
This is Rietveld 408576698