OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "core/svg/SVGTitleElement.h" | 48 #include "core/svg/SVGTitleElement.h" |
49 #include "core/svg/SVGUseElement.h" | 49 #include "core/svg/SVGUseElement.h" |
50 | 50 |
51 #include "wtf/TemporaryChange.h" | 51 #include "wtf/TemporaryChange.h" |
52 | 52 |
53 namespace WebCore { | 53 namespace WebCore { |
54 | 54 |
55 using namespace HTMLNames; | 55 using namespace HTMLNames; |
56 using namespace SVGNames; | 56 using namespace SVGNames; |
57 | 57 |
58 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName) | |
59 { | |
60 // FIXME: when CSS supports "transform-origin" the special case for transfor
m_originAttr can be removed. | |
61 // FIXME: It's not clear the above is strictly true, as -webkit-transform-or
igin has non-standard behavior. | |
62 CSSPropertyID propertyId = cssPropertyID(attrName.localName()); | |
63 if (!propertyId && attrName == transform_originAttr) { | |
64 propertyId = CSSPropertyWebkitTransformOrigin; // cssPropertyID("-webkit
-transform-origin") | |
65 } else if (propertyId == CSSPropertyTransformOrigin) { | |
66 propertyId = CSSPropertyWebkitTransformOrigin; | |
67 } | |
68 ASSERT(propertyId > 0); | |
69 propertyNameToIdMap->set(attrName.localName().impl(), propertyId); | |
70 } | |
71 | |
72 SVGElement::SVGElement(const QualifiedName& tagName, Document& document, Constru
ctionType constructionType) | 58 SVGElement::SVGElement(const QualifiedName& tagName, Document& document, Constru
ctionType constructionType) |
73 : Element(tagName, &document, constructionType) | 59 : Element(tagName, &document, constructionType) |
74 #if ASSERT_ENABLED | 60 #if ASSERT_ENABLED |
75 , m_inRelativeLengthClientsInvalidation(false) | 61 , m_inRelativeLengthClientsInvalidation(false) |
76 #endif | 62 #endif |
77 // |m_isContextElement| must be initialized before |m_className|, as SVGAnim
atedString tear-off c-tor currently set this to true. | 63 // |m_isContextElement| must be initialized before |m_className|, as SVGAnim
atedString tear-off c-tor currently set this to true. |
78 , m_isContextElement(false) | 64 , m_isContextElement(false) |
79 , m_SVGRareData(nullptr) | 65 , m_SVGRareData(nullptr) |
80 , m_className(SVGAnimatedString::create(this, HTMLNames::classAttr, SVGStrin
g::create())) | 66 , m_className(SVGAnimatedString::create(this, HTMLNames::classAttr, SVGStrin
g::create())) |
81 { | 67 { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 312 |
327 void SVGElement::childrenChanged(bool changedByParser, Node* beforeChange, Node*
afterChange, int childCountDelta) | 313 void SVGElement::childrenChanged(bool changedByParser, Node* beforeChange, Node*
afterChange, int childCountDelta) |
328 { | 314 { |
329 Element::childrenChanged(changedByParser, beforeChange, afterChange, childCo
untDelta); | 315 Element::childrenChanged(changedByParser, beforeChange, afterChange, childCo
untDelta); |
330 | 316 |
331 // Invalidate all instances associated with us. | 317 // Invalidate all instances associated with us. |
332 if (!changedByParser) | 318 if (!changedByParser) |
333 invalidateInstances(); | 319 invalidateInstances(); |
334 } | 320 } |
335 | 321 |
| 322 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName) |
| 323 { |
| 324 CSSPropertyID propertyId = cssPropertyID(attrName.localName()); |
| 325 ASSERT(propertyId > 0); |
| 326 propertyNameToIdMap->set(attrName.localName().impl(), propertyId); |
| 327 } |
| 328 |
336 CSSPropertyID SVGElement::cssPropertyIdForSVGAttributeName(const QualifiedName&
attrName) | 329 CSSPropertyID SVGElement::cssPropertyIdForSVGAttributeName(const QualifiedName&
attrName) |
337 { | 330 { |
338 if (!attrName.namespaceURI().isNull()) | 331 if (!attrName.namespaceURI().isNull()) |
339 return CSSPropertyInvalid; | 332 return CSSPropertyInvalid; |
340 | 333 |
341 static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; | 334 static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; |
342 if (!propertyNameToIdMap) { | 335 if (!propertyNameToIdMap) { |
343 propertyNameToIdMap = new HashMap<StringImpl*, CSSPropertyID>; | 336 propertyNameToIdMap = new HashMap<StringImpl*, CSSPropertyID>; |
344 // This is a list of all base CSS and SVG CSS properties which are expos
ed as SVG XML attributes | 337 // This is a list of all base CSS and SVG CSS properties which are expos
ed as SVG XML attributes |
345 mapAttributeToCSSProperty(propertyNameToIdMap, alignment_baselineAttr); | 338 mapAttributeToCSSProperty(propertyNameToIdMap, alignment_baselineAttr); |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 Element::trace(visitor); | 1211 Element::trace(visitor); |
1219 } | 1212 } |
1220 | 1213 |
1221 const AtomicString& SVGElement::eventParameterName() | 1214 const AtomicString& SVGElement::eventParameterName() |
1222 { | 1215 { |
1223 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con
structFromLiteral)); | 1216 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con
structFromLiteral)); |
1224 return evtString; | 1217 return evtString; |
1225 } | 1218 } |
1226 | 1219 |
1227 } | 1220 } |
OLD | NEW |