1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/generic/test/test_bug970363.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=970363 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 970363</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.15 +</head> 1.16 +<body> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=970363">Mozilla Bug 970363</a> 1.18 +<p id="display"></p> 1.19 +<div id="content" style="display: none"> 1.20 +</div> 1.21 +<div contenteditable="true" id='editablediv'> 1.22 + <div id='t'>S<span contenteditable="false">readonly</span>E</div> 1.23 +</div> 1.24 +<pre id="test"> 1.25 + 1.26 + <script type="application/javascript"> 1.27 + 1.28 + /** Test for Bug 970363 **/ 1.29 + 1.30 + SimpleTest.waitForExplicitFinish(); 1.31 + 1.32 + SimpleTest.waitForFocus(function() { 1.33 + var t = document.getElementById("t"); 1.34 + var editablediv = document.getElementById("editablediv"); 1.35 + var sel = window.getSelection(); 1.36 + editablediv.focus(); 1.37 + sel.collapse(t, 0); 1.38 + 1.39 + // Move past the 'S' char. 1.40 + synthesizeKey("VK_RIGHT", {}); 1.41 + // Move across the span. 1.42 + synthesizeKey("VK_RIGHT", {}); 1.43 + // Insert an 'I' to show when IP currently is. 1.44 + synthesizeKey("I", {}); 1.45 + 1.46 + is(t.textContent, "SreadonlyIE", "the 'I' char should be inserted between 'readonly' and 'E'"); 1.47 + SimpleTest.finish(); 1.48 + }); 1.49 + 1.50 + </script> 1.51 + 1.52 +</pre> 1.53 +</body> 1.54 +</html>