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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName ToIdMap, const QualifiedName& attrName) 63 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName ToIdMap, const QualifiedName& attrName)
64 { 64 {
65 // FIXME: when CSS supports "transform-origin" the special case for transfor m_originAttr can be removed. 65 // FIXME: when CSS supports "transform-origin" the special case for transfor m_originAttr can be removed.
66 CSSPropertyID propertyId = cssPropertyID(attrName.localName()); 66 CSSPropertyID propertyId = cssPropertyID(attrName.localName());
67 if (!propertyId && attrName == transform_originAttr) 67 if (!propertyId && attrName == transform_originAttr)
68 propertyId = CSSPropertyWebkitTransformOrigin; // cssPropertyID("-webkit -transform-origin") 68 propertyId = CSSPropertyWebkitTransformOrigin; // cssPropertyID("-webkit -transform-origin")
69 ASSERT(propertyId > 0); 69 ASSERT(propertyId > 0);
70 propertyNameToIdMap->set(attrName.localName().impl(), propertyId); 70 propertyNameToIdMap->set(attrName.localName().impl(), propertyId);
71 } 71 }
72 72
73 SVGElement::SVGElement(const QualifiedName& tagName, Document* document, Constru ctionType constructionType) 73 SVGElement::SVGElement(const QualifiedName& tagName, Document& document, Constru ctionType constructionType)
74 : Element(tagName, document, constructionType) 74 : Element(tagName, &document, constructionType)
75 { 75 {
76 ScriptWrappable::init(this); 76 ScriptWrappable::init(this);
77 registerAnimatedPropertiesForSVGElement(); 77 registerAnimatedPropertiesForSVGElement();
78 setHasCustomStyleCallbacks(); 78 setHasCustomStyleCallbacks();
79 } 79 }
80 80
81 PassRefPtr<SVGElement> SVGElement::create(const QualifiedName& tagName, Document * document)
82 {
83 return adoptRef(new SVGElement(tagName, document));
84 }
85
86 SVGElement::~SVGElement() 81 SVGElement::~SVGElement()
87 { 82 {
88 if (!hasSVGRareData()) 83 if (!hasSVGRareData())
89 ASSERT(!SVGElementRareData::rareDataMap().contains(this)); 84 ASSERT(!SVGElementRareData::rareDataMap().contains(this));
90 else { 85 else {
91 SVGElementRareData::SVGElementRareDataMap& rareDataMap = SVGElementRareD ata::rareDataMap(); 86 SVGElementRareData::SVGElementRareDataMap& rareDataMap = SVGElementRareD ata::rareDataMap();
92 SVGElementRareData::SVGElementRareDataMap::iterator it = rareDataMap.fin d(this); 87 SVGElementRareData::SVGElementRareDataMap::iterator it = rareDataMap.fin d(this);
93 ASSERT(it != rareDataMap.end()); 88 ASSERT(it != rareDataMap.end());
94 89
95 SVGElementRareData* rareData = it->value; 90 SVGElementRareData* rareData = it->value;
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 } 1137 }
1143 1138
1144 if (name == classAttr) 1139 if (name == classAttr)
1145 return true; 1140 return true;
1146 1141
1147 return animatableAttributes.contains(name); 1142 return animatableAttributes.contains(name);
1148 } 1143 }
1149 #endif 1144 #endif
1150 1145
1151 } 1146 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698