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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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
Index: third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js
deleted file mode 100644
index 11db3e60a1f9e89880264be221b882044f65f5d4..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js
+++ /dev/null
@@ -1,75 +0,0 @@
-description("Test that iframe.contentWindow.document.write() can convert a document to strict mode -- https://bugs.webkit.org/show_bug.cgi?id=24336");
-
-// Simple recurisve "give me a string to represent this tree" function
-function treeAsString(node) {
- var string = node.nodeName;
- if (node.childNodes.length) {
- string += " [";
- }
- for (var x = 0; x < node.childNodes.length; x++) {
- if (x != 0) {
- string += ", ";
- }
- string += treeAsString(node.childNodes[x]);
- }
-
- if (node.childNodes.length) {
- string += "]";
- }
- return string;
-}
-
-function doctypeNodeName(iframeDocument) {
- // WebKit returns "html" (matching the specified name of the doctype source)
- // Gecko returns "HTML" and IE "#comment"
- // We don't care for this test, so we use this hack.
- return iframeDocument.firstChild.nodeName;
-}
-
-var iframe = document.createElement("iframe");
-document.body.appendChild(iframe);
-var iframeDocument = iframe.contentWindow.document;
-
-debug("about:blank is quirksmode by default")
-shouldBeEqualToString("iframeDocument.compatMode", "BackCompat");
-debug("ensure that about:blank's DOM has an html and body element")
-shouldBeEqualToString("treeAsString(iframeDocument)", "#document [HTML [HEAD, BODY]]");
-
-iframeDocument.write("<!DocType html><html><body>test</body></html>");
-debug("writing a doctype as the first document.write can change the document to standards")
-shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat");
-debug("ensure the written DOM has an html and body element")
-shouldBeEqualToString("treeAsString(iframeDocument)", "#document [" + doctypeNodeName(iframeDocument) + ", HTML [HEAD, BODY [#text]]]");
-
-// document.open() doesn't seem to clear the document as expected in Gecko
-// https://bugzilla.mozilla.org/show_bug.cgi?id=483908
-// All tests after this points are likely to fail in Firefox
-iframe.contentWindow.document.open();
-debug("ensure that document.open clears the document but does not change the document pointer")
-shouldBe("iframeDocument", "iframe.contentWindow.document");
-debug("document.open should also clear the document and reset the doctype)")
-shouldBeEqualToString("treeAsString(iframeDocument)", "#document");
-shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat");
-
-debug("document.write of \"\" should leave the document in no-quirks mode and add no content to the document")
-iframeDocument.write("");
-shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat");
-shouldBeEqualToString("treeAsString(iframeDocument)", "#document");
-
-debug("document.write calls can change the doctype until an &lt;html> is created")
-iframeDocument.write("<!DocType html><html><body>test</body></html>");
-shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat");
-
-debug("reset the document again");
-iframe.contentWindow.document.open();
-
-debug("document.write of \"&lt;html>\" should leave the document in quirksmode and add only an HTML element, no body")
-iframeDocument.write("<html>");
-shouldBeEqualToString("iframeDocument.compatMode", "BackCompat");
-shouldBeEqualToString("treeAsString(iframeDocument)", "#document [HTML]");
-
-debug("any document.write calls after &lt;html> has been encountered cannot change the doctype")
-iframeDocument.write("<!DocType html><html><body>test</body></html>");
-shouldBeEqualToString("iframeDocument.compatMode", "BackCompat");
-
-document.body.removeChild(iframe);

Powered by Google App Engine
This is Rietveld 408576698