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

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

Issue 1883773003: Simplify SVGElement::addToPropertyMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 673 }
674 674
675 if (cssPropertyMap.contains(attributeName)) 675 if (cssPropertyMap.contains(attributeName))
676 return cssPropertyMap.get(attributeName); 676 return cssPropertyMap.get(attributeName);
677 677
678 return AnimatedUnknown; 678 return AnimatedUnknown;
679 } 679 }
680 680
681 void SVGElement::addToPropertyMap(SVGAnimatedPropertyBase* property) 681 void SVGElement::addToPropertyMap(SVGAnimatedPropertyBase* property)
682 { 682 {
683 QualifiedName attributeName = property->attributeName(); 683 m_attributeToPropertyMap.set(property->attributeName(), property);
684 m_attributeToPropertyMap.set(attributeName, property);
685 } 684 }
686 685
687 SVGAnimatedPropertyBase* SVGElement::propertyFromAttribute(const QualifiedName& attributeName) const 686 SVGAnimatedPropertyBase* SVGElement::propertyFromAttribute(const QualifiedName& attributeName) const
688 { 687 {
689 AttributeToPropertyMap::const_iterator it = m_attributeToPropertyMap.find<SV GAttributeHashTranslator>(attributeName); 688 AttributeToPropertyMap::const_iterator it = m_attributeToPropertyMap.find<SV GAttributeHashTranslator>(attributeName);
690 if (it == m_attributeToPropertyMap.end()) 689 if (it == m_attributeToPropertyMap.end())
691 return nullptr; 690 return nullptr;
692 691
693 return it->value.get(); 692 return it->value.get();
694 } 693 }
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 Element::trace(visitor); 1176 Element::trace(visitor);
1178 } 1177 }
1179 1178
1180 const AtomicString& SVGElement::eventParameterName() 1179 const AtomicString& SVGElement::eventParameterName()
1181 { 1180 {
1182 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt")); 1181 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt"));
1183 return evtString; 1182 return evtString;
1184 } 1183 }
1185 1184
1186 } // namespace blink 1185 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698