2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef SVGScriptElement_h
22 #define SVGScriptElement_h
24 #include "core/SVGNames.h"
25 #include "core/dom/ScriptLoaderClient.h"
26 #include "core/svg/SVGAnimatedBoolean.h"
27 #include "core/svg/SVGAnimatedString.h"
28 #include "core/svg/SVGElement.h"
29 #include "core/svg/SVGURIReference.h"
35 class SVGScriptElement FINAL
37 , public SVGURIReference
38 , public ScriptLoaderClient {
39 DEFINE_WRAPPERTYPEINFO();
41 static PassRefPtrWillBeRawPtr<SVGScriptElement> create(Document&, bool wasInsertedByParser);
43 ScriptLoader* loader() const { return m_loader.get(); }
46 virtual bool isAnimatableAttribute(const QualifiedName&) const OVERRIDE;
50 SVGScriptElement(Document&, bool wasInsertedByParser, bool alreadyStarted);
51 virtual ~SVGScriptElement();
53 bool isSupportedAttribute(const QualifiedName&);
54 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
55 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
56 virtual void didNotifySubtreeInsertionsToDocument() OVERRIDE;
57 virtual void childrenChanged(const ChildrenChange&) OVERRIDE;
58 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE;
60 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
61 virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
62 virtual bool isStructurallyExternal() const OVERRIDE { return hasSourceAttribute(); }
63 virtual void finishParsingChildren() OVERRIDE;
65 virtual bool haveLoadedRequiredResources() OVERRIDE;
67 virtual String sourceAttributeValue() const OVERRIDE;
68 virtual String charsetAttributeValue() const OVERRIDE;
69 virtual String typeAttributeValue() const OVERRIDE;
70 virtual String languageAttributeValue() const OVERRIDE;
71 virtual String forAttributeValue() const OVERRIDE;
72 virtual String eventAttributeValue() const OVERRIDE;
73 virtual bool asyncAttributeValue() const OVERRIDE;
74 virtual bool deferAttributeValue() const OVERRIDE;
75 virtual bool hasSourceAttribute() const OVERRIDE;
77 virtual void dispatchLoadEvent() OVERRIDE;
79 virtual PassRefPtrWillBeRawPtr<Element> cloneElementWithoutAttributesAndChildren() OVERRIDE;
80 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE { return false; }
82 virtual Timer<SVGElement>* svgLoadEventTimer() OVERRIDE { return &m_svgLoadEventTimer; }
85 Timer<SVGElement> m_svgLoadEventTimer;
86 OwnPtr<ScriptLoader> m_loader;
91 #endif // SVGScriptElement_h