| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| .editableDiv { |
| height: 200px; |
| width: 200px; |
| border: 1px solid black; |
| -webkit-writing-mode: vertical-rl; |
| } |
| </style> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script> |
| function runTest() { |
| description('Testcase for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=103621">103621</a>: Caret is incorrectly painted for a contenteditable <div> containing a <br> 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.'); |
| |
| document.getElementById('textDiv').focus(); |
| if (window.internals) |
| withTextCaretRect = internals.absoluteCaretBounds(); |
| |
| document.getElementById('noTextDiv').focus(); |
| if (window.internals) |
| withoutTextCaretRect = internals.absoluteCaretBounds(); |
| |
| if (window.internals) { |
| shouldBe("withTextCaretRect.top", "withoutTextCaretRect.top"); |
| shouldBe("withTextCaretRect.width", "withoutTextCaretRect.width"); |
| shouldBe("withTextCaretRect.height", "withoutTextCaretRect.height"); |
| |
| document.getElementById('textDiv').style.display = 'none'; |
| document.getElementById('noTextDiv').style.display = 'none'; |
| } |
| |
| isSuccessfullyParsed(); |
| } |
| </script> |
| </head> |
| <body onload="runTest();"> |
| <div contenteditable="true" style="float: left;" class="editableDiv" id="textDiv"><br>some text</div> |
| <div contenteditable="true" class="editableDiv" id="noTextDiv"><br></div> |
| <div id="description"></div> |
| <div id="console"></div> |
| </body> |
| </html> |