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

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

Issue 321023002: Avoid branching in createAttributeEventListener (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove leftover line Created 6 years, 6 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 <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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 SVGParsingError parseError = NoError; 668 SVGParsingError parseError = NoError;
669 m_className->setBaseValueAsString(value, parseError); 669 m_className->setBaseValueAsString(value, parseError);
670 reportAttributeParsingError(parseError, name, value); 670 reportAttributeParsingError(parseError, name, value);
671 } else if (name.matches(XMLNames::langAttr) || name.matches(XMLNames::spaceA ttr)) { 671 } else if (name.matches(XMLNames::langAttr) || name.matches(XMLNames::spaceA ttr)) {
672 } else if (name == tabindexAttr) { 672 } else if (name == tabindexAttr) {
673 Element::parseAttribute(name, value); 673 Element::parseAttribute(name, value);
674 } else { 674 } else {
675 // standard events 675 // standard events
676 const AtomicString& eventName = HTMLElement::eventNameForAttributeName(n ame); 676 const AtomicString& eventName = HTMLElement::eventNameForAttributeName(n ame);
677 if (!eventName.isNull()) 677 if (!eventName.isNull())
678 setAttributeEventListener(eventName, createAttributeEventListener(th is, name, value)); 678 setAttributeEventListener(eventName, createAttributeEventListener(th is, name, value, eventParameterName()));
679 else 679 else
680 Element::parseAttribute(name, value); 680 Element::parseAttribute(name, value);
681 } 681 }
682 } 682 }
683 683
684 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap; 684 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap;
685 AnimatedPropertyType SVGElement::animatedPropertyTypeForCSSAttribute(const Quali fiedName& attributeName) 685 AnimatedPropertyType SVGElement::animatedPropertyTypeForCSSAttribute(const Quali fiedName& attributeName)
686 { 686 {
687 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, cssPropertyMap, ()); 687 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, cssPropertyMap, ());
688 688
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 } 1169 }
1170 #endif 1170 #endif
1171 1171
1172 void SVGElement::trace(Visitor* visitor) 1172 void SVGElement::trace(Visitor* visitor)
1173 { 1173 {
1174 visitor->trace(m_elementsWithRelativeLengths); 1174 visitor->trace(m_elementsWithRelativeLengths);
1175 visitor->trace(m_SVGRareData); 1175 visitor->trace(m_SVGRareData);
1176 Element::trace(visitor); 1176 Element::trace(visitor);
1177 } 1177 }
1178 1178
1179 const AtomicString& SVGElement::eventParameterName()
1180 {
1181 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt"));
haraken 2014/06/10 15:05:32 Use DEFINE_STATIC_LOCAL(const AtomicString, evtStr
1182 return evtString;
1179 } 1183 }
1184
1185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698