Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / inserting / editing-empty-divs.html
blobeea2c18fcc16f745fd1ab64973d7271fd1e1d857
1 <html>
3 <head>
4 <script>
5 if (window.testRunner)
6 testRunner.dumpEditingCallbacks();
7 </script>
9 <script>
10 </script>
11 </head>
12 <style>
13 div {
14 border: 1px dotted blue;
15 min-height: 20px;
16 width: 90%;
18 </style>
20 <script>
21 function foo() {
22 var selection = window.getSelection();
23 var bar = 1;
24 var divs = document.getElementsByTagName("div");
25 for (var i = 0; divs[i]; i++) {
26 selection.collapse(divs[i], 0);
27 document.execCommand("InsertText", false, 'c');
30 </script>
31 <body onload="foo()">
33 <p>This tests the ability to start editing in blocks that are visible, but have little or no content. Each of the divs below should be able to accept a caret.</p>
35 <p>This div contains some text.</p>
36 <div contentEditable="true">
37 hello
38 </div>
40 <p>This div is completely empty.</p>
41 <div contentEditable="true"></div>
43 <p>This div contains some collapsable whitespace (a '\n').</p>
44 <div contentEditable="true">
45 </div>
47 <p>This div contains a self-closing p tag.</p>
48 <div contentEditable="true"><p /></div>
50 <p>This div contains a self-closing p tag and some collapsable whitespace (two '\n's before and after the self closing p.</p>
51 <div contentEditable="true">
52 <p />
53 </div>
55 </body>
56 </html>