| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| description('Tests that setting .length on an HTMLSelectElement works in the presence of mutation listeners that remove option elements.'); |
| if (e.target.nextSibling != null) { |
| // remove listener temporarily to avoid lots of nesting |
| sel.removeEventListener('DOMNodeRemoved', onRemove, false); |
| e.target.nextSibling.parentNode.removeChild(e.target.nextSibling); |
| sel.addEventListener('DOMNodeRemoved', onRemove, false); |
| var sel = document.createElement('select'); |
| document.body.appendChild(sel); |
| sel.addEventListener('DOMNodeRemoved', onRemove, false); |
| sel.addEventListener('DOMNodeInserted', function() {}, false); |
| shouldBe('sel.length', '200'); |
| shouldBe('sel.length', '100'); |
| shouldBe('sel.length', '180'); |
| <script src="../../resources/js-test-post.js"></script> |