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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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/SVGScriptElement.h ('k') | Source/core/svg/SVGSetElement.h » ('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 25 matching lines...) Expand all
36 36
37 // Animated property definitions 37 // Animated property definitions
38 DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href) 38 DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href)
39 DEFINE_ANIMATED_BOOLEAN(SVGScriptElement, SVGNames::externalResourcesRequiredAtt r, ExternalResourcesRequired, externalResourcesRequired) 39 DEFINE_ANIMATED_BOOLEAN(SVGScriptElement, SVGNames::externalResourcesRequiredAtt r, ExternalResourcesRequired, externalResourcesRequired)
40 40
41 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement) 41 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement)
42 REGISTER_LOCAL_ANIMATED_PROPERTY(href) 42 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
44 END_REGISTER_ANIMATED_PROPERTIES 44 END_REGISTER_ANIMATED_PROPERTIES
45 45
46 inline SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document * document, bool wasInsertedByParser, bool alreadyStarted) 46 inline SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document & document, bool wasInsertedByParser, bool alreadyStarted)
47 : SVGElement(tagName, document) 47 : SVGElement(tagName, document)
48 , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) 48 , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired)
49 , m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted)) 49 , m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted))
50 { 50 {
51 ASSERT(hasTagName(SVGNames::scriptTag)); 51 ASSERT(hasTagName(SVGNames::scriptTag));
52 ScriptWrappable::init(this); 52 ScriptWrappable::init(this);
53 registerAnimatedPropertiesForSVGScriptElement(); 53 registerAnimatedPropertiesForSVGScriptElement();
54 } 54 }
55 55
56 PassRefPtr<SVGScriptElement> SVGScriptElement::create(const QualifiedName& tagNa me, Document* document, bool insertedByParser) 56 PassRefPtr<SVGScriptElement> SVGScriptElement::create(const QualifiedName& tagNa me, Document& document, bool insertedByParser)
57 { 57 {
58 return adoptRef(new SVGScriptElement(tagName, document, insertedByParser, fa lse)); 58 return adoptRef(new SVGScriptElement(tagName, document, insertedByParser, fa lse));
59 } 59 }
60 60
61 bool SVGScriptElement::isSupportedAttribute(const QualifiedName& attrName) 61 bool SVGScriptElement::isSupportedAttribute(const QualifiedName& attrName)
62 { 62 {
63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
64 if (supportedAttributes.isEmpty()) { 64 if (supportedAttributes.isEmpty()) {
65 SVGURIReference::addSupportedAttributes(supportedAttributes); 65 SVGURIReference::addSupportedAttributes(supportedAttributes);
66 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); 66 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return false; 201 return false;
202 } 202 }
203 203
204 bool SVGScriptElement::hasSourceAttribute() const 204 bool SVGScriptElement::hasSourceAttribute() const
205 { 205 {
206 return hasAttribute(XLinkNames::hrefAttr); 206 return hasAttribute(XLinkNames::hrefAttr);
207 } 207 }
208 208
209 PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren() 209 PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
210 { 210 {
211 return adoptRef(new SVGScriptElement(tagQName(), &document(), false, m_loade r->alreadyStarted())); 211 return adoptRef(new SVGScriptElement(tagQName(), document(), false, m_loader ->alreadyStarted()));
212 } 212 }
213 213
214 void SVGScriptElement::setHaveFiredLoadEvent(bool haveFiredLoadEvent) 214 void SVGScriptElement::setHaveFiredLoadEvent(bool haveFiredLoadEvent)
215 { 215 {
216 m_loader->setHaveFiredLoadEvent(haveFiredLoadEvent); 216 m_loader->setHaveFiredLoadEvent(haveFiredLoadEvent);
217 } 217 }
218 218
219 bool SVGScriptElement::isParserInserted() const 219 bool SVGScriptElement::isParserInserted() const
220 { 220 {
221 return m_loader->isParserInserted(); 221 return m_loader->isParserInserted();
222 } 222 }
223 223
224 bool SVGScriptElement::haveFiredLoadEvent() const 224 bool SVGScriptElement::haveFiredLoadEvent() const
225 { 225 {
226 return m_loader->haveFiredLoadEvent(); 226 return m_loader->haveFiredLoadEvent();
227 } 227 }
228 228
229 Timer<SVGElement>* SVGScriptElement::svgLoadEventTimer() 229 Timer<SVGElement>* SVGScriptElement::svgLoadEventTimer()
230 { 230 {
231 return &m_svgLoadEventTimer; 231 return &m_svgLoadEventTimer;
232 } 232 }
233 233
234 } 234 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGScriptElement.h ('k') | Source/core/svg/SVGSetElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698