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

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

Issue 113133002: Rewrite to not store type in m_type and also remove type getter/setter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | Source/core/svg/SVGScriptElement.idl » ('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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) 69 void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value)
70 { 70 {
71 if (!isSupportedAttribute(name)) { 71 if (!isSupportedAttribute(name)) {
72 SVGElement::parseAttribute(name, value); 72 SVGElement::parseAttribute(name, value);
73 return; 73 return;
74 } 74 }
75 75
76 SVGParsingError parseError = NoError; 76 SVGParsingError parseError = NoError;
77 if (name == SVGNames::typeAttr)
78 return;
77 79
78 if (name == SVGNames::typeAttr) 80 if (name == HTMLNames::onerrorAttr)
79 setType(value);
80 else if (name == HTMLNames::onerrorAttr)
81 setAttributeEventListener(EventTypeNames::error, createAttributeEventLis tener(this, name, value)); 81 setAttributeEventListener(EventTypeNames::error, createAttributeEventLis tener(this, name, value));
82 else if (name.matches(XLinkNames::hrefAttr)) 82 else if (name.matches(XLinkNames::hrefAttr))
83 m_href->setBaseValueAsString(value, parseError); 83 m_href->setBaseValueAsString(value, parseError);
84 else 84 else
85 ASSERT_NOT_REACHED(); 85 ASSERT_NOT_REACHED();
86 86
87 reportAttributeParsingError(parseError, name, value); 87 reportAttributeParsingError(parseError, name, value);
88 } 88 }
89 89
90 void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName) 90 void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 { 133 {
134 return attribute.name() == AtomicString(sourceAttributeValue()); 134 return attribute.name() == AtomicString(sourceAttributeValue());
135 } 135 }
136 136
137 void SVGScriptElement::finishParsingChildren() 137 void SVGScriptElement::finishParsingChildren()
138 { 138 {
139 SVGElement::finishParsingChildren(); 139 SVGElement::finishParsingChildren();
140 m_loader->setHaveFiredLoadEvent(true); 140 m_loader->setHaveFiredLoadEvent(true);
141 } 141 }
142 142
143 String SVGScriptElement::type() const
144 {
145 return m_type;
146 }
147
148 void SVGScriptElement::setType(const String& type)
149 {
150 m_type = type;
151 }
152
153 bool SVGScriptElement::haveLoadedRequiredResources() 143 bool SVGScriptElement::haveLoadedRequiredResources()
154 { 144 {
155 return m_loader->haveFiredLoadEvent(); 145 return m_loader->haveFiredLoadEvent();
156 } 146 }
157 147
158 String SVGScriptElement::sourceAttributeValue() const 148 String SVGScriptElement::sourceAttributeValue() const
159 { 149 {
160 return m_href->currentValue()->value(); 150 return m_href->currentValue()->value();
161 } 151 }
162 152
163 String SVGScriptElement::charsetAttributeValue() const 153 String SVGScriptElement::charsetAttributeValue() const
164 { 154 {
165 return String(); 155 return String();
166 } 156 }
167 157
168 String SVGScriptElement::typeAttributeValue() const 158 String SVGScriptElement::typeAttributeValue() const
169 { 159 {
170 return type(); 160 return getAttribute(SVGNames::typeAttr).string();
171 } 161 }
172 162
173 String SVGScriptElement::languageAttributeValue() const 163 String SVGScriptElement::languageAttributeValue() const
174 { 164 {
175 return String(); 165 return String();
176 } 166 }
177 167
178 String SVGScriptElement::forAttributeValue() const 168 String SVGScriptElement::forAttributeValue() const
179 { 169 {
180 return String(); 170 return String();
(...skipping 22 matching lines...) Expand all
203 PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren() 193 PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
204 { 194 {
205 return adoptRef(new SVGScriptElement(document(), false, m_loader->alreadySta rted())); 195 return adoptRef(new SVGScriptElement(document(), false, m_loader->alreadySta rted()));
206 } 196 }
207 197
208 void SVGScriptElement::dispatchLoadEvent() 198 void SVGScriptElement::dispatchLoadEvent()
209 { 199 {
210 dispatchEvent(Event::create(EventTypeNames::load)); 200 dispatchEvent(Event::create(EventTypeNames::load));
211 } 201 }
212 202
203 #ifndef NDEBUG
204 bool SVGScriptElement::isAnimatableAttribute(const QualifiedName& name) const
205 {
206 if (name == SVGNames::typeAttr)
207 return false;
208
209 return SVGElement::isAnimatableAttribute(name);
213 } 210 }
211 #endif
212
213 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | Source/core/svg/SVGScriptElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698