[XML Parser] Insert the error message block when stopping parsing and an error occurred
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Apr 2019 19:13:49 +0000 (19:13 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Apr 2019 19:13:49 +0000 (19:13 +0000)
commit852355f0cdf0cb8788cb5b6cc90563588a0d70e9
tree81cbf7a3590a2ba942bcd040dfaeddc2ebc72be6
parenta5725df3e5ecd60a9c3d93efaa204f37d887c451
[XML Parser] Insert the error message block when stopping parsing and an error occurred
https://bugs.webkit.org/show_bug.cgi?id=196546

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

Rebaseline WPT test now that all checks are passing. Both Gecko and Blink already passed
these checks.

* web-platform-tests/domparsing/DOMParser-parseFromString-xml-parsererror-expected.txt:

Source/WebCore:

Insert the error message block when stopping parsing and an error occurred. This is based
on the following Blink commit:
- https://chromium.googlesource.com/chromium/src.git/+/565958bc22e2d49fed7af144482c2bf4d416fec5

No new tests, rebaselined existing test.

* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
Avoid showing the error message block twice in some cases. No need to ever call
insertErrorMessageBlock() if we're already stopped since stopParsing() already
takes care of doing this.

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::stopParsing):
When XMLDocumentParser::stopParsing() is called to stop parsing, call
insertErrorMessageBlock() to insert the <parsererror> element if an error
occurred.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/domparsing/DOMParser-parseFromString-xml-parsererror-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/xml/parser/XMLDocumentParser.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp