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