Index: Source/core/xml/parser/XMLDocumentParser.cpp |
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp |
index 2e5fd031092d9b9d1f4d5045e757a87dedce55fe..f80d85faa6b0c9f08581154c72687bcdeb14e73b 100644 |
--- a/Source/core/xml/parser/XMLDocumentParser.cpp |
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp |
@@ -424,7 +424,9 @@ void XMLDocumentParser::end() |
if (m_parserPaused) |
return; |
- if (m_sawError) { |
+ // stopParsing() calls insertErrorMessageBlock() if there was a parsing |
+ // error. Avoid showing the error message block twice. |
+ if (m_sawError && !isStopped()) { |
insertErrorMessageBlock(); |
} else { |
exitText(); |
@@ -1553,6 +1555,8 @@ TextPosition XMLDocumentParser::textPosition() const |
void XMLDocumentParser::stopParsing() |
{ |
+ if (m_sawError) |
+ insertErrorMessageBlock(); |
DocumentParser::stopParsing(); |
if (context()) |
xmlStopParser(context()); |