Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / inserting / 4959067.html
blob498cfd9bd22cb1694d312c3d11e04836f65626b2
1 <p>This tests to make sure that insertion over a fully selected special element doesn't do expansion.</p>
2 <div contenteditable="true">
3 <ul id="ul"><li><a id="anchor" href="http://www.google.com/">foo</a></li></ul>
4 </div>
5 <ul id="console"></ul>
6 <script>
7 function log(str) {
8 var li = document.createElement("li");
9 var text = document.createTextNode(str);
10 var console = document.getElementById("console");
11 li.appendChild(text);
12 console.appendChild(li);
15 var sel = window.getSelection();
16 var anchor = document.getElementById("anchor");
17 sel.setBaseAndExtent(anchor, 0, anchor, anchor.childNodes.length);
18 document.execCommand("InsertText", false, "foo");
19 anchor = document.getElementById("anchor");
20 if (!anchor)
21 log("Failure: a special element was removed during insertion.");
22 </script>