OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 SVGElement::SVGElement(const QualifiedName& tagName, Document& document, Constru
ctionType constructionType) | 72 SVGElement::SVGElement(const QualifiedName& tagName, Document& document, Constru
ctionType constructionType) |
73 : Element(tagName, &document, constructionType) | 73 : Element(tagName, &document, constructionType) |
74 { | 74 { |
75 ScriptWrappable::init(this); | 75 ScriptWrappable::init(this); |
76 registerAnimatedPropertiesForSVGElement(); | 76 registerAnimatedPropertiesForSVGElement(); |
77 setHasCustomStyleCallbacks(); | 77 setHasCustomStyleCallbacks(); |
78 } | 78 } |
79 | 79 |
80 SVGElement::~SVGElement() | 80 SVGElement::~SVGElement() |
81 { | 81 { |
82 SVGAnimatedProperty::detachAnimatedPropertiesWrappersForElement(this); | |
83 if (!hasSVGRareData()) | 82 if (!hasSVGRareData()) |
84 ASSERT(!SVGElementRareData::rareDataMap().contains(this)); | 83 ASSERT(!SVGElementRareData::rareDataMap().contains(this)); |
85 else { | 84 else { |
86 SVGElementRareData::SVGElementRareDataMap& rareDataMap = SVGElementRareD
ata::rareDataMap(); | 85 SVGElementRareData::SVGElementRareDataMap& rareDataMap = SVGElementRareD
ata::rareDataMap(); |
87 SVGElementRareData::SVGElementRareDataMap::iterator it = rareDataMap.fin
d(this); | 86 SVGElementRareData::SVGElementRareDataMap::iterator it = rareDataMap.fin
d(this); |
88 ASSERT(it != rareDataMap.end()); | 87 ASSERT(it != rareDataMap.end()); |
89 | 88 |
90 SVGElementRareData* rareData = it->value; | 89 SVGElementRareData* rareData = it->value; |
91 rareData->destroyAnimatedSMILStyleProperties(); | 90 rareData->destroyAnimatedSMILStyleProperties(); |
92 if (SVGCursorElement* cursorElement = rareData->cursorElement()) | 91 if (SVGCursorElement* cursorElement = rareData->cursorElement()) |
93 cursorElement->removeClient(this); | 92 cursorElement->removeClient(this); |
94 if (CSSCursorImageValue* cursorImageValue = rareData->cursorImageValue()
) | 93 if (CSSCursorImageValue* cursorImageValue = rareData->cursorImageValue()
) |
95 cursorImageValue->removeReferencedElement(this); | 94 cursorImageValue->removeReferencedElement(this); |
96 | 95 |
97 delete rareData; | 96 delete rareData; |
98 | 97 |
99 // The rare data cleanup may have caused other SVG nodes to be deleted, | 98 // The rare data cleanup may have caused other SVG nodes to be deleted, |
100 // modifying the rare data map. Do not rely on the existing iterator. | 99 // modifying the rare data map. Do not rely on the existing iterator. |
101 ASSERT(rareDataMap.contains(this)); | 100 ASSERT(rareDataMap.contains(this)); |
102 rareDataMap.remove(this); | 101 rareDataMap.remove(this); |
103 // Clear HasSVGRareData flag now so that we are in a consistent state wh
en | 102 // Clear HasSVGRareData flag now so that we are in a consistent state wh
en |
104 // calling rebuildAllElementReferencesForTarget() and | 103 // calling rebuildAllElementReferencesForTarget() and |
105 // removeAllElementReferencesForTarget() below. | 104 // removeAllElementReferencesForTarget() below. |
106 clearHasSVGRareData(); | 105 clearHasSVGRareData(); |
107 } | 106 } |
108 document().accessSVGExtensions()->rebuildAllElementReferencesForTarget(this)
; | 107 document().accessSVGExtensions()->rebuildAllElementReferencesForTarget(this)
; |
109 document().accessSVGExtensions()->removeAllElementReferencesForTarget(this); | 108 document().accessSVGExtensions()->removeAllElementReferencesForTarget(this); |
110 SVGAnimatedProperty::detachAnimatedPropertiesForElement(this); | |
111 } | 109 } |
112 | 110 |
113 void SVGElement::willRecalcStyle(StyleRecalcChange change) | 111 void SVGElement::willRecalcStyle(StyleRecalcChange change) |
114 { | 112 { |
115 // FIXME: This assumes that when shouldNotifyRendererWithIdenticalStyles() i
s true | 113 // FIXME: This assumes that when shouldNotifyRendererWithIdenticalStyles() i
s true |
116 // the change came from a SMIL animation, but what if there were non-SMIL ch
anges | 114 // the change came from a SMIL animation, but what if there were non-SMIL ch
anges |
117 // since then? I think we should remove the shouldNotifyRendererWithIdentica
lStyles | 115 // since then? I think we should remove the shouldNotifyRendererWithIdentica
lStyles |
118 // check. | 116 // check. |
119 if (!hasSVGRareData() || shouldNotifyRendererWithIdenticalStyles()) | 117 if (!hasSVGRareData() || shouldNotifyRendererWithIdenticalStyles()) |
120 return; | 118 return; |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 } | 1135 } |
1138 | 1136 |
1139 if (name == classAttr) | 1137 if (name == classAttr) |
1140 return true; | 1138 return true; |
1141 | 1139 |
1142 return animatableAttributes.contains(name); | 1140 return animatableAttributes.contains(name); |
1143 } | 1141 } |
1144 #endif | 1142 #endif |
1145 | 1143 |
1146 } | 1144 } |
OLD | NEW |