haikuwebkit/LayoutTests/fast/dom/Document
Chris Dumez a330317f38 document.readyState should be "complete" after calling DOMParser.parseFromString()
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
2021-07-11 04:16:05 +00:00
..
CaretRangeFromPoint
resources
adoptNode-null-expected.txt
adoptNode-null.html
adoptNode-quirks-mismatch-expected.txt
adoptNode-quirks-mismatch.html
adoptNode-quirks-mismatch2-expected.txt
adoptNode-quirks-mismatch2.html
clone-node-expected.txt
clone-node.html
compatMode-location-expected.txt
compatMode-location.html
createAttributeNS-namespace-err-expected.txt
createAttributeNS-namespace-err.html
createAttributeNS-undefined-namespace-expected.txt
createAttributeNS-undefined-namespace.html
createElement-invalid-names-expected.txt
createElement-invalid-names.html
createElement-valid-names-expected.txt
createElement-valid-names.html
createElementNS-namespace-err-expected.txt
createElementNS-namespace-err.html
createdDocument-readyState-expected.txt document.readyState should be "complete" after calling DOMParser.parseFromString() 2021-07-11 04:16:05 +00:00
createdDocument-readyState.html document.readyState should be "complete" after calling DOMParser.parseFromString() 2021-07-11 04:16:05 +00:00
doc-open-while-parsing-expected.txt
doc-open-while-parsing.html
document-charset-expected.txt
document-charset.html
document-constructor-expected.txt
document-constructor.html
document-current-script-async-expected.txt
document-current-script-async.html
document-current-script-expected.txt
document-current-script.html
document-execcommand-expected.txt Document's execCommand() / queryCommand*() should throw an exception on non-HTML/XHTML documents 2021-06-17 05:39:51 +00:00
document-execcommand.html Document's execCommand() / queryCommand*() should throw an exception on non-HTML/XHTML documents 2021-06-17 05:39:51 +00:00
document-open-removes-all-listeners-expected.txt
document-open-removes-all-listeners.html
document-reopen-expected.txt
document-reopen.html
document-set-title-no-child-expected.txt
document-set-title-no-child.html
document-title-get-expected.txt
document-title-get.html
document-write-doctype-expected.txt
document-write-doctype.html
document-write-recursion-expected.txt
document-write-recursion.html
early-document-access-expected.txt
early-document-access.html
editing-parameters-expected.txt
editing-parameters.html
importNode-null-expected.txt
importNode-null.html
invalid-domain-change-throws-exception-expected.txt
invalid-domain-change-throws-exception.html
open-with-pending-load-async-policy-expected.txt
open-with-pending-load-async-policy.html
open-with-pending-load-expected.txt
open-with-pending-load.html
readystate-expected.txt
readystate.html
replace-child-expected.txt
replace-child.html
replaceChild-null-oldChild-expected.txt
replaceChild-null-oldChild.html
scrollingElement-quirks-mode-expected.txt
scrollingElement-quirks-mode.html
scrollingElement-standards-mode-expected.txt
scrollingElement-standards-mode.html
title-property-creates-title-element-expected.txt
title-property-creates-title-element.html
title-property-set-multiple-times-expected.txt
title-property-set-multiple-times.html
title-property-set-with-dom-event-expected.txt
title-property-set-with-dom-event-svg-expected.txt
title-property-set-with-dom-event-svg.html
title-property-set-with-dom-event.html
title-with-multiple-children-expected.txt
title-with-multiple-children.html
xml-document-focus-expected.txt
xml-document-focus.xml