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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 || attrName == SVGNames::systemLanguageAttr; | 148 || attrName == SVGNames::systemLanguageAttr; |
149 } | 149 } |
150 | 150 |
151 bool SVGTests::handleAttributeChange(SVGElement* targetElement, const QualifiedN
ame& attrName) | 151 bool SVGTests::handleAttributeChange(SVGElement* targetElement, const QualifiedN
ame& attrName) |
152 { | 152 { |
153 ASSERT(targetElement); | 153 ASSERT(targetElement); |
154 if (!isKnownAttribute(attrName)) | 154 if (!isKnownAttribute(attrName)) |
155 return false; | 155 return false; |
156 if (!targetElement->inDocument()) | 156 if (!targetElement->inDocument()) |
157 return true; | 157 return true; |
| 158 |
158 bool valid = targetElement->isValid(); | 159 bool valid = targetElement->isValid(); |
159 if (valid && !targetElement->attached()) | 160 bool attached = targetElement->attached(); |
| 161 if (valid && !attached && targetElement->parentNode()->attached()) |
160 targetElement->attach(); | 162 targetElement->attach(); |
161 if (!valid && targetElement->attached()) | 163 else if (!valid && attached) |
162 targetElement->detach(); | 164 targetElement->detach(); |
| 165 |
163 return true; | 166 return true; |
164 } | 167 } |
165 | 168 |
166 void SVGTests::addSupportedAttributes(HashSet<QualifiedName>& supportedAttribute
s) | 169 void SVGTests::addSupportedAttributes(HashSet<QualifiedName>& supportedAttribute
s) |
167 { | 170 { |
168 supportedAttributes.add(SVGNames::requiredFeaturesAttr); | 171 supportedAttributes.add(SVGNames::requiredFeaturesAttr); |
169 supportedAttributes.add(SVGNames::requiredExtensionsAttr); | 172 supportedAttributes.add(SVGNames::requiredExtensionsAttr); |
170 supportedAttributes.add(SVGNames::systemLanguageAttr); | 173 supportedAttributes.add(SVGNames::systemLanguageAttr); |
171 } | 174 } |
172 | 175 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 214 |
212 SVGStringList& SVGTests::systemLanguage() | 215 SVGStringList& SVGTests::systemLanguage() |
213 { | 216 { |
214 m_systemLanguage.shouldSynchronize = true; | 217 m_systemLanguage.shouldSynchronize = true; |
215 return m_systemLanguage.value; | 218 return m_systemLanguage.value; |
216 } | 219 } |
217 | 220 |
218 } | 221 } |
219 | 222 |
220 #endif // ENABLE(SVG) | 223 #endif // ENABLE(SVG) |
OLD | NEW |