4 https://bugzilla.mozilla.org/show_bug.cgi?id=289384
7 <title>Test for Bug
289384</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=289384">Mozilla Bug
289384</a>
15 <div id=
"content" style=
"display: none">
18 <script class=
"testbody" type=
"text/javascript">
19 SimpleTest.waitForExplicitFinish();
21 addLoadEvent(function() {
22 var win = window.open(
"file_bug289384-1.html",
"",
"test-289384");
23 win.addEventListener(
"load", function() {
24 win.document.querySelector(
"a").click();
28 function continueTest(win) {
29 SimpleTest.waitForFocus(function() {
30 var doc = win.document;
31 var sel = win.getSelection();
33 sel.collapse(doc.body.firstChild,
3);
34 SimpleTest.executeSoon(function() {
35 synthesizeKey(
"KEY_ArrowLeft", {accelKey: true}, win);
36 ok(sel.isCollapsed,
"The selection must be collapsed");
37 is(sel.anchorNode, doc.body.firstChild,
"The anchor node should be the body element's text node");
38 is(sel.anchorOffset,
0,
"The anchor offset should be 0");