Chromium Code Reviews| Index: Source/core/xml/parser/XMLDocumentParser.cpp |
| diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp |
| index 91b1a131bf96777a588c3b31d6ad116a376824fd..966f25045593e368fdbcd2b574477cb84fef3933 100644 |
| --- a/Source/core/xml/parser/XMLDocumentParser.cpp |
| +++ b/Source/core/xml/parser/XMLDocumentParser.cpp |
| @@ -422,7 +422,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(); |
|
Erik Dahlström (inactive)
2015/01/14 13:35:41
Under which circumstances would the parser be stop
|
| } else { |
| exitText(); |
| @@ -1532,6 +1534,8 @@ TextPosition XMLDocumentParser::textPosition() const |
| void XMLDocumentParser::stopParsing() |
| { |
| + if (!m_parsingFragment && m_sawError && !isStopped()) |
|
Erik Dahlström (inactive)
2015/01/14 13:35:41
What about (m_parsingFragment && m_sawError && !is
|
| + insertErrorMessageBlock(); |
| DocumentParser::stopParsing(); |
| if (context()) |
| xmlStopParser(context()); |