| Index: LayoutTests/editing/selection/selection-change-in-mutation-event-by-remove-children.html
|
| diff --git a/LayoutTests/editing/selection/selection-change-in-mutation-event-by-remove-children.html b/LayoutTests/editing/selection/selection-change-in-mutation-event-by-remove-children.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1d654ba1a9c894c20239ebeeb0dcc31eb966abd1
|
| --- /dev/null
|
| +++ b/LayoutTests/editing/selection/selection-change-in-mutation-event-by-remove-children.html
|
| @@ -0,0 +1,26 @@
|
| +<div id="container">
|
| +<p id="description"></p>
|
| +<div id="sample">foobar</div>
|
| +</div>
|
| +<div id="console"></div>
|
| +<script src="../../fast/js/resources/js-test-pre.js"></script>
|
| +<script>
|
| +description('Selection should be updated after set innerHTML.');
|
| +
|
| +function $(id) { return document.getElementById(id); }
|
| +
|
| +var selection = window.getSelection();
|
| +document.addEventListener('DOMNodeRemovedFromDocument', function () {
|
| + selection.selectAllChildren($('sample'));
|
| +}, true);
|
| +
|
| +selection.selectAllChildren($('sample'));
|
| +$('sample').innerHTML = '';
|
| +
|
| +shouldBe('selection.anchorOffset', '0');
|
| +shouldBe('selection.focusOffset', '0');
|
| +
|
| +if (window.testRunner)
|
| + $('container').outerHTML = '';
|
| +</script>
|
| +<script src="../../fast/js/resources/js-test-post.js"></script>
|
|
|