3 <script id=
"first"></script>
6 var c = document.getElementById('console')
7 c.appendChild(document.createTextNode(str + '\n'));
10 function print(message, color)
12 var paragraph = document.createElement(
"div");
13 paragraph.appendChild(document.createTextNode(message));
14 paragraph.style.fontFamily =
"monospace";
16 paragraph.style.color = color;
17 document.getElementById(
"console").appendChild(paragraph);
20 var element, range, nodeFilter, cssRule, cssPrimitiveValue, cssStyleDeclaration, event;
21 var originalNodeConstructor;
23 function shouldBe(a, b)
32 print(
"PASS: " + a +
" should be " + b +
" and is.",
"green");
34 print(
"FAIL: " + a +
" should be " + b +
" but instead is " + evalA,
"red");
38 if (window.testRunner)
39 testRunner.dumpAsText();
41 shouldBe(document.scripts.length,
2);
42 shouldBe(
"document.scripts[0].id",
"first");
43 shouldBe(
"document.scripts[1].id",
"second");
48 <body onload=
"runTests();">
49 This tests that document.scripts works correctly.