Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / script-remove-child-id-map.html
blobbd648c8a87a2b7d003614540db6e8b5c94dd00ca
1 <!DOCTYPE html>
3 <script src="../../resources/js-test.js"></script>
5 <script>
6 description("Passes if it doesn't crash and the child is not in the id map");
8 var script = document.createElement("script");
9 script.type = "dont-execute";
10 script.textContent = "script.remove()";
11 child = document.createElement("div");
12 child.id = "child";
13 script.appendChild(child);
15 // The script won't execute here because the type is invalid, but it also won't
16 // get marked as being already run, so changing the children later will run it.
17 document.documentElement.appendChild(script);
19 // Per the spec setting the type has no effect
20 script.type = "";
22 // but changing the children *will* execute the script now that the type is
23 // is valid.
24 child.remove();
26 child = null;
27 gc();
29 shouldBeNull("document.getElementById('child')");
30 </script>