| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <style> | 4 <style> |
| 5 #textDiv { | 5 #textDiv { |
| 6 height: 200px; | 6 height: 200px; |
| 7 width: 200px; | 7 width: 200px; |
| 8 border: 1px solid black; | 8 border: 1px solid black; |
| 9 -webkit-writing-mode: vertical-rl; | 9 -webkit-writing-mode: vertical-rl; |
| 10 } | 10 } |
| 11 </style> | 11 </style> |
| 12 <script src="../../resources/js-test.js"></script> | 12 <script src="../../resources/js-test.js"></script> |
| 13 <script> | 13 <script> |
| 14 function runTest() { | 14 function runTest() { |
| 15 description('Testcase for bug <a href="https://bugs.webkit.org/show_bug.cgi?
id=106452">106452</a>: Caret positioned at the end of a text line (followed by
an empty block) in vertical writing mode disappears when pressing the right/down
arrow key.\nTo manually verify the issue, place the caret at the end of the tex
t line and then press either the down or the right arrow key.'); | 15 description('Testcase for bug <a href="https://bugs.webkit.org/show_bug.cgi?
id=106452">106452</a>: Caret positioned at the end of a text line (followed by
an empty block) in vertical writing mode disappears when pressing the right/down
arrow key.\nTo manually verify the issue, place the caret at the end of the tex
t line and then press either the down or the right arrow key.'); |
| 16 | 16 |
| 17 if (window.internals) { | 17 if (window.internals) { |
| 18 var testDiv = document.getElementById('textDiv'); | 18 var testDiv = document.getElementById('textDiv'); |
| 19 | 19 |
| 20 eventSender.mouseMoveTo(testDiv.offsetLeft + testDiv.offsetWidth - 5, te
stDiv.offsetTop); | 20 eventSender.mouseMoveTo(testDiv.offsetLeft + testDiv.offsetWidth - 5, te
stDiv.offsetTop); |
| 21 eventSender.mouseDown(); | 21 eventSender.mouseDown(); |
| 22 eventSender.mouseUp(); | 22 eventSender.mouseUp(); |
| 23 caretRectAtStart = internals.absoluteCaretBounds(document); | 23 caretRectAtStart = internals.absoluteCaretBounds(document); |
| 24 | 24 |
| 25 eventSender.mouseMoveTo(testDiv.offsetLeft + testDiv.offsetWidth - 5, te
stDiv.offsetTop + testDiv.offsetHeight - 5); | 25 eventSender.mouseMoveTo(testDiv.offsetLeft + testDiv.offsetWidth - 5, te
stDiv.offsetTop + testDiv.offsetHeight - 5); |
| 26 eventSender.mouseDown(); | 26 eventSender.mouseDown(); |
| 27 eventSender.mouseUp(); | 27 eventSender.mouseUp(); |
| 28 caretRectAtEnd = internals.absoluteCaretBounds(document); | 28 caretRectAtEnd = internals.absoluteCaretBounds(document); |
| 29 | 29 |
| 30 eventSender.keyDown("rightArrow"); | 30 eventSender.keyDown("ArrowRight"); |
| 31 caretRectRightKey = internals.absoluteCaretBounds(document); | 31 caretRectRightKey = internals.absoluteCaretBounds(document); |
| 32 | 32 |
| 33 eventSender.keyDown("downArrow"); | 33 eventSender.keyDown("ArrowDown"); |
| 34 caretRectDownKey = internals.absoluteCaretBounds(document); | 34 caretRectDownKey = internals.absoluteCaretBounds(document); |
| 35 | 35 |
| 36 shouldBe("caretRectAtEnd.width", "caretRectAtStart.width"); | 36 shouldBe("caretRectAtEnd.width", "caretRectAtStart.width"); |
| 37 shouldBe("caretRectAtEnd.height", "caretRectAtStart.height"); | 37 shouldBe("caretRectAtEnd.height", "caretRectAtStart.height"); |
| 38 shouldBe("caretRectRightKey.width", "caretRectAtEnd.width"); | 38 shouldBe("caretRectRightKey.width", "caretRectAtEnd.width"); |
| 39 shouldBe("caretRectRightKey.height", "caretRectAtEnd.height"); | 39 shouldBe("caretRectRightKey.height", "caretRectAtEnd.height"); |
| 40 shouldBe("caretRectDownKey.width", "caretRectAtEnd.width"); | 40 shouldBe("caretRectDownKey.width", "caretRectAtEnd.width"); |
| 41 shouldBe("caretRectDownKey.height", "caretRectAtEnd.height"); | 41 shouldBe("caretRectDownKey.height", "caretRectAtEnd.height"); |
| 42 | 42 |
| 43 testDiv.style.display = 'none'; | 43 testDiv.style.display = 'none'; |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 </script> | 46 </script> |
| 47 </head> | 47 </head> |
| 48 <body onload="runTest();"> | 48 <body onload="runTest();"> |
| 49 <div id="textDiv" contenteditable="true">Some text.<p></p></div> | 49 <div id="textDiv" contenteditable="true">Some text.<p></p></div> |
| 50 <div id="description"></div> | 50 <div id="description"></div> |
| 51 <div id="console"></div> | 51 <div id="console"></div> |
| 52 </body> | 52 </body> |
| 53 </html> | 53 </html> |
| OLD | NEW |