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

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

Issue 2657623005: WIP: Give developers an opt-in mechanism to block some parser-inserted scripts.
Patch Set: Refactor. 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 149561f8cdad9baddb47a9948cd30cacaa9c6487..c78651f2c5243571ee764c50a397e5a9265f8206 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -456,9 +456,8 @@ Document::Document(const DocumentInit& initializer,
m_documentClasses(documentClasses),
m_isViewSource(false),
m_sawElementsInKnownNamespaces(false),
- m_isSrcdocDocument(false),
+ m_srcdocType(NotSrcdoc),
m_isMobileDocument(false),
- m_isFragmentParserCreatedSrcdoc(false),
m_layoutView(0),
m_contextDocument(initializer.contextDocument()),
m_hasFullscreenSupplement(false),
@@ -5481,14 +5480,18 @@ void Document::initSecurityContext(const DocumentInit& initializer) {
}
if (initializer.shouldTreatURLAsSrcdocDocument()) {
- m_isSrcdocDocument = true;
+ m_srcdocType = Srcdoc;
setBaseURLOverride(initializer.parentBaseURL());
if (Element* owner = domWindow()->frameElement()) {
HTMLIFrameElement* iframe = toHTMLIFrameElement(owner);
- m_isFragmentParserCreatedSrcdoc =
- iframe->createdByFragmentParser() ||
- iframe->document().isFragmentParserCreatedSrcdoc();
+ if (iframe->createdByFragmentParser() ||
+ iframe->document().isFragmentParserCreatedSrcdoc()) {
+ m_srcdocType = FragmentParserCreatedSrcdoc;
+ } else if (iframe->createdByDocumentWrite() ||
+ iframe->document().isDocumentWriteCreatedSrcdoc()) {
+ m_srcdocType = DocumentWriteCreatedSrcdoc;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698