|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=622371 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 622371</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
11 </head> |
|
12 <body> |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=622371">Mozilla Bug 622371</a> |
|
14 <p id="display"></p> |
|
15 <div id="content"> |
|
16 <iframe src="data:text/html,<body contenteditable>abc</body>"></iframe> |
|
17 </div> |
|
18 <pre id="test"> |
|
19 <script type="application/javascript"> |
|
20 |
|
21 /** Test for Bug 622371 **/ |
|
22 SimpleTest.waitForExplicitFinish(); |
|
23 addLoadEvent(function() { |
|
24 var i = document.querySelector("iframe"); |
|
25 var sel = i.contentWindow.getSelection(); |
|
26 var doc = i.contentDocument; |
|
27 var body = doc.body; |
|
28 i.focus(); |
|
29 sel.collapse(body, 1); |
|
30 doc.designMode = "on"; |
|
31 doc.designMode = "off"; |
|
32 is(sel.getRangeAt(0).startOffset, 1, "The start offset of the selection shouldn't change"); |
|
33 is(sel.getRangeAt(0).endOffset, 1, "The end offset of the selection shouldn't change"); |
|
34 SimpleTest.finish(); |
|
35 }); |
|
36 |
|
37 </script> |
|
38 </pre> |
|
39 </body> |
|
40 </html> |