layout/base/tests/bug482484-ref.html

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 <!DOCTYPE HTML><html><head></head>
     2 <body>
     3 <div contentEditable="true" id="div" spellcheck="false"><p id="p">ABC</p></div>
     4 <script>
     5   // Position the caret after the "A"
     6   var div = document.getElementById('div');
     7   var p = document.getElementById('p');
     8   div.focus();
     9   var sel = window.getSelection();
    10   sel.removeAllRanges();
    11   var range = document.createRange();
    12   range.setStart(p.firstChild, 1)
    13   range.setEnd(p.firstChild, 1);
    14   sel.addRange(range);
    15 </script>
    17 </body>
    18 </html>

mercurial