https://bugs.webkit.org/show_bug.cgi?id=227846
Reviewed by Ryosuke Niwa.
LayoutTests/imported/w3c:
Rebaseline WPT test that is now passing.
* web-platform-tests/domparsing/xmldomparser-expected.txt:
Source/WebCore:
document.readyState should be "complete" after calling DOMParser.parseFromString().
This is causing the following WPT test to fail in WebKit:
http://wpt.live/domparsing/xmldomparser.html
Both Gecko and Blink report the correct readyState here.
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::explicitClose):
explicitClose() normally calls checkCompleted() which calls FrameLoader::checkCompleted(),
which ends up setting the document's ready state to "complete" and then calling
Document::implicitClose(). However, when the document has no frame (which is the case
for a document just created via DOMParser.parseFromString()), we would call
Document::implicitClose() directly, since we don't have a FrameLoader. As a result,
the document's ready state would stay "interactive". To address the issue, we now set
the document's ready state to "complete" before calling implicitClose(), similarly to
what FrameLoader::checkCompleted() would have done.
Canonical link: https://commits.webkit.org/239575@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279814 268f45cc-cd09-0410-ab3c-d52691b4dbfc