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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptLoader.h

Issue 2099853002: Don't preload scripts with invalid type/language attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: isLegacySupportedJavascriptLanguage requires lowercase input Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 { 43 {
44 return new ScriptLoader(element, createdByParser, isEvaluated, createdDu ringDocumentWrite); 44 return new ScriptLoader(element, createdByParser, isEvaluated, createdDu ringDocumentWrite);
45 } 45 }
46 46
47 ~ScriptLoader() override; 47 ~ScriptLoader() override;
48 DECLARE_VIRTUAL_TRACE(); 48 DECLARE_VIRTUAL_TRACE();
49 49
50 Element* element() const { return m_element; } 50 Element* element() const { return m_element; }
51 51
52 enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeI nTypeAttribute }; 52 enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeI nTypeAttribute };
53 static bool isValidScriptTypeAndLanguage(const String& typeAttributeValue, c onst String& languageAttributeValue, LegacyTypeSupport supportLegacyTypes);
54
53 bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::m inimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute); 55 bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::m inimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
54 56
55 String scriptCharset() const { return m_characterEncoding; } 57 String scriptCharset() const { return m_characterEncoding; }
56 String scriptContent() const; 58 String scriptContent() const;
57 // Returns false if and only if execution was blocked. 59 // Returns false if and only if execution was blocked.
58 bool executeScript(const ScriptSourceCode&, double* compilationFinishTime = 0); 60 bool executeScript(const ScriptSourceCode&, double* compilationFinishTime = 0);
59 virtual void execute(); 61 virtual void execute();
60 62
61 // XML parser calls these 63 // XML parser calls these
62 void dispatchLoadEvent(); 64 void dispatchLoadEvent();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 const bool m_createdDuringDocumentWrite : 1; 124 const bool m_createdDuringDocumentWrite : 1;
123 125
124 Member<PendingScript> m_pendingScript; 126 Member<PendingScript> m_pendingScript;
125 }; 127 };
126 128
127 ScriptLoader* toScriptLoaderIfPossible(Element*); 129 ScriptLoader* toScriptLoaderIfPossible(Element*);
128 130
129 } // namespace blink 131 } // namespace blink
130 132
131 #endif // ScriptLoader_h 133 #endif // ScriptLoader_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698