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

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

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann
3 * <zimmermann@kde.org> 3 * <zimmermann@kde.org>
4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> 4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
5 * Copyright (C) 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 6 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 &word_spacingAttr, 471 &word_spacingAttr,
472 &writing_modeAttr, 472 &writing_modeAttr,
473 }; 473 };
474 for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrNames); i++) { 474 for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrNames); i++) {
475 CSSPropertyID propertyId = cssPropertyID(attrNames[i]->localName()); 475 CSSPropertyID propertyId = cssPropertyID(attrNames[i]->localName());
476 ASSERT(propertyId > 0); 476 ASSERT(propertyId > 0);
477 propertyNameToIdMap->set(attrNames[i]->localName().impl(), propertyId); 477 propertyNameToIdMap->set(attrNames[i]->localName().impl(), propertyId);
478 } 478 }
479 } 479 }
480 480
481 return propertyNameToIdMap->get(attrName.localName().impl()); 481 return propertyNameToIdMap->at(attrName.localName().impl());
482 } 482 }
483 483
484 void SVGElement::updateRelativeLengthsInformation(bool clientHasRelativeLengths, 484 void SVGElement::updateRelativeLengthsInformation(bool clientHasRelativeLengths,
485 SVGElement* clientElement) { 485 SVGElement* clientElement) {
486 ASSERT(clientElement); 486 ASSERT(clientElement);
487 487
488 // If we're not yet in a document, this function will be called again from 488 // If we're not yet in a document, this function will be called again from
489 // insertedInto(). Do nothing now. 489 // insertedInto(). Do nothing now.
490 if (!isConnected()) 490 if (!isConnected())
491 return; 491 return;
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 {vector_effectAttr, AnimatedString}, 738 {vector_effectAttr, AnimatedString},
739 {visibilityAttr, AnimatedString}, 739 {visibilityAttr, AnimatedString},
740 {word_spacingAttr, AnimatedLength}, 740 {word_spacingAttr, AnimatedLength},
741 }; 741 };
742 for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrToTypes); i++) 742 for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrToTypes); i++)
743 cssPropertyMap.set(attrToTypes[i].attr, attrToTypes[i].propType); 743 cssPropertyMap.set(attrToTypes[i].attr, attrToTypes[i].propType);
744 } 744 }
745 // If the attribute is not present in the map, this will return the "empty 745 // If the attribute is not present in the map, this will return the "empty
746 // value" per HashTraits - which is AnimatedUnknown. 746 // value" per HashTraits - which is AnimatedUnknown.
747 DCHECK_EQ(HashTraits<AnimatedPropertyType>::emptyValue(), AnimatedUnknown); 747 DCHECK_EQ(HashTraits<AnimatedPropertyType>::emptyValue(), AnimatedUnknown);
748 return cssPropertyMap.get(attributeName); 748 return cssPropertyMap.at(attributeName);
749 } 749 }
750 750
751 void SVGElement::addToPropertyMap(SVGAnimatedPropertyBase* property) { 751 void SVGElement::addToPropertyMap(SVGAnimatedPropertyBase* property) {
752 m_attributeToPropertyMap.set(property->attributeName(), property); 752 m_attributeToPropertyMap.set(property->attributeName(), property);
753 } 753 }
754 754
755 SVGAnimatedPropertyBase* SVGElement::propertyFromAttribute( 755 SVGAnimatedPropertyBase* SVGElement::propertyFromAttribute(
756 const QualifiedName& attributeName) const { 756 const QualifiedName& attributeName) const {
757 AttributeToPropertyMap::const_iterator it = 757 AttributeToPropertyMap::const_iterator it =
758 m_attributeToPropertyMap.find<SVGAttributeHashTranslator>(attributeName); 758 m_attributeToPropertyMap.find<SVGAttributeHashTranslator>(attributeName);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 m_attributeToPropertyMap.values().begin(); 973 m_attributeToPropertyMap.values().begin();
974 AttributeToPropertyMap::const_iterator::ValuesIterator end = 974 AttributeToPropertyMap::const_iterator::ValuesIterator end =
975 m_attributeToPropertyMap.values().end(); 975 m_attributeToPropertyMap.values().end();
976 for (; it != end; ++it) { 976 for (; it != end; ++it) {
977 if ((*it)->needsSynchronizeAttribute()) 977 if ((*it)->needsSynchronizeAttribute())
978 (*it)->synchronizeAttribute(); 978 (*it)->synchronizeAttribute();
979 } 979 }
980 980
981 elementData()->m_animatedSVGAttributesAreDirty = false; 981 elementData()->m_animatedSVGAttributesAreDirty = false;
982 } else { 982 } else {
983 SVGAnimatedPropertyBase* property = m_attributeToPropertyMap.get(name); 983 SVGAnimatedPropertyBase* property = m_attributeToPropertyMap.at(name);
984 if (property && property->needsSynchronizeAttribute()) 984 if (property && property->needsSynchronizeAttribute())
985 property->synchronizeAttribute(); 985 property->synchronizeAttribute();
986 } 986 }
987 } 987 }
988 988
989 PassRefPtr<ComputedStyle> SVGElement::customStyleForLayoutObject() { 989 PassRefPtr<ComputedStyle> SVGElement::customStyleForLayoutObject() {
990 if (!correspondingElement()) 990 if (!correspondingElement())
991 return document().ensureStyleResolver().styleForElement(this); 991 return document().ensureStyleResolver().styleForElement(this);
992 992
993 const ComputedStyle* style = nullptr; 993 const ComputedStyle* style = nullptr;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 visitor->trace(m_className); 1274 visitor->trace(m_className);
1275 Element::trace(visitor); 1275 Element::trace(visitor);
1276 } 1276 }
1277 1277
1278 const AtomicString& SVGElement::eventParameterName() { 1278 const AtomicString& SVGElement::eventParameterName() {
1279 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt")); 1279 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt"));
1280 return evtString; 1280 return evtString;
1281 } 1281 }
1282 1282
1283 } // namespace blink 1283 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698