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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLScriptElement.h

Issue 2723793002: De-Element ScriptLoader (Closed)
Patch Set: De-Element ScriptLoader Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
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 17 matching lines...) Expand all
28 #include "core/CoreExport.h" 28 #include "core/CoreExport.h"
29 #include "core/dom/ScriptLoader.h" 29 #include "core/dom/ScriptLoader.h"
30 #include "core/dom/ScriptLoaderClient.h" 30 #include "core/dom/ScriptLoaderClient.h"
31 #include "core/html/HTMLElement.h" 31 #include "core/html/HTMLElement.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 class CORE_EXPORT HTMLScriptElement final : public HTMLElement, 35 class CORE_EXPORT HTMLScriptElement final : public HTMLElement,
36 public ScriptLoaderClient { 36 public ScriptLoaderClient {
37 DEFINE_WRAPPERTYPEINFO(); 37 DEFINE_WRAPPERTYPEINFO();
38 USING_GARBAGE_COLLECTED_MIXIN(HTMLScriptElement);
38 39
39 public: 40 public:
40 static HTMLScriptElement* create(Document&, 41 static HTMLScriptElement* create(Document&,
41 bool wasInsertedByParser, 42 bool wasInsertedByParser,
42 bool alreadyStarted = false, 43 bool alreadyStarted = false,
43 bool createdDuringDocumentWrite = false); 44 bool createdDuringDocumentWrite = false);
44 45
45 String text() { return textFromChildren(); } 46 String text() { return textFromChildren(); }
46 void setText(const String&); 47 void setText(const String&);
47 48
48 KURL src() const; 49 KURL src() const;
49 50
50 void setAsync(bool); 51 void setAsync(bool);
51 bool async() const; 52 bool async() const;
52 53
53 ScriptLoader* loader() const { return m_loader.get(); } 54 ScriptLoader* loader() const { return m_loader.get(); }
54 55
56 Document& document() const override;
57
55 DECLARE_VIRTUAL_TRACE(); 58 DECLARE_VIRTUAL_TRACE();
56 59
57 private: 60 private:
58 HTMLScriptElement(Document&, 61 HTMLScriptElement(Document&,
59 bool wasInsertedByParser, 62 bool wasInsertedByParser,
60 bool alreadyStarted, 63 bool alreadyStarted,
61 bool createdDuringDocumentWrite); 64 bool createdDuringDocumentWrite);
62 65
63 void parseAttribute(const AttributeModificationParams&) override; 66 void parseAttribute(const AttributeModificationParams&) override;
64 InsertionNotificationRequest insertedInto(ContainerNode*) override; 67 InsertionNotificationRequest insertedInto(ContainerNode*) override;
65 void didNotifySubtreeInsertionsToDocument() override; 68 void didNotifySubtreeInsertionsToDocument() override;
66 void childrenChanged(const ChildrenChange&) override; 69 void childrenChanged(const ChildrenChange&) override;
67 void didMoveToNewDocument(Document& oldDocument) override; 70 void didMoveToNewDocument(Document& oldDocument) override;
68 71
69 bool isURLAttribute(const Attribute&) const override; 72 bool isURLAttribute(const Attribute&) const override;
70 bool hasLegalLinkAttribute(const QualifiedName&) const override; 73 bool hasLegalLinkAttribute(const QualifiedName&) const override;
71 const QualifiedName& subResourceAttributeName() const override; 74 const QualifiedName& subResourceAttributeName() const override;
72 75
76 // ScriptLoaderClient overrides:
73 String sourceAttributeValue() const override; 77 String sourceAttributeValue() const override;
74 String charsetAttributeValue() const override; 78 String charsetAttributeValue() const override;
75 String typeAttributeValue() const override; 79 String typeAttributeValue() const override;
76 String languageAttributeValue() const override; 80 String languageAttributeValue() const override;
77 String forAttributeValue() const override; 81 String forAttributeValue() const override;
78 String eventAttributeValue() const override; 82 String eventAttributeValue() const override;
83 String crossOriginAttributeValue() const override;
84 String integrityAttributeValue() const override;
85 String textFromChildren() override;
86 String textContent() const override;
79 bool asyncAttributeValue() const override; 87 bool asyncAttributeValue() const override;
80 bool deferAttributeValue() const override; 88 bool deferAttributeValue() const override;
81 bool hasSourceAttribute() const override; 89 bool hasSourceAttribute() const override;
82 90 bool isConnected() const override;
91 bool hasChildren() const override;
92 bool isNonceableElement() const override;
93 bool allowInlineScriptForCSP(const AtomicString& nonce,
94 const WTF::OrdinalNumber&,
95 const String& scriptContent) override;
96 AtomicString initiatorName() const override;
83 void dispatchLoadEvent() override; 97 void dispatchLoadEvent() override;
98 void dispatchErrorEvent() override;
99 void setScriptElementForBinding(
100 HTMLScriptElementOrSVGScriptElement&) override;
84 101
85 Element* cloneElementWithoutAttributesAndChildren() override; 102 Element* cloneElementWithoutAttributesAndChildren() override;
86
87 Member<ScriptLoader> m_loader;
88 }; 103 };
89 104
90 } // namespace blink 105 } // namespace blink
91 106
92 #endif // HTMLScriptElement_h 107 #endif // HTMLScriptElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698