| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 if (!attr) | 288 if (!attr) |
| 289 return 0; | 289 return 0; |
| 290 | 290 |
| 291 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(SVGA
ttributeMode); | 291 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(SVGA
ttributeMode); |
| 292 CSSPropertyID propertyID = SVGElement::cssPropertyIdForSVGAttributeName(attr
->name()); | 292 CSSPropertyID propertyID = SVGElement::cssPropertyIdForSVGAttributeName(attr
->name()); |
| 293 style->setProperty(propertyID, attr->value()); | 293 style->setProperty(propertyID, attr->value()); |
| 294 RefPtr<CSSValue> cssValue = style->getPropertyCSSValue(propertyID); | 294 RefPtr<CSSValue> cssValue = style->getPropertyCSSValue(propertyID); |
| 295 return cssValue ? cssValue->cloneForCSSOM() : 0; | 295 return cssValue ? cssValue->cloneForCSSOM() : 0; |
| 296 } | 296 } |
| 297 | 297 |
| 298 bool SVGElement::isKnownAttribute(const QualifiedName& attrName) | |
| 299 { | |
| 300 return isIdAttributeName(attrName); | |
| 301 } | |
| 302 | 298 |
| 303 bool SVGElement::instanceUpdatesBlocked() const | 299 bool SVGElement::instanceUpdatesBlocked() const |
| 304 { | 300 { |
| 305 return hasSVGRareData() && svgRareData()->instanceUpdatesBlocked(); | 301 return hasSVGRareData() && svgRareData()->instanceUpdatesBlocked(); |
| 306 } | 302 } |
| 307 | 303 |
| 308 void SVGElement::setInstanceUpdatesBlocked(bool value) | 304 void SVGElement::setInstanceUpdatesBlocked(bool value) |
| 309 { | 305 { |
| 310 if (hasSVGRareData()) | 306 if (hasSVGRareData()) |
| 311 svgRareData()->setInstanceUpdatesBlocked(value); | 307 svgRareData()->setInstanceUpdatesBlocked(value); |
| 312 } | 308 } |
| 313 | 309 |
| 314 AffineTransform SVGElement::localCoordinateSpaceTransform(CTMScope) const | 310 AffineTransform SVGElement::localCoordinateSpaceTransform(CTMScope) const |
| 315 { | 311 { |
| 316 // To be overriden by SVGGraphicsElement (or as special case SVGTextElement
and SVGPatternElement) | 312 // To be overriden by SVGGraphicsElement (or as special case SVGTextElement
and SVGPatternElement) |
| 317 return AffineTransform(); | 313 return AffineTransform(); |
| 318 } | 314 } |
| 319 | 315 |
| 320 String SVGElement::xmlbase() const | 316 String SVGElement::xmlbase() const |
| 321 { | 317 { |
| 322 return fastGetAttribute(XMLNames::baseAttr); | 318 return fastGetAttribute(XMLNames::baseAttr); |
| 323 } | 319 } |
| 324 | 320 |
| 325 void SVGElement::setXMLbase(const String& value) | 321 void SVGElement::setXMLbase(const String& value) |
| 326 { | 322 { |
| 327 setAttribute(XMLNames::baseAttr, value); | 323 setAttribute(XMLNames::baseAttr, value); |
| 328 } | 324 } |
| 329 | 325 |
| 326 String SVGElement::xmllang() const |
| 327 { |
| 328 return fastGetAttribute(XMLNames::langAttr); |
| 329 } |
| 330 |
| 331 void SVGElement::setXMLlang(const String& value) |
| 332 { |
| 333 setAttribute(XMLNames::langAttr, value); |
| 334 } |
| 335 |
| 336 String SVGElement::xmlspace() const |
| 337 { |
| 338 return fastGetAttribute(XMLNames::spaceAttr); |
| 339 } |
| 340 |
| 341 void SVGElement::setXMLspace(const String& value) |
| 342 { |
| 343 setAttribute(XMLNames::spaceAttr, value); |
| 344 } |
| 345 |
| 330 Node::InsertionNotificationRequest SVGElement::insertedInto(ContainerNode* rootP
arent) | 346 Node::InsertionNotificationRequest SVGElement::insertedInto(ContainerNode* rootP
arent) |
| 331 { | 347 { |
| 332 Element::insertedInto(rootParent); | 348 Element::insertedInto(rootParent); |
| 333 updateRelativeLengthsInformation(); | 349 updateRelativeLengthsInformation(); |
| 334 buildPendingResourcesIfNeeded(); | 350 buildPendingResourcesIfNeeded(); |
| 335 return InsertionDone; | 351 return InsertionDone; |
| 336 } | 352 } |
| 337 | 353 |
| 338 void SVGElement::removedFrom(ContainerNode* rootParent) | 354 void SVGElement::removedFrom(ContainerNode* rootParent) |
| 339 { | 355 { |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 else if (name == SVGNames::onfocusoutAttr) | 680 else if (name == SVGNames::onfocusoutAttr) |
| 665 setAttributeEventListener(EventTypeNames::focusout, createAttributeEvent
Listener(this, name, value)); | 681 setAttributeEventListener(EventTypeNames::focusout, createAttributeEvent
Listener(this, name, value)); |
| 666 else if (name == SVGNames::onactivateAttr) | 682 else if (name == SVGNames::onactivateAttr) |
| 667 setAttributeEventListener(EventTypeNames::DOMActivate, createAttributeEv
entListener(this, name, value)); | 683 setAttributeEventListener(EventTypeNames::DOMActivate, createAttributeEv
entListener(this, name, value)); |
| 668 else if (name == HTMLNames::classAttr) { | 684 else if (name == HTMLNames::classAttr) { |
| 669 // SVG animation has currently requires special storage of values so we
set | 685 // SVG animation has currently requires special storage of values so we
set |
| 670 // the className here. svgAttributeChanged actually causes the resulting | 686 // the className here. svgAttributeChanged actually causes the resulting |
| 671 // style updates (instead of Element::parseAttribute). We don't | 687 // style updates (instead of Element::parseAttribute). We don't |
| 672 // tell Element about the change to avoid parsing the class list twice | 688 // tell Element about the change to avoid parsing the class list twice |
| 673 setClassNameBaseValue(value); | 689 setClassNameBaseValue(value); |
| 674 } else if (SVGLangSpace::parseAttribute(name, value)) { | 690 } else if (name.matches(XMLNames::langAttr) || name.matches(XMLNames::spaceA
ttr)) { |
| 675 } else | 691 } else |
| 676 Element::parseAttribute(name, value); | 692 Element::parseAttribute(name, value); |
| 677 } | 693 } |
| 678 | 694 |
| 679 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap; | 695 typedef HashMap<QualifiedName, AnimatedPropertyType> AttributeToPropertyTypeMap; |
| 680 static inline AttributeToPropertyTypeMap& cssPropertyToTypeMap() | 696 static inline AttributeToPropertyTypeMap& cssPropertyToTypeMap() |
| 681 { | 697 { |
| 682 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_cssPropertyMap, ()); | 698 DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_cssPropertyMap, ()); |
| 683 | 699 |
| 684 if (!s_cssPropertyMap.isEmpty()) | 700 if (!s_cssPropertyMap.isEmpty()) |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 } | 1207 } |
| 1192 | 1208 |
| 1193 if (name == classAttr) | 1209 if (name == classAttr) |
| 1194 return true; | 1210 return true; |
| 1195 | 1211 |
| 1196 return animatableAttributes.contains(name); | 1212 return animatableAttributes.contains(name); |
| 1197 } | 1213 } |
| 1198 #endif | 1214 #endif |
| 1199 | 1215 |
| 1200 } | 1216 } |
| OLD | NEW |