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

Side by Side Diff: Source/core/svg/SVGMaskElement.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/SVGMarkerElement.cpp ('k') | Source/core/svg/SVGPathElement.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, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 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 * Copyright (C) 2005 Alexander Kellett <lypanov@kde.org> 4 * Copyright (C) 2005 Alexander Kellett <lypanov@kde.org>
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName, Document* document) 72 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName, Document* document)
73 { 73 {
74 return adoptRef(new SVGMaskElement(tagName, document)); 74 return adoptRef(new SVGMaskElement(tagName, document));
75 } 75 }
76 76
77 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName) 77 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName)
78 { 78 {
79 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 79 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
80 if (supportedAttributes.isEmpty()) { 80 if (supportedAttributes.isEmpty()) {
81 SVGTests::addSupportedAttributes(supportedAttributes); 81 SVGTests::addSupportedAttributes(supportedAttributes);
82 SVGLangSpace::addSupportedAttributes(supportedAttributes);
83 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); 82 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
84 supportedAttributes.add(SVGNames::maskUnitsAttr); 83 supportedAttributes.add(SVGNames::maskUnitsAttr);
85 supportedAttributes.add(SVGNames::maskContentUnitsAttr); 84 supportedAttributes.add(SVGNames::maskContentUnitsAttr);
86 supportedAttributes.add(SVGNames::xAttr); 85 supportedAttributes.add(SVGNames::xAttr);
87 supportedAttributes.add(SVGNames::yAttr); 86 supportedAttributes.add(SVGNames::yAttr);
88 supportedAttributes.add(SVGNames::widthAttr); 87 supportedAttributes.add(SVGNames::widthAttr);
89 supportedAttributes.add(SVGNames::heightAttr); 88 supportedAttributes.add(SVGNames::heightAttr);
90 } 89 }
91 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 90 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
92 } 91 }
(...skipping 16 matching lines...) Expand all
109 return; 108 return;
110 } else if (name == SVGNames::xAttr) 109 } else if (name == SVGNames::xAttr)
111 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); 110 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
112 else if (name == SVGNames::yAttr) 111 else if (name == SVGNames::yAttr)
113 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ; 112 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ;
114 else if (name == SVGNames::widthAttr) 113 else if (name == SVGNames::widthAttr)
115 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro r)); 114 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro r));
116 else if (name == SVGNames::heightAttr) 115 else if (name == SVGNames::heightAttr)
117 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr ror)); 116 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr ror));
118 else if (SVGTests::parseAttribute(name, value) 117 else if (SVGTests::parseAttribute(name, value)
119 || SVGLangSpace::parseAttribute(name, value)
120 || SVGExternalResourcesRequired::parseAttribute(name, value)) { 118 || SVGExternalResourcesRequired::parseAttribute(name, value)) {
121 } else 119 } else
122 ASSERT_NOT_REACHED(); 120 ASSERT_NOT_REACHED();
123 121
124 reportAttributeParsingError(parseError, name, value); 122 reportAttributeParsingError(parseError, name, value);
125 } 123 }
126 124
127 void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) 125 void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName)
128 { 126 {
129 if (!isSupportedAttribute(attrName)) { 127 if (!isSupportedAttribute(attrName)) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 159
162 bool SVGMaskElement::selfHasRelativeLengths() const 160 bool SVGMaskElement::selfHasRelativeLengths() const
163 { 161 {
164 return x().isRelative() 162 return x().isRelative()
165 || y().isRelative() 163 || y().isRelative()
166 || width().isRelative() 164 || width().isRelative()
167 || height().isRelative(); 165 || height().isRelative();
168 } 166 }
169 167
170 } 168 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGMarkerElement.cpp ('k') | Source/core/svg/SVGPathElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698