Missing cursor/caret showing in search field on google.com
[WebKit-https.git] / LayoutTests / editing / selection / caret-in-div-containing-br-in-vertical-mode.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 .editableDiv {
6     height: 200px;
7     width: 200px;
8     border: 1px solid black;
9     -webkit-writing-mode: vertical-rl;
10 }
11 </style>
12 <script src="../../resources/js-test-pre.js"></script>
13 <script>
14 function runTest() {
15     description('Testcase for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=103621">103621</a>: Caret is incorrectly painted for a contenteditable &lt;div&gt; containing a &lt;br&gt; in vertical writing mode.\nFor the test to pass, carets in both the boxes should be exactly similar.\nTo manually verify the issue, try clicking on the second box. A caret should be visible at the start of that container.');
16
17     document.getElementById('textDiv').focus();
18     if (window.internals)
19         withTextCaretRect = internals.absoluteCaretBounds();
20
21     document.getElementById('noTextDiv').focus();
22     if (window.internals)
23         withoutTextCaretRect = internals.absoluteCaretBounds();
24
25     if (window.internals) {
26         shouldBe("withTextCaretRect.top", "withoutTextCaretRect.top");
27         shouldBe("withTextCaretRect.width", "withoutTextCaretRect.width");
28         shouldBe("withTextCaretRect.height", "withoutTextCaretRect.height");
29
30         document.getElementById('textDiv').style.display = 'none';
31         document.getElementById('noTextDiv').style.display = 'none';
32     }
33
34     isSuccessfullyParsed();
35 }
36 </script>
37 </head>
38 <body onload="runTest();">
39 <div contenteditable="true" style="float: left;" class="editableDiv" id="textDiv"><br>some text</div>
40 <div contenteditable="true" class="editableDiv" id="noTextDiv"><br></div>
41 <div id="description"></div>
42 <div id="console"></div>
43 </body>
44 </html>