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

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: Created 4 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 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 16 matching lines...) Expand all
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 31
32 namespace blink { 32 namespace blink {
33 33
34 class CORE_EXPORT HTMLScriptElement final : public HTMLElement, public ScriptLoa derClient { 34 class CORE_EXPORT HTMLScriptElement final : public HTMLElement, public ScriptLoa derClient {
35 DEFINE_WRAPPERTYPEINFO(); 35 DEFINE_WRAPPERTYPEINFO();
36 public: 36 public:
37 static PassRefPtrWillBeRawPtr<HTMLScriptElement> create(Document&, bool wasI nsertedByParser, bool alreadyStarted = false); 37 static PassRefPtrWillBeRawPtr<HTMLScriptElement> create(Document&, bool wasI nsertedByParser, bool alreadyStarted = false, bool createdDuringDocumentWrite = false);
kouhei (in TOK) 2016/03/18 02:24:26 Use two value enum here. (non-historic) Blink code
Charlie Harrison 2016/03/18 14:10:46 Are boolean members ok?
kouhei (in TOK) 2016/03/22 04:18:39 I don't see a rule for members, so I guess its ok.
38 38
39 String text() { return textFromChildren(); } 39 String text() { return textFromChildren(); }
40 void setText(const String&); 40 void setText(const String&);
41 41
42 KURL src() const; 42 KURL src() const;
43 43
44 void setAsync(bool); 44 void setAsync(bool);
45 bool async() const; 45 bool async() const;
46 46
47 ScriptLoader* loader() const { return m_loader.get(); } 47 ScriptLoader* loader() const { return m_loader.get(); }
48 48
49 DECLARE_VIRTUAL_TRACE(); 49 DECLARE_VIRTUAL_TRACE();
50 50
51 private: 51 private:
52 HTMLScriptElement(Document&, bool wasInsertedByParser, bool alreadyStarted); 52 HTMLScriptElement(Document&, bool wasInsertedByParser, bool alreadyStarted, bool createdDuringDocumentWrite);
53 53
54 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override; 54 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override;
55 InsertionNotificationRequest insertedInto(ContainerNode*) override; 55 InsertionNotificationRequest insertedInto(ContainerNode*) override;
56 void didNotifySubtreeInsertionsToDocument() override; 56 void didNotifySubtreeInsertionsToDocument() override;
57 void childrenChanged(const ChildrenChange&) override; 57 void childrenChanged(const ChildrenChange&) override;
58 void didMoveToNewDocument(Document& oldDocument) override; 58 void didMoveToNewDocument(Document& oldDocument) override;
59 59
60 bool isURLAttribute(const Attribute&) const override; 60 bool isURLAttribute(const Attribute&) const override;
61 bool hasLegalLinkAttribute(const QualifiedName&) const override; 61 bool hasLegalLinkAttribute(const QualifiedName&) const override;
62 const QualifiedName& subResourceAttributeName() const override; 62 const QualifiedName& subResourceAttributeName() const override;
(...skipping 11 matching lines...) Expand all
74 void dispatchLoadEvent() override; 74 void dispatchLoadEvent() override;
75 75
76 PassRefPtrWillBeRawPtr<Element> cloneElementWithoutAttributesAndChildren() o verride; 76 PassRefPtrWillBeRawPtr<Element> cloneElementWithoutAttributesAndChildren() o verride;
77 77
78 OwnPtrWillBeMember<ScriptLoader> m_loader; 78 OwnPtrWillBeMember<ScriptLoader> m_loader;
79 }; 79 };
80 80
81 } // namespace blink 81 } // namespace blink
82 82
83 #endif // HTMLScriptElement_h 83 #endif // HTMLScriptElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698