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

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: Add return 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
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGGraphicsElement.cpp » ('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 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 return;
614 }
615
616 SVGElement::parseAttribute(name, value);
617 }
618
605 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap; 619 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap;
606 AnimatedPropertyType SVGElement::animatedPropertyTypeForCSSAttribute(const Quali fiedName& attributeName) 620 AnimatedPropertyType SVGElement::animatedPropertyTypeForCSSAttribute(const Quali fiedName& attributeName)
607 { 621 {
608 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, cssPropertyMap, ()); 622 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, cssPropertyMap, ());
609 623
610 if (cssPropertyMap.isEmpty()) { 624 if (cssPropertyMap.isEmpty()) {
611 // Fill the map for the first use. 625 // Fill the map for the first use.
612 cssPropertyMap.set(alignment_baselineAttr, AnimatedString); 626 cssPropertyMap.set(alignment_baselineAttr, AnimatedString);
613 cssPropertyMap.set(baseline_shiftAttr, AnimatedString); 627 cssPropertyMap.set(baseline_shiftAttr, AnimatedString);
614 cssPropertyMap.set(buffered_renderingAttr, AnimatedString); 628 cssPropertyMap.set(buffered_renderingAttr, AnimatedString);
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 Element::trace(visitor); 1181 Element::trace(visitor);
1168 } 1182 }
1169 1183
1170 const AtomicString& SVGElement::eventParameterName() 1184 const AtomicString& SVGElement::eventParameterName()
1171 { 1185 {
1172 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con structFromLiteral)); 1186 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con structFromLiteral));
1173 return evtString; 1187 return evtString;
1174 } 1188 }
1175 1189
1176 } 1190 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGGraphicsElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698