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

Unified Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 771493002: Insert the error message block when stopping parsing and an error occurred Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « LayoutTests/fast/dom/dom-parse-parsererror-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « LayoutTests/fast/dom/dom-parse-parsererror-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698