Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML><html>
- <!--
- https://bugzilla.mozilla.org/show_bug.cgi?id=1263288
- -->
- <head>
- <meta charset="utf-8">
- <title>Testcase #1 for bug 1263288</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script src="selection-utils.js"></script>
- </head>
- <body onload="start()">
- <div id="readonly">xyz</div>
- <div id="editable" contenteditable='true' style="outline: none;"><span contentEditable='false'>xyz<!-- comment --></span><br></br></div>
- <script>
- // Work around a bug where synthesizeKey with VK_END doesn't work on Linux and Mac.
- function moveToEndOfLine(sel) {
- if (navigator.platform.indexOf("Win") == 0) {
- synthesizeKey("VK_END", {});
- } else {
- // End key doesn't work as expected on Mac and Linux.
- sel.modify("move", "right", "lineboundary");
- }
- }
- function start() {
- var sel = window.getSelection();
- // Focus on editable block.
- theDiv = document.getElementById("editable");
- theDiv.focus();
- sel.collapse(theDiv, 0);
- synthesizeMouse(theDiv, 100, 2, {});
- moveToEndOfLine(sel);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement