tor-browser

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

test_bug1181130-2.html (1356B)


      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>
     21 </div>
     22 <script type="application/javascript">
     23 /** Test for Bug 1181130 */
     24 var container = document.getElementById("container");
     25 var noneditable = document.getElementById("noneditable");
     26 
     27 SimpleTest.waitForExplicitFinish();
     28 
     29 SimpleTest.waitForFocus(function() {
     30  var nonHTMLElement = document.createElementNS("http://www.example.com", "element");
     31  nonHTMLElement.innerHTML = '<div contenteditable="true">nested editable div</div>';
     32  noneditable.appendChild(nonHTMLElement);
     33 
     34  synthesizeMouseAtCenter(noneditable, {});
     35  ok(!document.getSelection().toString().includes("nested editable div"),
     36     "Selection should not include non-editable content");
     37 
     38  SimpleTest.finish();
     39 });
     40 </script>
     41 <pre id="test">
     42 </pre>
     43 </body>
     44 </html>