OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return false; | 139 return false; |
140 } | 140 } |
141 | 141 |
142 bool SVGTests::isKnownAttribute(const QualifiedName& attrName) | 142 bool SVGTests::isKnownAttribute(const QualifiedName& attrName) |
143 { | 143 { |
144 return attrName == SVGNames::requiredFeaturesAttr | 144 return attrName == SVGNames::requiredFeaturesAttr |
145 || attrName == SVGNames::requiredExtensionsAttr | 145 || attrName == SVGNames::requiredExtensionsAttr |
146 || attrName == SVGNames::systemLanguageAttr; | 146 || attrName == SVGNames::systemLanguageAttr; |
147 } | 147 } |
148 | 148 |
149 bool SVGTests::handleAttributeChange(SVGElement* targetElement, const QualifiedN
ame& attrName) | |
150 { | |
151 ASSERT(targetElement); | |
152 if (!isKnownAttribute(attrName)) | |
153 return false; | |
154 if (!targetElement->inDocument()) | |
155 return true; | |
156 | |
157 bool valid = targetElement->isValid(); | |
158 if (valid && !targetElement->confusingAndOftenMisusedAttached() && targetEle
ment->parentNode()->confusingAndOftenMisusedAttached()) | |
159 targetElement->lazyAttach(); | |
160 else if (!valid && targetElement->confusingAndOftenMisusedAttached()) | |
161 targetElement->detach(); | |
162 | |
163 return true; | |
164 } | |
165 | |
166 void SVGTests::addSupportedAttributes(HashSet<QualifiedName>& supportedAttribute
s) | 149 void SVGTests::addSupportedAttributes(HashSet<QualifiedName>& supportedAttribute
s) |
167 { | 150 { |
168 supportedAttributes.add(SVGNames::requiredFeaturesAttr); | 151 supportedAttributes.add(SVGNames::requiredFeaturesAttr); |
169 supportedAttributes.add(SVGNames::requiredExtensionsAttr); | 152 supportedAttributes.add(SVGNames::requiredExtensionsAttr); |
170 supportedAttributes.add(SVGNames::systemLanguageAttr); | 153 supportedAttributes.add(SVGNames::systemLanguageAttr); |
171 } | 154 } |
172 | 155 |
173 void SVGTests::synchronizeRequiredFeatures(SVGElement* contextElement) | 156 void SVGTests::synchronizeRequiredFeatures(SVGElement* contextElement) |
174 { | 157 { |
175 ASSERT(contextElement); | 158 ASSERT(contextElement); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 return m_requiredExtensions.value; | 192 return m_requiredExtensions.value; |
210 } | 193 } |
211 | 194 |
212 SVGStringList& SVGTests::systemLanguage() | 195 SVGStringList& SVGTests::systemLanguage() |
213 { | 196 { |
214 m_systemLanguage.shouldSynchronize = true; | 197 m_systemLanguage.shouldSynchronize = true; |
215 return m_systemLanguage.value; | 198 return m_systemLanguage.value; |
216 } | 199 } |
217 | 200 |
218 } | 201 } |
OLD | NEW |