Missing cursor/caret showing in search field on google.com
[WebKit-https.git] / LayoutTests / editing / selection / selection-change-in-blur-event-by-remove-children.html
1 <div id="container">
2 <p id="description"></p>
3 <div id="sample"><span contenteditable="true">foobar</span></div>
4 </div>
5 <div id="console"></div>
6 <script src="../../resources/js-test-pre.js"></script>
7 <script>
8 description('Selection should be updated after set innerHTML.');
9
10 var sample = document.getElementById('sample');
11 var selection = window.getSelection();
12 document.addEventListener('blur', function () {
13     selection.selectAllChildren(sample.firstChild);
14 }, true);
15
16 selection.selectAllChildren(sample.firstChild);
17 sample.firstChild.focus();
18 sample.innerHTML = '';
19
20 shouldBe('selection.anchorOffset', '0');
21 shouldBe('selection.focusOffset', '0');
22
23 if (window.testRunner)
24     document.getElementById('container').outerHTML = '';
25 </script>
26 <script src="../../resources/js-test-post.js"></script>