Index: Source/core/svg/SVGElementInstance.h |
diff --git a/Source/core/svg/SVGElementInstance.h b/Source/core/svg/SVGElementInstance.h |
index 7f84692e179e4a106f01e40fdb695d33a6223c95..9eb484a8e6f8eff621b0470d41155ffb8893daed 100644 |
--- a/Source/core/svg/SVGElementInstance.h |
+++ b/Source/core/svg/SVGElementInstance.h |
@@ -24,7 +24,6 @@ |
#include "bindings/v8/ScriptWrappable.h" |
#include "core/dom/EventTarget.h" |
#include "core/platform/TreeShared.h" |
-#include "core/svg/SVGElement.h" |
namespace WebCore { |
@@ -33,17 +32,16 @@ template<class GenericNode, class GenericNodeContainer> |
void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer* container); |
}; |
-class SVGUseElement; |
+class Document; |
+class SVGElement; |
class SVGElementInstanceList; |
class SVGStyledElement; |
+class SVGUseElement; |
// SVGElementInstance mimics Node, but without providing all its functionality |
class SVGElementInstance : public EventTarget, public ScriptWrappable, public TreeShared<SVGElementInstance> { |
public: |
- static PassRefPtr<SVGElementInstance> create(SVGUseElement* correspondingUseElement, SVGUseElement* directUseElement, PassRefPtr<SVGElement> originalElement) |
- { |
- return adoptRef(new SVGElementInstance(correspondingUseElement, directUseElement, originalElement)); |
- } |
+ static PassRefPtr<SVGElementInstance> create(SVGUseElement* correspondingUseElement, SVGUseElement* directUseElement, PassRefPtr<SVGElement> originalElement); |
virtual ~SVGElementInstance(); |
@@ -75,7 +73,7 @@ public: |
SVGElementInstance* firstChild() const { return m_firstChild; } |
SVGElementInstance* lastChild() const { return m_lastChild; } |
- Document* ownerDocument() const { return m_element ? m_element->ownerDocument() : 0; } |
+ inline Document* ownerDocument() const; |
class InvalidationGuard { |
WTF_MAKE_NONCOPYABLE(InvalidationGuard); |
@@ -102,46 +100,46 @@ public: |
using TreeShared<SVGElementInstance>::deref; |
// EventTarget API |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), abort); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), blur); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), change); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), click); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), contextmenu); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dblclick); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), error); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), focus); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), input); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keydown); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keypress); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keyup); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), load); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousedown); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousemove); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseout); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseover); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseup); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousewheel); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforecut); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), cut); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforecopy); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), copy); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforepaste); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), paste); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragenter); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragover); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragleave); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), drop); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragstart); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), drag); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragend); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), reset); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), resize); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), scroll); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), search); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), select); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), selectstart); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), submit); |
- DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), unload); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), abort); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), blur); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), change); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), click); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), contextmenu); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dblclick); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), error); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), focus); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), input); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keydown); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keypress); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keyup); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), load); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousedown); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousemove); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseout); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseover); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseup); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousewheel); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforecut); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), cut); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforecopy); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), copy); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforepaste); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), paste); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragenter); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragover); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragleave); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), drop); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragstart); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), drag); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragend); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), reset); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), resize); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), scroll); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), search); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), select); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), selectstart); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), submit); |
+ DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), unload); |
private: |
friend class SVGUseElement; |
@@ -152,7 +150,7 @@ private: |
void removedLastRef(); |
bool hasTreeSharedParent() const { return !!m_parentInstance; } |
- virtual Node* toNode() { return shadowTreeElement(); } |
+ virtual Node* toNode(); |
void appendChild(PassRefPtr<SVGElementInstance> child); |
void setShadowTreeElement(SVGElement*); |