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

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

Issue 421863002: SVGElement::parseAttribute resolves property via property map (Step 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 } else { 595 } else {
596 // standard events 596 // standard events
597 const AtomicString& eventName = HTMLElement::eventNameForAttributeName(n ame); 597 const AtomicString& eventName = HTMLElement::eventNameForAttributeName(n ame);
598 if (!eventName.isNull()) 598 if (!eventName.isNull())
599 setAttributeEventListener(eventName, createAttributeEventListener(th is, name, value, eventParameterName())); 599 setAttributeEventListener(eventName, createAttributeEventListener(th is, name, value, eventParameterName()));
600 else 600 else
601 Element::parseAttribute(name, value); 601 Element::parseAttribute(name, value);
602 } 602 }
603 } 603 }
604 604
605 void SVGElement::parseAttributeNew(const QualifiedName& name, const AtomicString & value)
606 {
607 RefPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name);
608 if (property) {
609 SVGParsingError parseError = NoError;
610 property->setBaseValueAsString(value, parseError);
611 reportAttributeParsingError(parseError, name, value);
612 }
613
614 SVGElement::parseAttribute(name, value);
615 }
616
605 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap; 617 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap;
606 AnimatedPropertyType SVGElement::animatedPropertyTypeForCSSAttribute(const Quali fiedName& attributeName) 618 AnimatedPropertyType SVGElement::animatedPropertyTypeForCSSAttribute(const Quali fiedName& attributeName)
607 { 619 {
608 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, cssPropertyMap, ()); 620 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, cssPropertyMap, ());
609 621
610 if (cssPropertyMap.isEmpty()) { 622 if (cssPropertyMap.isEmpty()) {
611 // Fill the map for the first use. 623 // Fill the map for the first use.
612 cssPropertyMap.set(alignment_baselineAttr, AnimatedString); 624 cssPropertyMap.set(alignment_baselineAttr, AnimatedString);
613 cssPropertyMap.set(baseline_shiftAttr, AnimatedString); 625 cssPropertyMap.set(baseline_shiftAttr, AnimatedString);
614 cssPropertyMap.set(buffered_renderingAttr, AnimatedString); 626 cssPropertyMap.set(buffered_renderingAttr, AnimatedString);
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 Element::trace(visitor); 1179 Element::trace(visitor);
1168 } 1180 }
1169 1181
1170 const AtomicString& SVGElement::eventParameterName() 1182 const AtomicString& SVGElement::eventParameterName()
1171 { 1183 {
1172 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con structFromLiteral)); 1184 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con structFromLiteral));
1173 return evtString; 1185 return evtString;
1174 } 1186 }
1175 1187
1176 } 1188 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698