Index: Source/core/html/parser/HTMLDocumentParser.cpp |
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp |
index c7fc2c6758a7e9a5a4ab7963765ce371c79d535c..8a8e9b4a344311537b2dc6704806fcde8d518c8e 100644 |
--- a/Source/core/html/parser/HTMLDocumentParser.cpp |
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp |
@@ -45,6 +45,7 @@ |
#include "platform/TraceEvent.h" |
#include "public/platform/WebThreadedDataReceiver.h" |
#include "wtf/Functional.h" |
+#include "wtf/TemporaryChange.h" |
namespace blink { |
@@ -119,6 +120,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument& document, bool reportErrors |
, m_tasksWereSuspended(false) |
, m_pumpSessionNestingLevel(0) |
, m_pumpSpeculationsSessionNestingLevel(0) |
+ , m_hasLineNumber(false) |
{ |
ASSERT(shouldUseThreading() || (m_token && m_tokenizer)); |
} |
@@ -415,6 +417,7 @@ void HTMLDocumentParser::discardSpeculationsAndResumeFrom(PassOwnPtr<ParsedChunk |
size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> popChunk) |
{ |
TRACE_EVENT0("blink", "HTMLDocumentParser::processParsedChunkFromBackgroundParser"); |
+ TemporaryChange<bool> hasLineNumber(m_hasLineNumber, true); |
ASSERT_WITH_SECURITY_IMPLICATION(document()->activeParserCount() == 1); |
ASSERT(!isParsingFragment()); |
@@ -489,6 +492,8 @@ size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<Par |
if (!isStopped()) |
m_treeBuilder->flush(FlushIfAtTextLimit); |
+ m_hasLineNumber = false; |
+ |
return elementTokenCount; |
} |
@@ -907,6 +912,11 @@ bool HTMLDocumentParser::isExecutingScript() const |
return m_scriptRunner->isExecutingScript(); |
} |
+bool HTMLDocumentParser::isParsingAtLineNumber() const |
+{ |
+ return m_hasLineNumber && ScriptableDocumentParser::isParsingAtLineNumber(); |
+} |
+ |
OrdinalNumber HTMLDocumentParser::lineNumber() const |
{ |
if (m_haveBackgroundParser) |