4 https://bugzilla.mozilla.org/show_bug.cgi?id=324378
7 <head id=
"j" foo=
"k" foo=
"l">
8 <title>Test for Bug
324378</title>
9 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
10 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=324378">Mozilla Bug
324378</a>
16 var html
= document
.documentElement
;
17 is(document
.getElementsByTagName("html").length
, 1,
18 "Unexpected number of htmls");
19 is(document
.getElementsByTagName("html")[0], html
,
20 "Unexpected <html> element");
21 is(document
.getElementsByTagName("head").length
, 1,
22 "Unexpected number of heads");
23 is(html
.getElementsByTagName("head").length
, 1,
24 "Unexpected number of heads in <html>");
25 is(document
.getElementsByTagName("body").length
, 1,
26 "Unexpected number of bodies");
27 is(html
.getElementsByTagName("body").length
, 1,
28 "Unexpected number of bodies in <html>");
29 var head
= document
.getElementsByTagName("head")[0];
30 var body
= document
.getElementsByTagName("body")[0];
33 <div id=
"content" style=
"display: none">
34 <html id=
"g" foo=
"h" foo=
"i">
35 <body id=
"m" foo=
"n" foo=
"o">
38 <script class=
"testbody" type=
"text/javascript">
40 /** Test for Bug
324378 **/
41 is(document.getElementsByTagName(
"html").length,
1,
42 "Unexpected number of htmls after additions");
43 is(document.getElementsByTagName(
"html")[
0], html,
44 "Unexpected <html> element");
45 is(document.documentElement, html,
46 "Unexpected root node");
47 is(document.getElementsByTagName(
"head").length,
1,
48 "Unexpected number of heads after additions");
49 is(document.getElementsByTagName(
"head")[
0], head,
50 "Unexpected <head> element");
51 is(document.getElementsByTagName(
"body").length,
1,
52 "Unexpected number of bodies after additions");
53 is(document.getElementsByTagName(
"body")[
0], body,
54 "Unexpected <body> element");
56 is(html.id,
"a",
"Unexpected <html> id");
57 is(head.id,
"c",
"Unexpected <head> id");
58 is(body.id,
"e",
"Unexpected <body> id");
59 is($(
"a"), html,
"Unexpected node with id=a");
60 is($(
"b"), null,
"Unexpected node with id=b");
61 is($(
"c"), head,
"Unexpected node with id=c");
62 is($(
"d"), null,
"Unexpected node with id=d");
63 is($(
"e"), body,
"Unexpected node with id=e");
64 is($(
"f"), null,
"Unexpected node with id=f");
65 is($(
"g"), null,
"Unexpected node with id=g");
66 is($(
"j"), null,
"Unexpected node with id=j");
67 is($(
"m"), null,
"Unexpected node with id=m");
69 is(html.getAttribute(
"foo"),
"h",
"Unexpected 'foo' value on <html>");
70 is(head.getAttribute(
"foo"),
"k",
"Unexpected 'foo' value on <head>");
71 is(body.getAttribute(
"foo"),
"n",
"Unexpected 'foo' value on <body>");