2 <p id=
"description"></p>
3 <div id=
"sample">foobar
</div>
5 <div id=
"console"></div>
6 <script src=
"../../resources/js-test.js"></script>
8 description('Selection should be updated after set innerHTML.');
10 function $(id
) { return document
.getElementById(id
); }
12 var selection
= window
.getSelection();
13 document
.addEventListener('DOMNodeRemovedFromDocument', function () {
14 selection
.selectAllChildren($('sample'));
17 selection
.selectAllChildren($('sample'));
18 $('sample').innerHTML
= '';
20 shouldBe('selection.anchorOffset', '0');
21 shouldBe('selection.focusOffset', '0');
23 if (window
.testRunner
)
24 $('container').outerHTML
= '';