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 27 matching lines...) Expand all Loading... |
38 #include "core/events/Event.h" | 38 #include "core/events/Event.h" |
39 #include "core/html/HTMLElement.h" | 39 #include "core/html/HTMLElement.h" |
40 #include "core/rendering/RenderObject.h" | 40 #include "core/rendering/RenderObject.h" |
41 #include "core/rendering/svg/RenderSVGResourceContainer.h" | 41 #include "core/rendering/svg/RenderSVGResourceContainer.h" |
42 #include "core/svg/SVGCursorElement.h" | 42 #include "core/svg/SVGCursorElement.h" |
43 #include "core/svg/SVGDocumentExtensions.h" | 43 #include "core/svg/SVGDocumentExtensions.h" |
44 #include "core/svg/SVGElementInstance.h" | 44 #include "core/svg/SVGElementInstance.h" |
45 #include "core/svg/SVGElementRareData.h" | 45 #include "core/svg/SVGElementRareData.h" |
46 #include "core/svg/SVGGraphicsElement.h" | 46 #include "core/svg/SVGGraphicsElement.h" |
47 #include "core/svg/SVGSVGElement.h" | 47 #include "core/svg/SVGSVGElement.h" |
| 48 #include "core/svg/SVGTitleElement.h" |
48 #include "core/svg/SVGUseElement.h" | 49 #include "core/svg/SVGUseElement.h" |
49 | 50 |
50 #include "wtf/TemporaryChange.h" | 51 #include "wtf/TemporaryChange.h" |
51 | 52 |
52 namespace WebCore { | 53 namespace WebCore { |
53 | 54 |
54 using namespace HTMLNames; | 55 using namespace HTMLNames; |
55 using namespace SVGNames; | 56 using namespace SVGNames; |
56 | 57 |
57 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName) | 58 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
ToIdMap, const QualifiedName& attrName) |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 245 |
245 // If the <use> title is not empty we found the title to use. | 246 // If the <use> title is not empty we found the title to use. |
246 String useTitle(useElement->title()); | 247 String useTitle(useElement->title()); |
247 if (!useTitle.isEmpty()) | 248 if (!useTitle.isEmpty()) |
248 return useTitle; | 249 return useTitle; |
249 } | 250 } |
250 } | 251 } |
251 | 252 |
252 // If we aren't an instance in a <use> or the <use> title was not found, the
n find the first | 253 // If we aren't an instance in a <use> or the <use> title was not found, the
n find the first |
253 // <title> child of this element. | 254 // <title> child of this element. |
254 Element* titleElement = ElementTraversal::firstWithin(*this); | |
255 for (; titleElement; titleElement = ElementTraversal::nextSkippingChildren(*
titleElement, this)) { | |
256 if (titleElement->hasTagName(SVGNames::titleTag) && titleElement->isSVGE
lement()) | |
257 break; | |
258 } | |
259 | |
260 // If a title child was found, return the text contents. | 255 // If a title child was found, return the text contents. |
261 if (titleElement) | 256 if (Element* titleElement = Traversal<SVGTitleElement>::firstChild(*this)) |
262 return titleElement->innerText(); | 257 return titleElement->innerText(); |
263 | 258 |
264 // Otherwise return a null/empty string. | 259 // Otherwise return a null/empty string. |
265 return String(); | 260 return String(); |
266 } | 261 } |
267 | 262 |
268 PassRefPtrWillBeRawPtr<CSSValue> SVGElement::getPresentationAttribute(const Atom
icString& name) | 263 PassRefPtrWillBeRawPtr<CSSValue> SVGElement::getPresentationAttribute(const Atom
icString& name) |
269 { | 264 { |
270 if (!hasAttributesWithoutUpdate()) | 265 if (!hasAttributesWithoutUpdate()) |
271 return nullptr; | 266 return nullptr; |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 animatableAttributes.add(SVGNames::zAttr); | 1133 animatableAttributes.add(SVGNames::zAttr); |
1139 } | 1134 } |
1140 | 1135 |
1141 if (name == classAttr) | 1136 if (name == classAttr) |
1142 return true; | 1137 return true; |
1143 | 1138 |
1144 return animatableAttributes.contains(name); | 1139 return animatableAttributes.contains(name); |
1145 } | 1140 } |
1146 #endif | 1141 #endif |
1147 } | 1142 } |
OLD | NEW |