Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / core / html / HTMLScriptElement.h
blobb5e629e758dc6a7d2bca4b0eae8f142da346930e
1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
24 #ifndef HTMLScriptElement_h
25 #define HTMLScriptElement_h
27 #include "core/CoreExport.h"
28 #include "core/dom/ScriptLoader.h"
29 #include "core/dom/ScriptLoaderClient.h"
30 #include "core/html/HTMLElement.h"
32 namespace blink {
34 class CORE_EXPORT HTMLScriptElement final : public HTMLElement, public ScriptLoaderClient {
35 DEFINE_WRAPPERTYPEINFO();
36 public:
37 static PassRefPtrWillBeRawPtr<HTMLScriptElement> create(Document&, bool wasInsertedByParser, bool alreadyStarted = false);
39 String text() { return textFromChildren(); }
40 void setText(const String&);
42 KURL src() const;
44 void setAsync(bool);
45 bool async() const;
47 ScriptLoader* loader() const { return m_loader.get(); }
49 DECLARE_VIRTUAL_TRACE();
51 private:
52 HTMLScriptElement(Document&, bool wasInsertedByParser, bool alreadyStarted);
54 void parseAttribute(const QualifiedName&, const AtomicString&) override;
55 void attributeWillChange(const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue) override;
56 InsertionNotificationRequest insertedInto(ContainerNode*) override;
57 void didNotifySubtreeInsertionsToDocument() override;
58 void childrenChanged(const ChildrenChange&) override;
59 void didMoveToNewDocument(Document& oldDocument) override;
61 bool isURLAttribute(const Attribute&) const override;
62 bool hasLegalLinkAttribute(const QualifiedName&) const override;
63 const QualifiedName& subResourceAttributeName() const override;
65 String sourceAttributeValue() const override;
66 String charsetAttributeValue() const override;
67 String typeAttributeValue() const override;
68 String languageAttributeValue() const override;
69 String forAttributeValue() const override;
70 String eventAttributeValue() const override;
71 bool asyncAttributeValue() const override;
72 bool deferAttributeValue() const override;
73 bool hasSourceAttribute() const override;
75 void dispatchLoadEvent() override;
77 PassRefPtrWillBeRawPtr<Element> cloneElementWithoutAttributesAndChildren() override;
79 OwnPtrWillBeMember<ScriptLoader> m_loader;
82 } // namespace blink
84 #endif // HTMLScriptElement_h