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