blob: 2b53c1d53ff7abe5696c8493a57afddaf36aaeda [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
<style>
.myclass, #myid
{
color: green;
font-weight: bold;
}
</style>
</head>
<body>
<div id="description"></div>
<div id="container"></div>
<div id="console"></div>
<script>
description("Tests that Document.adoptNode() properly deals with the documents having a different quirks mode");
jsTestIsAsync = true;
var tests = ["resources/document-noquirks-class.html", "resources/document-noquirks-id.html"];
var currentTest = -1;
function documentLoaded()
{
var parsedBodyChild = this.response.body.children[0];
var container = document.getElementById("container");
container.appendChild(document.adoptNode(parsedBodyChild));
shouldBeEqualToString("window.getComputedStyle(container.lastChild).color", "rgb(0, 128, 0)");
runNextTest();
}
function runNextTest()
{
currentTest++;
if (currentTest >= tests.length) {
finishJSTest();
return;
}
var xhr = new XMLHttpRequest();
xhr.responseType = "document";
xhr.addEventListener("load", documentLoaded);
xhr.open("GET", tests[currentTest], true);
xhr.send();
}
runNextTest();
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>