OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 PassRefPtr<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& t
agName, Document* document) | 51 PassRefPtr<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& t
agName, Document* document) |
52 { | 52 { |
53 return adoptRef(new SVGClipPathElement(tagName, document)); | 53 return adoptRef(new SVGClipPathElement(tagName, document)); |
54 } | 54 } |
55 | 55 |
56 bool SVGClipPathElement::isSupportedAttribute(const QualifiedName& attrName) | 56 bool SVGClipPathElement::isSupportedAttribute(const QualifiedName& attrName) |
57 { | 57 { |
58 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 58 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
59 if (supportedAttributes.isEmpty()) { | 59 if (supportedAttributes.isEmpty()) { |
60 SVGTests::addSupportedAttributes(supportedAttributes); | |
61 SVGLangSpace::addSupportedAttributes(supportedAttributes); | 60 SVGLangSpace::addSupportedAttributes(supportedAttributes); |
62 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | 61 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); |
63 supportedAttributes.add(SVGNames::clipPathUnitsAttr); | 62 supportedAttributes.add(SVGNames::clipPathUnitsAttr); |
64 } | 63 } |
65 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 64 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
66 } | 65 } |
67 | 66 |
68 void SVGClipPathElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) | 67 void SVGClipPathElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) |
69 { | 68 { |
70 if (!isSupportedAttribute(name)) { | 69 if (!isSupportedAttribute(name)) { |
71 SVGGraphicsElement::parseAttribute(name, value); | 70 SVGGraphicsElement::parseAttribute(name, value); |
72 return; | 71 return; |
73 } | 72 } |
74 | 73 |
75 if (name == SVGNames::clipPathUnitsAttr) { | 74 if (name == SVGNames::clipPathUnitsAttr) { |
76 SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes
::SVGUnitType>::fromString(value); | 75 SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes
::SVGUnitType>::fromString(value); |
77 if (propertyValue > 0) | 76 if (propertyValue > 0) |
78 setClipPathUnitsBaseValue(propertyValue); | 77 setClipPathUnitsBaseValue(propertyValue); |
79 return; | 78 return; |
80 } | 79 } |
81 | 80 |
82 if (SVGTests::parseAttribute(name, value)) | |
83 return; | |
84 if (SVGLangSpace::parseAttribute(name, value)) | 81 if (SVGLangSpace::parseAttribute(name, value)) |
85 return; | 82 return; |
86 if (SVGExternalResourcesRequired::parseAttribute(name, value)) | 83 if (SVGExternalResourcesRequired::parseAttribute(name, value)) |
87 return; | 84 return; |
88 | 85 |
89 ASSERT_NOT_REACHED(); | 86 ASSERT_NOT_REACHED(); |
90 } | 87 } |
91 | 88 |
92 void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) | 89 void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) |
93 { | 90 { |
(...skipping 18 matching lines...) Expand all Loading... |
112 if (RenderObject* object = renderer()) | 109 if (RenderObject* object = renderer()) |
113 object->setNeedsLayout(true); | 110 object->setNeedsLayout(true); |
114 } | 111 } |
115 | 112 |
116 RenderObject* SVGClipPathElement::createRenderer(RenderStyle*) | 113 RenderObject* SVGClipPathElement::createRenderer(RenderStyle*) |
117 { | 114 { |
118 return new (document()->renderArena()) RenderSVGResourceClipper(this); | 115 return new (document()->renderArena()) RenderSVGResourceClipper(this); |
119 } | 116 } |
120 | 117 |
121 } | 118 } |
OLD | NEW |