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

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

Issue 110183005: DevTools: added console warning when call to document.write() from async script is ignored (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 7 years 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 | « LayoutTests/inspector/resources/external-script-with-document-write.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 8b7633901a08b68c521017b2fd2ff03441dd210d..199b5b2c0cfb44da621eafaf28364f26ab9d6a99 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2557,8 +2557,11 @@ void Document::write(const SegmentedString& text, Document* ownerDocument)
return;
bool hasInsertionPoint = m_parser && m_parser->hasInsertionPoint();
- if (!hasInsertionPoint && m_ignoreDestructiveWriteCount)
+
+ if (!hasInsertionPoint && m_ignoreDestructiveWriteCount) {
+ addConsoleMessage(JSMessageSource, WarningMessageLevel, ExceptionMessages::failedToExecute("write", "Document", "It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened."));
return;
+ }
if (!hasInsertionPoint)
open(ownerDocument);
« no previous file with comments | « LayoutTests/inspector/resources/external-script-with-document-write.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698