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

Side by Side Diff: Source/core/svg/SVGElement.cpp

Issue 24863002: Revert 157959 "Introduce a new reference graph to SVG*TearOffs." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 ASSERT(inDocument() || !hasRelativeLengths()); 110 ASSERT(inDocument() || !hasRelativeLengths());
113 } 111 }
114 112
115 void SVGElement::willRecalcStyle(StyleRecalcChange change) 113 void SVGElement::willRecalcStyle(StyleRecalcChange change)
116 { 114 {
117 // FIXME: This assumes that when shouldNotifyRendererWithIdenticalStyles() i s true 115 // FIXME: This assumes that when shouldNotifyRendererWithIdenticalStyles() i s true
118 // the change came from a SMIL animation, but what if there were non-SMIL ch anges 116 // the change came from a SMIL animation, but what if there were non-SMIL ch anges
119 // since then? I think we should remove the shouldNotifyRendererWithIdentica lStyles 117 // since then? I think we should remove the shouldNotifyRendererWithIdentica lStyles
120 // check. 118 // check.
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 } 1139 }
1142 1140
1143 if (name == classAttr) 1141 if (name == classAttr)
1144 return true; 1142 return true;
1145 1143
1146 return animatableAttributes.contains(name); 1144 return animatableAttributes.contains(name);
1147 } 1145 }
1148 #endif 1146 #endif
1149 1147
1150 } 1148 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAnimateMotionElement.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698