test_bug686203.html (1536B)
1 <!DOCTYPE HTML> 2 <!-- This Source Code Form is subject to the terms of the Mozilla Public 3 - License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 - You can obtain one at http://mozilla.org/MPL/2.0/. --> 5 <html> 6 <!-- 7 https://bugzilla.mozilla.org/show_bug.cgi?id=686203 8 --> 9 10 <head> 11 <title>Test for Bug 686203</title> 12 <script src="/tests/SimpleTest/SimpleTest.js"></script> 13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 14 <script src="/tests/SimpleTest/EventUtils.js"></script> 15 </head> 16 17 <body> 18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=686203">Mozilla Bug 686203</a> 19 <p id="display"></p> 20 <div id="content" style="display: none"> 21 </div> 22 23 <pre id="test"> 24 <script type="application/javascript"> 25 26 /** Test for Bug 686203 */ 27 SimpleTest.waitForExplicitFinish(); 28 SimpleTest.waitForFocus(function() { 29 var ce = document.getElementById("ce"); 30 var input = document.getElementById("input"); 31 ce.focus(); 32 33 var eventDetails = { button: 2 }; 34 synthesizeMouseAtCenter(input, eventDetails); 35 36 sendString("Z"); 37 38 /* check values */ 39 is(input.value, "Z", "input correctly focused after right-click"); 40 is(ce.textContent, "abc", "contenteditable correctly blurred after right-click on input"); 41 42 SimpleTest.finish(); 43 }); 44 </script> 45 </pre> 46 47 <input type="text" value="" id="input" /> 48 <div id="ce" contenteditable="true">abc</div> 49 </body> 50 </html>