Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: Source/core/svg/SVGTests.cpp

Issue 43223002: SVGTests should not leave detached elements in the tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Always reattach Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGTests.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTests.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698