1 <script src=
"../../resources/ahem.js"></script>
3 Test for
<i><a href=
"rdar://problem/6967596">rdar://problem/
6967596</a>
4 Safari hung using
100% CPU when I tried to look up a word in
5 Dictionary using command-control-d
</i>.
7 <p id=
"result">FAIL: Test did not run
</p>
8 <div id=
"target" style=
"font: 20px Ahem; width: 320px; -webkit-user-modify: read-write;">Text and text
<!-- --> more
<!-- -->text
</div>
10 if ("testRunner" in window
)
11 testRunner
.dumpAsText();
13 var target
= document
.getElementById("target");
14 var selection
= getSelection();
16 selection
.collapse(target
.firstChild
, 13);
17 selection
.modify("move", "backward", "line");
19 var pass
= (selection
.anchorNode
=== target
.firstChild
&& selection
.anchorOffset
=== 0);
21 document
.getElementById("result").innerText
= pass
? "PASS" : "FAIL";