summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/select/select-set-length-with-mutation.html
blob: 65a717b266fab93785248bdea86ccde7846d3c58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('Tests setting the .length of an HTMLSelectElement with mutation listeners registered.');

var sel = document.createElement('select');
document.body.appendChild(sel);

sel.addEventListener('DOMNodeRemoved', function() {}, false);
sel.addEventListener('DOMNodeInserted', function() {}, false);

sel.length = 200;
shouldBe('sel.length', '200');

sel.length = 100;
shouldBe('sel.length', '100');

sel.length = 180;
shouldBe('sel.length', '180');
</script>
</body>
</html>