blob: 76698c7e6ae7f7e9e65082a6af0fc66e22e18f92 [file] [log] [blame]
Test that iframe.contentWindow.document.write() can convert a document to strict mode -- https://bugs.webkit.org/show_bug.cgi?id=24336
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
about:blank is quirksmode by default
PASS iframeDocument.compatMode is "BackCompat"
ensure that about:blank's DOM has an html and body element
PASS treeAsString(iframeDocument) is "#document [HTML [HEAD, BODY]]"
writing a doctype as the first document.write can change the document to standards
PASS iframeDocument.compatMode is "CSS1Compat"
ensure the written DOM has an html and body element
PASS treeAsString(iframeDocument) is "#document [html, HTML [HEAD, BODY [#text]]]"
ensure that document.open clears the document but does not change the document pointer
PASS iframeDocument is iframe.contentWindow.document
document.open should also clear the document and reset the doctype)
PASS treeAsString(iframeDocument) is "#document"
PASS iframeDocument.compatMode is "CSS1Compat"
document.write of "" should leave the document in no-quirks mode and add no content to the document
PASS iframeDocument.compatMode is "CSS1Compat"
PASS treeAsString(iframeDocument) is "#document"
document.write calls can change the doctype until an <html> is created
PASS iframeDocument.compatMode is "CSS1Compat"
reset the document again
document.write of "<html>" should leave the document in quirksmode and add only an HTML element, no body
PASS iframeDocument.compatMode is "BackCompat"
PASS treeAsString(iframeDocument) is "#document [HTML]"
any document.write calls after <html> has been encountered cannot change the doctype
PASS iframeDocument.compatMode is "BackCompat"
PASS successfullyParsed is true
TEST COMPLETE