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

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: 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 | « no previous file | 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..673c64af47a33dc93b6782cb96754209ac8c7bca 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, "A call to document.write() from an asynchronously-loaded external script was ignored.");
Mike West 2013/12/23 16:08:15 Please change this to use 'ExceptionMessages::fail
return;
+ }
if (!hasInsertionPoint)
open(ownerDocument);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698