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

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

Issue 1814853003: Track whether an element was inserted via document.write (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on #384935 Created 4 years, 8 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 reserv ed. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 5 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 10 matching lines...) Expand all
21 * 21 *
22 */ 22 */
23 23
24 #ifndef HTMLScriptElement_h 24 #ifndef HTMLScriptElement_h
25 #define HTMLScriptElement_h 25 #define HTMLScriptElement_h
26 26
27 #include "core/CoreExport.h" 27 #include "core/CoreExport.h"
28 #include "core/dom/ScriptLoader.h" 28 #include "core/dom/ScriptLoader.h"
29 #include "core/dom/ScriptLoaderClient.h" 29 #include "core/dom/ScriptLoaderClient.h"
30 #include "core/html/HTMLElement.h" 30 #include "core/html/HTMLElement.h"
31 #include "core/html/parser/HTMLConstructionSite.h"
31 32
32 namespace blink { 33 namespace blink {
33 34
34 class CORE_EXPORT HTMLScriptElement final : public HTMLElement, public ScriptLoa derClient { 35 class CORE_EXPORT HTMLScriptElement final : public HTMLElement, public ScriptLoa derClient {
35 DEFINE_WRAPPERTYPEINFO(); 36 DEFINE_WRAPPERTYPEINFO();
36 public: 37 public:
37 static RawPtr<HTMLScriptElement> create(Document&, bool wasInsertedByParser, bool alreadyStarted = false); 38 static RawPtr<HTMLScriptElement> create(Document&, int constructionContextFl ags);
38 39
39 String text() { return textFromChildren(); } 40 String text() { return textFromChildren(); }
40 void setText(const String&); 41 void setText(const String&);
41 42
42 KURL src() const; 43 KURL src() const;
43 44
44 void setAsync(bool); 45 void setAsync(bool);
45 bool async() const; 46 bool async() const;
46 47
47 ScriptLoader* loader() const { return m_loader.get(); } 48 ScriptLoader* loader() const { return m_loader.get(); }
48 49
49 DECLARE_VIRTUAL_TRACE(); 50 DECLARE_VIRTUAL_TRACE();
50 51
51 private: 52 private:
52 HTMLScriptElement(Document&, bool wasInsertedByParser, bool alreadyStarted); 53 HTMLScriptElement(Document&, int constructionContextFlags);
53 54
54 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override; 55 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override;
55 InsertionNotificationRequest insertedInto(ContainerNode*) override; 56 InsertionNotificationRequest insertedInto(ContainerNode*) override;
56 void didNotifySubtreeInsertionsToDocument() override; 57 void didNotifySubtreeInsertionsToDocument() override;
57 void childrenChanged(const ChildrenChange&) override; 58 void childrenChanged(const ChildrenChange&) override;
58 void didMoveToNewDocument(Document& oldDocument) override; 59 void didMoveToNewDocument(Document& oldDocument) override;
59 60
60 bool isURLAttribute(const Attribute&) const override; 61 bool isURLAttribute(const Attribute&) const override;
61 bool hasLegalLinkAttribute(const QualifiedName&) const override; 62 bool hasLegalLinkAttribute(const QualifiedName&) const override;
62 const QualifiedName& subResourceAttributeName() const override; 63 const QualifiedName& subResourceAttributeName() const override;
(...skipping 11 matching lines...) Expand all
74 void dispatchLoadEvent() override; 75 void dispatchLoadEvent() override;
75 76
76 RawPtr<Element> cloneElementWithoutAttributesAndChildren() override; 77 RawPtr<Element> cloneElementWithoutAttributesAndChildren() override;
77 78
78 Member<ScriptLoader> m_loader; 79 Member<ScriptLoader> m_loader;
79 }; 80 };
80 81
81 } // namespace blink 82 } // namespace blink
82 83
83 #endif // HTMLScriptElement_h 84 #endif // HTMLScriptElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698