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

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

Issue 18060005: Let SVGElement handle SVGLangSpace attributes parsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months 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/SVGAElement.cpp ('k') | Source/core/svg/SVGFEImageElement.cpp » ('j') | 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, 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 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 PassRefPtr<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& t agName, Document* document) 51 PassRefPtr<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& t agName, Document* document)
52 { 52 {
53 return adoptRef(new SVGClipPathElement(tagName, document)); 53 return adoptRef(new SVGClipPathElement(tagName, document));
54 } 54 }
55 55
56 bool SVGClipPathElement::isSupportedAttribute(const QualifiedName& attrName) 56 bool SVGClipPathElement::isSupportedAttribute(const QualifiedName& attrName)
57 { 57 {
58 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 58 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
59 if (supportedAttributes.isEmpty()) { 59 if (supportedAttributes.isEmpty()) {
60 SVGLangSpace::addSupportedAttributes(supportedAttributes);
61 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); 60 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
62 supportedAttributes.add(SVGNames::clipPathUnitsAttr); 61 supportedAttributes.add(SVGNames::clipPathUnitsAttr);
63 } 62 }
64 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 63 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
65 } 64 }
66 65
67 void SVGClipPathElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value) 66 void SVGClipPathElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value)
68 { 67 {
69 if (!isSupportedAttribute(name)) { 68 if (!isSupportedAttribute(name)) {
70 SVGGraphicsElement::parseAttribute(name, value); 69 SVGGraphicsElement::parseAttribute(name, value);
71 return; 70 return;
72 } 71 }
73 72
74 if (name == SVGNames::clipPathUnitsAttr) { 73 if (name == SVGNames::clipPathUnitsAttr) {
75 SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes ::SVGUnitType>::fromString(value); 74 SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes ::SVGUnitType>::fromString(value);
76 if (propertyValue > 0) 75 if (propertyValue > 0)
77 setClipPathUnitsBaseValue(propertyValue); 76 setClipPathUnitsBaseValue(propertyValue);
78 return; 77 return;
79 } 78 }
80 79
81 if (SVGLangSpace::parseAttribute(name, value))
82 return;
83 if (SVGExternalResourcesRequired::parseAttribute(name, value)) 80 if (SVGExternalResourcesRequired::parseAttribute(name, value))
84 return; 81 return;
85 82
86 ASSERT_NOT_REACHED(); 83 ASSERT_NOT_REACHED();
87 } 84 }
88 85
89 void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) 86 void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName)
90 { 87 {
91 if (!isSupportedAttribute(attrName)) { 88 if (!isSupportedAttribute(attrName)) {
92 SVGGraphicsElement::svgAttributeChanged(attrName); 89 SVGGraphicsElement::svgAttributeChanged(attrName);
(...skipping 16 matching lines...) Expand all
109 if (RenderObject* object = renderer()) 106 if (RenderObject* object = renderer())
110 object->setNeedsLayout(true); 107 object->setNeedsLayout(true);
111 } 108 }
112 109
113 RenderObject* SVGClipPathElement::createRenderer(RenderStyle*) 110 RenderObject* SVGClipPathElement::createRenderer(RenderStyle*)
114 { 111 {
115 return new (document()->renderArena()) RenderSVGResourceClipper(this); 112 return new (document()->renderArena()) RenderSVGResourceClipper(this);
116 } 113 }
117 114
118 } 115 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAElement.cpp ('k') | Source/core/svg/SVGFEImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698