5 return external.ok(b, m);
8 function test_removeAttribute(e) {
9 ok(e.removeAttribute('nonexisting') === false, "removeAttribute('nonexisting') didn't return false");
12 ok(e.removeAttribute('title') === true, "removeAttribute('title') didn't return true");
13 ok(e.title === "", "e.title = " + e.title);
14 ok(("title" in e) === true, "title is not in e");
17 ok(e.removeAttribute('myattr') === true, "removeAttribute('myattr') didn't return true");
18 ok(e["myattr"] === undefined, "e['myattr'] = " + e['myattr']);
19 ok(("myattr" in e) === false, "myattr is in e");
23 function test_select_index() {
24 var s = document.getElementById("sel");
26 ok("0" in s, "'0' is not in s");
27 ok(s[0].text === "opt1", "s[0].text = " + s[0].text);
28 ok("1" in s, "'1 is not in s");
29 ok(s[1].text === "opt2", "s[1].text = " + s[1].text);
30 ok("2" in s, "'2' is in s");
31 ok(s[2] === null, "s[2] = " + s[2]);
34 function test_createDocumentFragment() {
35 var fragment = document.createDocumentFragment();
37 ok(typeof(fragment) === "object", "typeof(fragmend) = " + typeof(fragment));
38 ok(fragment.nodeType === 11, "fragment.nodeType = " + fragment.nodeType);
39 ok(fragment.nodeName === "#document-fragment", "fragment.nodeName = " + fragment.nodeName);
41 var cloned = fragment.cloneNode(true);
42 ok(cloned.nodeType === 11, "cloned.nodeType = " + cloned.nodeType);
43 ok(cloned.nodeName === "#document-fragment", "cloned.nodeName = " + cloned.nodeName);
46 function test_document_name_as_index() {
47 document.body.innerHTML = '<form name="formname"></form>';
48 var e = document.getElementById("formname");
51 ok(document.formname === e, "document.formname != getElementById('formname')");
52 ok("formname" in document, "formname' is not in document");
54 document.body.removeChild(e);
56 ok(document.formname === undefined, "document.formname is not undefined");
57 ok(!("formname" in document), "formname' is in document");
59 document.body.innerHTML = '<form id="formid"></form>';
60 var e = document.getElementById("formid");
62 ok(!("formid" in document), "formid is in document");
65 var globalVar = false;
69 ok(obj === window.obj, "obj !== window.obj");
71 ok(typeof(divid) === "object", "typeof(divid) = " + typeof(divid));
73 test_removeAttribute(document.getElementById("divid"));
74 test_removeAttribute(document.body);
76 test_createDocumentFragment();
77 test_document_name_as_index();
79 var r = window.execScript("globalVar = true;");
80 ok(r === undefined, "execScript returned " + r);
81 ok(globalVar === true, "globalVar = " + globalVar);
83 external.reportSuccess();
86 <body onload="runTest();">
87 <div id="divid"></div>