|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=396843 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 396843</title> |
|
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
10 </head> |
|
11 <body> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=396843">Mozilla Bug 396843</a> |
|
13 <p id="display"> |
|
14 <iframe src="http://example.org:80/" id="t"></iframe> |
|
15 </p> |
|
16 <div id="content" style="display: none"> |
|
17 |
|
18 </div> |
|
19 <pre id="test"> |
|
20 <script class="testbody" type="text/javascript"> |
|
21 |
|
22 /** Test for Bug 396843 **/ |
|
23 SimpleTest.waitForExplicitFinish(); |
|
24 |
|
25 var allNodes = []; |
|
26 var XMLNodes = []; |
|
27 |
|
28 // HTML |
|
29 function HTML_TAG(name) { |
|
30 allNodes.push(document.createElement(name)); |
|
31 } |
|
32 |
|
33 /* List copy/pasted from nsHTMLTagList.h */ |
|
34 HTML_TAG("a", "Anchor") |
|
35 HTML_TAG("abbr", "Span") |
|
36 HTML_TAG("acronym", "Span") |
|
37 HTML_TAG("address", "Span") |
|
38 HTML_TAG("applet", "SharedObject") |
|
39 HTML_TAG("area", "Area") |
|
40 HTML_TAG("b", "Span") |
|
41 HTML_TAG("base", "Shared") |
|
42 HTML_TAG("basefont", "Span") |
|
43 HTML_TAG("bdo", "Span") |
|
44 HTML_TAG("bgsound", "Unknown") |
|
45 HTML_TAG("big", "Span") |
|
46 HTML_TAG("blockquote", "Shared") |
|
47 HTML_TAG("body", "Body") |
|
48 HTML_TAG("br", "BR") |
|
49 HTML_TAG("button", "Button") |
|
50 HTML_TAG("canvas", "Canvas") |
|
51 HTML_TAG("caption", "TableCaption") |
|
52 HTML_TAG("center", "Span") |
|
53 HTML_TAG("cite", "Span") |
|
54 HTML_TAG("code", "Span") |
|
55 HTML_TAG("col", "TableCol") |
|
56 HTML_TAG("colgroup", "TableCol") |
|
57 HTML_TAG("dd", "Span") |
|
58 HTML_TAG("del", "Mod") |
|
59 HTML_TAG("dfn", "Span") |
|
60 HTML_TAG("dir", "Shared") |
|
61 HTML_TAG("div", "Div") |
|
62 HTML_TAG("dl", "SharedList") |
|
63 HTML_TAG("dt", "Span") |
|
64 HTML_TAG("em", "Span") |
|
65 HTML_TAG("embed", "SharedObject") |
|
66 HTML_TAG("fieldset", "FieldSet") |
|
67 HTML_TAG("font", "Font") |
|
68 HTML_TAG("form", "Form") |
|
69 HTML_TAG("frame", "Frame") |
|
70 HTML_TAG("frameset", "FrameSet") |
|
71 HTML_TAG("h1", "Heading") |
|
72 HTML_TAG("h2", "Heading") |
|
73 HTML_TAG("h3", "Heading") |
|
74 HTML_TAG("h4", "Heading") |
|
75 HTML_TAG("h5", "Heading") |
|
76 HTML_TAG("h6", "Heading") |
|
77 HTML_TAG("head", "Head") |
|
78 HTML_TAG("hr", "HR") |
|
79 HTML_TAG("html", "Html") |
|
80 HTML_TAG("i", "Span") |
|
81 HTML_TAG("iframe", "IFrame") |
|
82 HTML_TAG("image", "") |
|
83 HTML_TAG("img", "Image") |
|
84 HTML_TAG("input", "Input") |
|
85 HTML_TAG("ins", "Mod") |
|
86 HTML_TAG("isindex", "Unknown") |
|
87 HTML_TAG("kbd", "Span") |
|
88 HTML_TAG("keygen", "Span") |
|
89 HTML_TAG("label", "Label") |
|
90 HTML_TAG("legend", "Legend") |
|
91 HTML_TAG("li", "LI") |
|
92 HTML_TAG("link", "Link") |
|
93 HTML_TAG("listing", "Span") |
|
94 HTML_TAG("map", "Map") |
|
95 HTML_TAG("marquee", "Div") |
|
96 HTML_TAG("menu", "Shared") |
|
97 HTML_TAG("meta", "Meta") |
|
98 HTML_TAG("multicol", "Unknown") |
|
99 HTML_TAG("nobr", "Span") |
|
100 HTML_TAG("noembed", "Div") |
|
101 HTML_TAG("noframes", "Div") |
|
102 HTML_TAG("noscript", "Div") |
|
103 HTML_TAG("object", "Object") |
|
104 HTML_TAG("ol", "SharedList") |
|
105 HTML_TAG("optgroup", "OptGroup") |
|
106 HTML_TAG("option", "Option") |
|
107 HTML_TAG("p", "Paragraph") |
|
108 HTML_TAG("param", "Shared") |
|
109 HTML_TAG("plaintext", "Span") |
|
110 HTML_TAG("pre", "Pre") |
|
111 HTML_TAG("q", "Shared") |
|
112 HTML_TAG("s", "Span") |
|
113 HTML_TAG("samp", "Span") |
|
114 HTML_TAG("script", "Script") |
|
115 HTML_TAG("select", "Select") |
|
116 HTML_TAG("small", "Span") |
|
117 HTML_TAG("spacer", "Unknown") |
|
118 HTML_TAG("span", "Span") |
|
119 HTML_TAG("strike", "Span") |
|
120 HTML_TAG("strong", "Span") |
|
121 HTML_TAG("style", "Style") |
|
122 HTML_TAG("sub", "Span") |
|
123 HTML_TAG("sup", "Span") |
|
124 HTML_TAG("table", "Table") |
|
125 HTML_TAG("tbody", "TableSection") |
|
126 HTML_TAG("td", "TableCell") |
|
127 HTML_TAG("textarea", "TextArea") |
|
128 HTML_TAG("tfoot", "TableSection") |
|
129 HTML_TAG("th", "TableCell") |
|
130 HTML_TAG("thead", "TableSection") |
|
131 HTML_TAG("template", "Template") |
|
132 HTML_TAG("title", "Title") |
|
133 HTML_TAG("tr", "TableRow") |
|
134 HTML_TAG("tt", "Span") |
|
135 HTML_TAG("u", "Span") |
|
136 HTML_TAG("ul", "SharedList") |
|
137 HTML_TAG("var", "Span") |
|
138 HTML_TAG("wbr", "Shared") |
|
139 HTML_TAG("xmp", "Span") |
|
140 |
|
141 function SVG_TAG(name) { |
|
142 allNodes.push(document.createElementNS("http://www.w3.org/2000/svg", name)); |
|
143 } |
|
144 |
|
145 // List sorta stolen from SVG element factory. |
|
146 SVG_TAG("a") |
|
147 SVG_TAG("polyline") |
|
148 SVG_TAG("polygon") |
|
149 SVG_TAG("circle") |
|
150 SVG_TAG("ellipse") |
|
151 SVG_TAG("line") |
|
152 SVG_TAG("rect") |
|
153 SVG_TAG("svg") |
|
154 SVG_TAG("g") |
|
155 SVG_TAG("foreignObject") |
|
156 SVG_TAG("path") |
|
157 SVG_TAG("text") |
|
158 SVG_TAG("tspan") |
|
159 SVG_TAG("image") |
|
160 SVG_TAG("style") |
|
161 SVG_TAG("linearGradient") |
|
162 SVG_TAG("metadata") |
|
163 SVG_TAG("radialGradient") |
|
164 SVG_TAG("stop") |
|
165 SVG_TAG("defs") |
|
166 SVG_TAG("desc") |
|
167 SVG_TAG("script") |
|
168 SVG_TAG("use") |
|
169 SVG_TAG("symbol") |
|
170 SVG_TAG("marker") |
|
171 SVG_TAG("title") |
|
172 SVG_TAG("clipPath") |
|
173 SVG_TAG("textPath") |
|
174 SVG_TAG("filter") |
|
175 SVG_TAG("feBlend") |
|
176 SVG_TAG("feColorMatrix") |
|
177 SVG_TAG("feComponentTransfer") |
|
178 SVG_TAG("feComposite") |
|
179 SVG_TAG("feFuncR") |
|
180 SVG_TAG("feFuncG") |
|
181 SVG_TAG("feFuncB") |
|
182 SVG_TAG("feFuncA") |
|
183 SVG_TAG("feGaussianBlur") |
|
184 SVG_TAG("feMerge") |
|
185 SVG_TAG("feMergeNode") |
|
186 SVG_TAG("feMorphology") |
|
187 SVG_TAG("feOffset") |
|
188 SVG_TAG("feFlood") |
|
189 SVG_TAG("feTile") |
|
190 SVG_TAG("feTurbulence") |
|
191 SVG_TAG("feConvolveMatrix") |
|
192 SVG_TAG("feDistantLight") |
|
193 SVG_TAG("fePointLight") |
|
194 SVG_TAG("feSpotLight") |
|
195 SVG_TAG("feDiffuseLighting") |
|
196 SVG_TAG("feSpecularLighting") |
|
197 SVG_TAG("feDisplacementMap") |
|
198 SVG_TAG("feImage") |
|
199 SVG_TAG("pattern") |
|
200 SVG_TAG("mask") |
|
201 SVG_TAG("svgSwitch") |
|
202 |
|
203 // Toss in some other namespaced stuff too, for good measure |
|
204 allNodes.push(document.createElementNS( |
|
205 "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", |
|
206 "window")); |
|
207 allNodes.push(document.createElementNS("http://www.w3.org/1998/Math/MathML", |
|
208 "math")); |
|
209 allNodes.push(document.createElementNS("http://www.w3.org/2001/xml-events", |
|
210 "testname")); |
|
211 allNodes.push(document.createElementNS("bogus.namespace", "testname")); |
|
212 |
|
213 var XMLDoc = document.implementation.createDocument("", "", null); |
|
214 |
|
215 // And non-elements |
|
216 allNodes.push(document.createTextNode("some text")); |
|
217 allNodes.push(document.createComment("some text")); |
|
218 allNodes.push(document.createDocumentFragment()); |
|
219 XMLNodes.push(XMLDoc.createCDATASection("some text")); |
|
220 XMLNodes.push(XMLDoc.createProcessingInstruction("PI", "data")); |
|
221 |
|
222 function runTest() { |
|
223 ok(document.nodePrincipal === undefined, "Must not have document principal"); |
|
224 ok(document.baseURIObject === undefined, "Must not have document base URI"); |
|
225 ok(document.documentURIObject === undefined, "Must have document URI"); |
|
226 |
|
227 for (var i = 0; i < allNodes.length; ++i) { |
|
228 ok(allNodes[i].nodePrincipal === undefined, |
|
229 "Unexpected principal appears for " + allNodes[i].nodeName); |
|
230 ok(allNodes[i].baseURIObject === undefined, |
|
231 "Unexpected base URI appears for " + allNodes[i].nodeName); |
|
232 } |
|
233 } |
|
234 |
|
235 addLoadEvent(runTest); |
|
236 addLoadEvent(SimpleTest.finish); |
|
237 |
|
238 </script> |
|
239 </pre> |
|
240 </body> |
|
241 </html> |
|
242 |