Index: Source/core/page/PageConsole.cpp |
diff --git a/Source/core/page/PageConsole.cpp b/Source/core/page/PageConsole.cpp |
index 07bbb252a6ce2974edde7df033fa5d860034e9b2..034341e56882cd105cc822aa9115a8f28d0b7e42 100644 |
--- a/Source/core/page/PageConsole.cpp |
+++ b/Source/core/page/PageConsole.cpp |
@@ -46,6 +46,11 @@ namespace { |
int muteCount = 0; |
+static bool shouldCollectParserStateForSourceType(MessageSource source) |
+{ |
+ return source == RenderingMessageSource || source == CSSMessageSource || source == OtherMessageSource; |
+} |
+ |
} |
PageConsole::PageConsole(Page* page) |
@@ -55,13 +60,13 @@ PageConsole::PageConsole(Page* page) |
PageConsole::~PageConsole() { } |
-void PageConsole::addMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier, Document* document) |
+void PageConsole::addMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier, Document* document, ParserStateCollectionDisposition parserStateDisposition) |
{ |
String url; |
if (document) |
url = document->url().string(); |
unsigned line = 0; |
- if (document && document->parsing() && !document->isInDocumentWrite() && document->scriptableDocumentParser()) { |
+ if ((shouldCollectParserStateForSourceType(source) || parserStateDisposition == ForceParserStateCollection) && document && document->parsing() && !document->isInDocumentWrite() && document->scriptableDocumentParser()) { |
ScriptableDocumentParser* parser = document->scriptableDocumentParser(); |
if (!parser->isWaitingForScripts() && !parser->isExecutingScript()) |
line = parser->lineNumber().oneBasedInt(); |