23 #ifndef SVGUseElement_h
24 #define SVGUseElement_h
35 class SVGElementInstance;
38 class SVGUseElement :
public SVGStyledTransformableElement,
41 public SVGExternalResourcesRequired,
42 public SVGURIReference {
44 SVGUseElement(
const QualifiedName&, Document*);
45 virtual ~SVGUseElement();
47 SVGElementInstance* instanceRoot()
const;
48 SVGElementInstance* animatedInstanceRoot()
const;
50 virtual bool isValid()
const {
return SVGTests::isValid(); }
52 virtual void insertedIntoDocument();
53 virtual void removedFromDocument();
54 virtual void buildPendingResource();
56 virtual void parseMappedAttribute(MappedAttribute*);
57 using DOM::NodeImpl::childrenChanged;
58 virtual void childrenChanged(
bool changedByParser =
false, Node* beforeChange = 0, Node* afterChange = 0,
int childCountDelta = 0);
60 virtual void svgAttributeChanged(
const QualifiedName&);
61 virtual void recalcStyle(StyleChange = NoChange);
63 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
64 virtual void attach();
65 virtual void detach();
67 virtual Path toClipPath()
const;
69 static void removeDisallowedElementsFromSubtree(Node* element);
74 virtual const SVGElement* contextElement()
const {
return this; }
77 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired,
bool, ExternalResourcesRequired, externalResourcesRequired)
78 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference,
String, Href, href)
80 ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGLength, SVGLength, X, x)
81 ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGLength, SVGLength, Y, y)
82 ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGLength, SVGLength, Width, width)
83 ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGLength, SVGLength, Height, height)
86 friend class SVGElement;
87 SVGElementInstance* instanceForShadowTreeElement(Node* element) const;
91 void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance,
bool& foundCycle);
92 void handleDeepUseReferencing(SVGElement* use, SVGElementInstance* targetInstance,
bool& foundCycle);
95 PassRefPtr<SVGSVGElement> buildShadowTreeForSymbolTag(SVGElement* target, SVGElementInstance* targetInstance);
96 void alterShadowTreeForSVGTag(SVGElement* target);
98 void buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance);
100 #if ENABLE(SVG) && ENABLE(SVG_USE)
101 void expandUseElementsInShadowTree(Node* element);
102 void expandSymbolElementsInShadowTree(Node* element);
105 void attachShadowTree();
108 void associateInstancesWithShadowTreeElements(Node* target, SVGElementInstance* targetInstance);
110 SVGElementInstance* instanceForShadowTreeElement(Node* element, SVGElementInstance* instance)
const;
111 void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to)
const;
113 RefPtr<SVGElement> m_shadowTreeRootElement;
114 RefPtr<SVGElementInstance> m_targetElementInstance;
119 #endif // ENABLE(SVG)
DOM::QualifiedName useTag