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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2657263002: Experiment with blocking script inside fragment-parser-inserted `<iframe srcdoc>`.
Patch Set: Bitwise logic is hard. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index e6a6769683aa230c961fb234b0c5fbd15492a219..7b8ee676ca887998fb45bb6605224c067e57711b 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -80,9 +80,20 @@ ScriptLoader::ScriptLoader(Element* element,
DocumentWriteIntervention::DocumentWriteInterventionNone) {
DCHECK(m_element);
if (parserInserted && element->document().scriptableDocumentParser() &&
- !element->document().isInDocumentWrite())
+ !element->document().isInDocumentWrite()) {
m_startLineNumber =
element->document().scriptableDocumentParser()->lineNumber();
+ }
+
+ // Experiment based on https://github.com/whatwg/html/issues/2300.
+ if (!alreadyStarted && element->document().isFragmentParserCreatedSrcdoc()) {
+ UseCounter::count(element->document(),
+ UseCounter::ScriptInsideFragmentParserInsertedSrcdoc);
+ if (RuntimeEnabledFeatures::
+ scriptInsideParserInsertedSrcdocIsAlreadyStartedEnabled()) {
+ m_alreadyStarted = true;
+ }
+ }
}
ScriptLoader::~ScriptLoader() {}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698