summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/select/option-add-crash.html
blob: 170e401de6155d306e1748144e41bec7498ecff1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<script src="../../../resources/js-test.js"></script>
<script>
function crash()
{
    try {
    document.getElementsByTagName('option')[0].parentNode.removeChild(document.getElementsByTagName('option')[0]);
    } catch (Exception) {}

    gc();
}
document.write("PASS. WebKit didn't crash.<select></select>");
var select1 = document.getElementsByTagName('select')[0];
select1.appendChild(document.createElement('option'));
select1.appendChild(document.createElement('option'));
document.addEventListener("DOMSubtreeModified", crash, false);
try {
  select1.options[0] = new Option("", "");
} catch (Exception) { }
</script>
</html>