Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/html/test/mochitest.toml
<!DOCTYPE HTML>
<html>
<head>
<title>Test for select innerHTML with noInSelectMode</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
<script>
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv(
{ set: [["dom.lift_select_parser_restrictions.enabled", true]] },
function() {
var tmpl = document.createElement("template");
tmpl.innerHTML = "x".repeat(100);
var sel = document.createElement("select");
sel.innerHTML = "<col>";
is(sel.childNodes.length, 0,
"<col> is a stray tag in body mode and should produce no child nodes");
for (var i = 0; i < 5; i++) {
tmpl.innerHTML = "x".repeat(100);
sel.innerHTML = "<col>";
is(sel.childNodes.length, 0,
"no child nodes on iteration " + i);
}
sel.innerHTML = "<option>hello</option>";
is(sel.childNodes.length, 1, "<option> should be a child of <select>");
is(sel.childNodes[0].nodeName, "OPTION", "child should be OPTION");
SimpleTest.finish();
}
);
</script>
</pre>
</body>
</html>