| Index: LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html
|
| diff --git a/LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html b/LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..88b7005422572f64e866d897686b5b1519626845
|
| --- /dev/null
|
| +++ b/LayoutTests/editing/selection/selection-change-in-blur-event-by-remove-children.html
|
| @@ -0,0 +1,27 @@
|
| +<div id="container">
|
| +<p id="description"></p>
|
| +<div id="sample"><span contenteditable="true">foobar</span></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('blur', function () {
|
| + selection.selectAllChildren($('sample').firstChild);
|
| +}, true);
|
| +
|
| +selection.selectAllChildren($('sample').firstChild);
|
| +$('sample').firstChild.focus();
|
| +$('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>
|
|
|