tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug1181130-1.html (1615B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1181130
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 1181130</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <script src="/tests/SimpleTest/EventUtils.js"></script>
     11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     12 </head>
     13 <body>
     14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1181130">Mozilla Bug 1181130</a>
     15 <p id="display"></p>
     16 <div id="container" contenteditable="true">
     17  editable div
     18  <div id="noneditable" contenteditable="false">
     19    non-editable div
     20    <div id="editable" contenteditable="true">nested editable div</div>
     21  </div>
     22 </div>
     23 <script type="application/javascript">
     24 /** Test for Bug 1181130 */
     25 var container = document.getElementById("container");
     26 var noneditable = document.getElementById("noneditable");
     27 var editable = document.getElementById("editable");
     28 
     29 SimpleTest.waitForExplicitFinish();
     30 
     31 SimpleTest.waitForFocus(function() {
     32  synthesizeMouseAtCenter(noneditable, {});
     33  ok(!document.getSelection().toString().includes("nested editable div"),
     34     "Selection should not include non-editable content");
     35 
     36  synthesizeMouseAtCenter(container, {});
     37  ok(!document.getSelection().toString().includes("nested editable div"),
     38     "Selection should not include non-editable content");
     39 
     40  synthesizeMouseAtCenter(editable, {});
     41  ok(!document.getSelection().toString().includes("nested editable div"),
     42     "Selection should not include non-editable content");
     43 
     44  SimpleTest.finish();
     45 });
     46 </script>
     47 <pre id="test">
     48 </pre>
     49 </body>
     50 </html>