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, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Animated property definitions | 52 // Animated property definitions |
53 DEFINE_ANIMATED_STRING(SVGStyledElement, HTMLNames::classAttr, ClassName, classN
ame) | 53 DEFINE_ANIMATED_STRING(SVGStyledElement, HTMLNames::classAttr, ClassName, classN
ame) |
54 | 54 |
55 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStyledElement) | 55 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGStyledElement) |
56 REGISTER_LOCAL_ANIMATED_PROPERTY(className) | 56 REGISTER_LOCAL_ANIMATED_PROPERTY(className) |
57 END_REGISTER_ANIMATED_PROPERTIES | 57 END_REGISTER_ANIMATED_PROPERTIES |
58 | 58 |
59 using namespace SVGNames; | 59 using namespace SVGNames; |
60 | 60 |
61 void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, CSSPropertyID>* proper
tyNameToIdMap, const QualifiedName& attrName) | 61 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName) |
62 { | 62 { |
63 // FIXME: when CSS supports "transform-origin" the special case for transfor
m_originAttr can be removed. | 63 // FIXME: when CSS supports "transform-origin" the special case for transfor
m_originAttr can be removed. |
64 CSSPropertyID propertyId = cssPropertyID(attrName.localName()); | 64 CSSPropertyID propertyId = cssPropertyID(attrName.localName()); |
65 if (!propertyId && attrName == transform_originAttr) | 65 if (!propertyId && attrName == transform_originAttr) |
66 propertyId = CSSPropertyWebkitTransformOrigin; // cssPropertyID("-webkit
-transform-origin") | 66 propertyId = CSSPropertyWebkitTransformOrigin; // cssPropertyID("-webkit
-transform-origin") |
67 ASSERT(propertyId > 0); | 67 ASSERT(propertyId > 0); |
68 propertyNameToIdMap->set(attrName.localName().impl(), propertyId); | 68 propertyNameToIdMap->set(attrName.localName().impl(), propertyId); |
69 } | 69 } |
70 | 70 |
71 SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* docum
ent, ConstructionType constructionType) | 71 SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* docum
ent, ConstructionType constructionType) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return Element::rendererIsNeeded(context); | 126 return Element::rendererIsNeeded(context); |
127 | 127 |
128 return false; | 128 return false; |
129 } | 129 } |
130 | 130 |
131 CSSPropertyID SVGStyledElement::cssPropertyIdForSVGAttributeName(const Qualified
Name& attrName) | 131 CSSPropertyID SVGStyledElement::cssPropertyIdForSVGAttributeName(const Qualified
Name& attrName) |
132 { | 132 { |
133 if (!attrName.namespaceURI().isNull()) | 133 if (!attrName.namespaceURI().isNull()) |
134 return CSSPropertyInvalid; | 134 return CSSPropertyInvalid; |
135 | 135 |
136 static HashMap<AtomicStringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; | 136 static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0; |
137 if (!propertyNameToIdMap) { | 137 if (!propertyNameToIdMap) { |
138 propertyNameToIdMap = new HashMap<AtomicStringImpl*, CSSPropertyID>; | 138 propertyNameToIdMap = new HashMap<StringImpl*, CSSPropertyID>; |
139 // This is a list of all base CSS and SVG CSS properties which are expos
ed as SVG XML attributes | 139 // This is a list of all base CSS and SVG CSS properties which are expos
ed as SVG XML attributes |
140 mapAttributeToCSSProperty(propertyNameToIdMap, alignment_baselineAttr); | 140 mapAttributeToCSSProperty(propertyNameToIdMap, alignment_baselineAttr); |
141 mapAttributeToCSSProperty(propertyNameToIdMap, baseline_shiftAttr); | 141 mapAttributeToCSSProperty(propertyNameToIdMap, baseline_shiftAttr); |
142 mapAttributeToCSSProperty(propertyNameToIdMap, buffered_renderingAttr); | 142 mapAttributeToCSSProperty(propertyNameToIdMap, buffered_renderingAttr); |
143 mapAttributeToCSSProperty(propertyNameToIdMap, clipAttr); | 143 mapAttributeToCSSProperty(propertyNameToIdMap, clipAttr); |
144 mapAttributeToCSSProperty(propertyNameToIdMap, clip_pathAttr); | 144 mapAttributeToCSSProperty(propertyNameToIdMap, clip_pathAttr); |
145 mapAttributeToCSSProperty(propertyNameToIdMap, clip_ruleAttr); | 145 mapAttributeToCSSProperty(propertyNameToIdMap, clip_ruleAttr); |
146 mapAttributeToCSSProperty(propertyNameToIdMap, SVGNames::colorAttr); | 146 mapAttributeToCSSProperty(propertyNameToIdMap, SVGNames::colorAttr); |
147 mapAttributeToCSSProperty(propertyNameToIdMap, color_interpolationAttr); | 147 mapAttributeToCSSProperty(propertyNameToIdMap, color_interpolationAttr); |
148 mapAttributeToCSSProperty(propertyNameToIdMap, color_interpolation_filte
rsAttr); | 148 mapAttributeToCSSProperty(propertyNameToIdMap, color_interpolation_filte
rsAttr); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 Element* eventTarget = const_cast<SVGStyledElement *>(this); | 476 Element* eventTarget = const_cast<SVGStyledElement *>(this); |
477 return eventTarget->hasEventListeners(eventNames().focusinEvent) || eventTar
get->hasEventListeners(eventNames().focusoutEvent); | 477 return eventTarget->hasEventListeners(eventNames().focusinEvent) || eventTar
get->hasEventListeners(eventNames().focusoutEvent); |
478 } | 478 } |
479 | 479 |
480 bool SVGStyledElement::isKeyboardFocusable(KeyboardEvent*) const | 480 bool SVGStyledElement::isKeyboardFocusable(KeyboardEvent*) const |
481 { | 481 { |
482 return isMouseFocusable(); | 482 return isMouseFocusable(); |
483 } | 483 } |
484 | 484 |
485 } | 485 } |
OLD | NEW |