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 * | 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 for (unsigned i = 0; i < nchars; ++i) | 206 for (unsigned i = 0; i < nchars; ++i) |
207 end = end.next(); | 207 end = end.next(); |
208 | 208 |
209 document().frame()->selection().setSelection(VisibleSelection(start, end)); | 209 document().frame()->selection().setSelection(VisibleSelection(start, end)); |
210 } | 210 } |
211 | 211 |
212 bool SVGTextContentElement::isSupportedAttribute(const QualifiedName& attrName) | 212 bool SVGTextContentElement::isSupportedAttribute(const QualifiedName& attrName) |
213 { | 213 { |
214 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 214 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
215 if (supportedAttributes.isEmpty()) { | 215 if (supportedAttributes.isEmpty()) { |
216 SVGLangSpace::addSupportedAttributes(supportedAttributes); | |
217 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); | 216 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); |
218 supportedAttributes.add(SVGNames::lengthAdjustAttr); | 217 supportedAttributes.add(SVGNames::lengthAdjustAttr); |
219 supportedAttributes.add(SVGNames::textLengthAttr); | 218 supportedAttributes.add(SVGNames::textLengthAttr); |
219 QualifiedName spaceWithPrefix = XMLNames::spaceAttr; | |
pdr.
2013/12/11 00:10:58
Can you add namespacePrefix="XML" in xmlattrs.in t
| |
220 spaceWithPrefix.setPrefix(xmlAtom); | |
221 supportedAttributes.add(spaceWithPrefix); | |
222 supportedAttributes.add(XMLNames::spaceAttr); | |
220 } | 223 } |
221 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 224 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
222 } | 225 } |
223 | 226 |
224 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst | 227 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst |
225 { | 228 { |
226 if (name.matches(XMLNames::spaceAttr)) | 229 if (name.matches(XMLNames::spaceAttr)) |
227 return true; | 230 return true; |
228 return SVGGraphicsElement::isPresentationAttribute(name); | 231 return SVGGraphicsElement::isPresentationAttribute(name); |
229 } | 232 } |
(...skipping 18 matching lines...) Expand all Loading... | |
248 | 251 |
249 if (!isSupportedAttribute(name)) | 252 if (!isSupportedAttribute(name)) |
250 SVGGraphicsElement::parseAttribute(name, value); | 253 SVGGraphicsElement::parseAttribute(name, value); |
251 else if (name == SVGNames::lengthAdjustAttr) { | 254 else if (name == SVGNames::lengthAdjustAttr) { |
252 SVGLengthAdjustType propertyValue = SVGPropertyTraits<SVGLengthAdjustTyp e>::fromString(value); | 255 SVGLengthAdjustType propertyValue = SVGPropertyTraits<SVGLengthAdjustTyp e>::fromString(value); |
253 if (propertyValue > 0) | 256 if (propertyValue > 0) |
254 setLengthAdjustBaseValue(propertyValue); | 257 setLengthAdjustBaseValue(propertyValue); |
255 } else if (name == SVGNames::textLengthAttr) { | 258 } else if (name == SVGNames::textLengthAttr) { |
256 m_textLength.value = SVGLength::construct(LengthModeOther, value, parseE rror, ForbidNegativeLengths); | 259 m_textLength.value = SVGLength::construct(LengthModeOther, value, parseE rror, ForbidNegativeLengths); |
257 } else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { | 260 } else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { |
258 } else if (SVGLangSpace::parseAttribute(name, value)) { | |
259 } else | 261 } else |
260 ASSERT_NOT_REACHED(); | 262 ASSERT_NOT_REACHED(); |
261 | 263 |
262 reportAttributeParsingError(parseError, name, value); | 264 reportAttributeParsingError(parseError, name, value); |
263 } | 265 } |
264 | 266 |
265 void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) | 267 void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) |
266 { | 268 { |
267 if (!isSupportedAttribute(attrName)) { | 269 if (!isSupportedAttribute(attrName)) { |
268 SVGGraphicsElement::svgAttributeChanged(attrName); | 270 SVGGraphicsElement::svgAttributeChanged(attrName); |
(...skipping 28 matching lines...) Expand all Loading... | |
297 SVGElement* element = toSVGElement(renderer->node()); | 299 SVGElement* element = toSVGElement(renderer->node()); |
298 ASSERT(element); | 300 ASSERT(element); |
299 | 301 |
300 if (!element->isTextContent()) | 302 if (!element->isTextContent()) |
301 return 0; | 303 return 0; |
302 | 304 |
303 return toSVGTextContentElement(element); | 305 return toSVGTextContentElement(element); |
304 } | 306 } |
305 | 307 |
306 } | 308 } |
OLD | NEW |