| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>This tests that contenteditable returns the correct caret bounds.</title> |
| <style> |
| body { |
| margin: 0px; |
| } |
| |
| #editable { |
| -webkit-nbsp-mode: normal !important; |
| -webkit-line-break: auto !important; |
| width: 50px; |
| height: 50px; |
| } |
| </style> |
| </head> |
| <body> |
| <div id=editable contenteditable=true></div> |
| <script> |
| editable.focus(); |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| if (window.eventSender) { |
| eventSender.keyDown('\n'); |
| eventSender.keyDown('\n'); |
| } |
| if (window.internals) { |
| var withTextCaretRect = internals.absoluteCaretBounds(); |
| document.body.innerText = withTextCaretRect.top + " " + withTextCaretRect.left + " " + withTextCaretRect.width + " " + withTextCaretRect.height; |
| } |
| </script> |
| </body> |
| </html> |