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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 svgRareData()->setNeedsOverrideComputedStyleUpdate(); | 140 svgRareData()->setNeedsOverrideComputedStyleUpdate(); |
141 } | 141 } |
142 | 142 |
143 void SVGElement::buildPendingResourcesIfNeeded() | 143 void SVGElement::buildPendingResourcesIfNeeded() |
144 { | 144 { |
145 Document& document = this->document(); | 145 Document& document = this->document(); |
146 if (!needsPendingResourceHandling() || !inDocument() || isInShadowTree()) | 146 if (!needsPendingResourceHandling() || !inDocument() || isInShadowTree()) |
147 return; | 147 return; |
148 | 148 |
149 SVGDocumentExtensions* extensions = document.accessSVGExtensions(); | 149 SVGDocumentExtensions* extensions = document.accessSVGExtensions(); |
150 String resourceId = getIdAttribute(); | 150 AtomicString resourceId = getIdAttribute(); |
151 if (!extensions->hasPendingResource(resourceId)) | 151 if (!extensions->hasPendingResource(resourceId)) |
152 return; | 152 return; |
153 | 153 |
154 // Mark pending resources as pending for removal. | 154 // Mark pending resources as pending for removal. |
155 extensions->markPendingResourcesForRemoval(resourceId); | 155 extensions->markPendingResourcesForRemoval(resourceId); |
156 | 156 |
157 // Rebuild pending resources for each client of a pending resource that is b
eing removed. | 157 // Rebuild pending resources for each client of a pending resource that is b
eing removed. |
158 while (Element* clientElement = extensions->removeElementFromPendingResource
sForRemoval(resourceId)) { | 158 while (Element* clientElement = extensions->removeElementFromPendingResource
sForRemoval(resourceId)) { |
159 ASSERT(clientElement->hasPendingResources()); | 159 ASSERT(clientElement->hasPendingResources()); |
160 if (clientElement->hasPendingResources()) { | 160 if (clientElement->hasPendingResources()) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 272 } |
273 | 273 |
274 // If a title child was found, return the text contents. | 274 // If a title child was found, return the text contents. |
275 if (titleElement) | 275 if (titleElement) |
276 return titleElement->innerText(); | 276 return titleElement->innerText(); |
277 | 277 |
278 // Otherwise return a null/empty string. | 278 // Otherwise return a null/empty string. |
279 return String(); | 279 return String(); |
280 } | 280 } |
281 | 281 |
282 PassRefPtr<CSSValue> SVGElement::getPresentationAttribute(const String& name) | 282 PassRefPtr<CSSValue> SVGElement::getPresentationAttribute(const AtomicString& na
me) |
283 { | 283 { |
284 if (!hasAttributesWithoutUpdate()) | 284 if (!hasAttributesWithoutUpdate()) |
285 return 0; | 285 return 0; |
286 | 286 |
287 QualifiedName attributeName(nullAtom, name, nullAtom); | 287 QualifiedName attributeName(nullAtom, name, nullAtom); |
288 const Attribute* attr = getAttributeItem(attributeName); | 288 const Attribute* attr = getAttributeItem(attributeName); |
289 if (!attr) | 289 if (!attr) |
290 return 0; | 290 return 0; |
291 | 291 |
292 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(SVGA
ttributeMode); | 292 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(SVGA
ttributeMode); |
(...skipping 14 matching lines...) Expand all Loading... |
307 if (hasSVGRareData()) | 307 if (hasSVGRareData()) |
308 svgRareData()->setInstanceUpdatesBlocked(value); | 308 svgRareData()->setInstanceUpdatesBlocked(value); |
309 } | 309 } |
310 | 310 |
311 AffineTransform SVGElement::localCoordinateSpaceTransform(CTMScope) const | 311 AffineTransform SVGElement::localCoordinateSpaceTransform(CTMScope) const |
312 { | 312 { |
313 // To be overriden by SVGGraphicsElement (or as special case SVGTextElement
and SVGPatternElement) | 313 // To be overriden by SVGGraphicsElement (or as special case SVGTextElement
and SVGPatternElement) |
314 return AffineTransform(); | 314 return AffineTransform(); |
315 } | 315 } |
316 | 316 |
317 String SVGElement::xmlbase() const | 317 const AtomicString& SVGElement::xmlbase() const |
318 { | 318 { |
319 return fastGetAttribute(XMLNames::baseAttr); | 319 return fastGetAttribute(XMLNames::baseAttr); |
320 } | 320 } |
321 | 321 |
322 void SVGElement::setXMLbase(const String& value) | 322 void SVGElement::setXMLbase(const AtomicString& value) |
323 { | 323 { |
324 setAttribute(XMLNames::baseAttr, value); | 324 setAttribute(XMLNames::baseAttr, value); |
325 } | 325 } |
326 | 326 |
327 String SVGElement::xmllang() const | 327 const AtomicString& SVGElement::xmllang() const |
328 { | 328 { |
329 return fastGetAttribute(XMLNames::langAttr); | 329 return fastGetAttribute(XMLNames::langAttr); |
330 } | 330 } |
331 | 331 |
332 void SVGElement::setXMLlang(const String& value) | 332 void SVGElement::setXMLlang(const AtomicString& value) |
333 { | 333 { |
334 setAttribute(XMLNames::langAttr, value); | 334 setAttribute(XMLNames::langAttr, value); |
335 } | 335 } |
336 | 336 |
337 String SVGElement::xmlspace() const | 337 const AtomicString& SVGElement::xmlspace() const |
338 { | 338 { |
339 return fastGetAttribute(XMLNames::spaceAttr); | 339 return fastGetAttribute(XMLNames::spaceAttr); |
340 } | 340 } |
341 | 341 |
342 void SVGElement::setXMLspace(const String& value) | 342 void SVGElement::setXMLspace(const AtomicString& value) |
343 { | 343 { |
344 setAttribute(XMLNames::spaceAttr, value); | 344 setAttribute(XMLNames::spaceAttr, value); |
345 } | 345 } |
346 | 346 |
347 Node::InsertionNotificationRequest SVGElement::insertedInto(ContainerNode* rootP
arent) | 347 Node::InsertionNotificationRequest SVGElement::insertedInto(ContainerNode* rootP
arent) |
348 { | 348 { |
349 Element::insertedInto(rootParent); | 349 Element::insertedInto(rootParent); |
350 updateRelativeLengthsInformation(); | 350 updateRelativeLengthsInformation(); |
351 buildPendingResourcesIfNeeded(); | 351 buildPendingResourcesIfNeeded(); |
352 return InsertionDone; | 352 return InsertionDone; |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 | 1020 |
1021 void SVGElement::svgAttributeChanged(const QualifiedName& attrName) | 1021 void SVGElement::svgAttributeChanged(const QualifiedName& attrName) |
1022 { | 1022 { |
1023 CSSPropertyID propId = SVGElement::cssPropertyIdForSVGAttributeName(attrName
); | 1023 CSSPropertyID propId = SVGElement::cssPropertyIdForSVGAttributeName(attrName
); |
1024 if (propId > 0) { | 1024 if (propId > 0) { |
1025 SVGElementInstance::invalidateAllInstancesOfElement(this); | 1025 SVGElementInstance::invalidateAllInstancesOfElement(this); |
1026 return; | 1026 return; |
1027 } | 1027 } |
1028 | 1028 |
1029 if (attrName == HTMLNames::classAttr) { | 1029 if (attrName == HTMLNames::classAttr) { |
1030 classAttributeChanged(classNameCurrentValue()); | 1030 classAttributeChanged(AtomicString(classNameCurrentValue())); |
1031 SVGElementInstance::invalidateAllInstancesOfElement(this); | 1031 SVGElementInstance::invalidateAllInstancesOfElement(this); |
1032 return; | 1032 return; |
1033 } | 1033 } |
1034 | 1034 |
1035 if (isIdAttributeName(attrName)) { | 1035 if (isIdAttributeName(attrName)) { |
1036 RenderObject* object = renderer(); | 1036 RenderObject* object = renderer(); |
1037 // Notify resources about id changes, this is important as we cache reso
urces by id in SVGDocumentExtensions | 1037 // Notify resources about id changes, this is important as we cache reso
urces by id in SVGDocumentExtensions |
1038 if (object && object->isSVGResourceContainer()) | 1038 if (object && object->isSVGResourceContainer()) |
1039 toRenderSVGResourceContainer(object)->idChanged(); | 1039 toRenderSVGResourceContainer(object)->idChanged(); |
1040 if (inDocument()) | 1040 if (inDocument()) |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 animatableAttributes.add(SVGNames::zAttr); | 1244 animatableAttributes.add(SVGNames::zAttr); |
1245 } | 1245 } |
1246 | 1246 |
1247 if (name == classAttr) | 1247 if (name == classAttr) |
1248 return true; | 1248 return true; |
1249 | 1249 |
1250 return animatableAttributes.contains(name); | 1250 return animatableAttributes.contains(name); |
1251 } | 1251 } |
1252 #endif | 1252 #endif |
1253 } | 1253 } |
OLD | NEW |