OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 void SVGMPathElement::removedFrom(ContainerNode* rootParent) | 86 void SVGMPathElement::removedFrom(ContainerNode* rootParent) |
87 { | 87 { |
88 SVGElement::removedFrom(rootParent); | 88 SVGElement::removedFrom(rootParent); |
89 notifyParentOfPathChange(rootParent); | 89 notifyParentOfPathChange(rootParent); |
90 if (rootParent->inDocument()) | 90 if (rootParent->inDocument()) |
91 clearResourceReferences(); | 91 clearResourceReferences(); |
92 } | 92 } |
93 | 93 |
94 bool SVGMPathElement::isSupportedAttribute(const QualifiedName& attrName) | |
95 { | |
96 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | |
97 if (supportedAttributes.isEmpty()) { | |
98 SVGURIReference::addSupportedAttributes(supportedAttributes); | |
99 } | |
100 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | |
101 } | |
102 | |
103 void SVGMPathElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) | 94 void SVGMPathElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) |
104 { | 95 { |
105 SVGParsingError parseError = NoError; | 96 parseAttributeNew(name, value); |
106 | |
107 if (!isSupportedAttribute(name)) { | |
108 SVGElement::parseAttribute(name, value); | |
109 } else if (SVGURIReference::parseAttribute(name, value, parseError)) { | |
110 } else { | |
111 ASSERT_NOT_REACHED(); | |
112 } | |
113 | |
114 reportAttributeParsingError(parseError, name, value); | |
115 } | 97 } |
116 | 98 |
117 void SVGMPathElement::svgAttributeChanged(const QualifiedName& attrName) | 99 void SVGMPathElement::svgAttributeChanged(const QualifiedName& attrName) |
118 { | 100 { |
119 if (!isSupportedAttribute(attrName)) { | |
120 SVGElement::svgAttributeChanged(attrName); | |
121 return; | |
122 } | |
123 | |
124 SVGElement::InvalidationGuard invalidationGuard(this); | |
125 | |
126 if (SVGURIReference::isKnownAttribute(attrName)) { | 101 if (SVGURIReference::isKnownAttribute(attrName)) { |
| 102 SVGElement::InvalidationGuard invalidationGuard(this); |
127 buildPendingResource(); | 103 buildPendingResource(); |
128 return; | 104 return; |
129 } | 105 } |
130 | 106 |
131 ASSERT_NOT_REACHED(); | 107 SVGElement::svgAttributeChanged(attrName); |
132 } | 108 } |
133 | 109 |
134 SVGPathElement* SVGMPathElement::pathElement() | 110 SVGPathElement* SVGMPathElement::pathElement() |
135 { | 111 { |
136 Element* target = targetElementFromIRIString(hrefString(), treeScope()); | 112 Element* target = targetElementFromIRIString(hrefString(), treeScope()); |
137 return isSVGPathElement(target) ? toSVGPathElement(target) : 0; | 113 return isSVGPathElement(target) ? toSVGPathElement(target) : 0; |
138 } | 114 } |
139 | 115 |
140 void SVGMPathElement::targetPathChanged() | 116 void SVGMPathElement::targetPathChanged() |
141 { | 117 { |
142 notifyParentOfPathChange(parentNode()); | 118 notifyParentOfPathChange(parentNode()); |
143 } | 119 } |
144 | 120 |
145 void SVGMPathElement::notifyParentOfPathChange(ContainerNode* parent) | 121 void SVGMPathElement::notifyParentOfPathChange(ContainerNode* parent) |
146 { | 122 { |
147 if (isSVGAnimateMotionElement(parent)) | 123 if (isSVGAnimateMotionElement(parent)) |
148 toSVGAnimateMotionElement(parent)->updateAnimationPath(); | 124 toSVGAnimateMotionElement(parent)->updateAnimationPath(); |
149 } | 125 } |
150 | 126 |
151 } // namespace blink | 127 } // namespace blink |
OLD | NEW |