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

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: Fix svg/custom/missing-xlink.svg Created 5 years, 8 months 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 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());
« 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