| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 | |
| 4 <style> | |
| 5 .editing { | |
| 6 border: 2px solid red; | |
| 7 padding: 12px; | |
| 8 font-size: 24px; | |
| 9 } | |
| 10 .cell { | |
| 11 padding: 12px; | |
| 12 font-size: 24px; | |
| 13 height: 48px; | |
| 14 } | |
| 15 | |
| 16 li { | |
| 17 font-size: 12px; | |
| 18 font-family: Verdana, Arial, sans-serif; | |
| 19 } | |
| 20 | |
| 21 div.nav { | |
| 22 width:120px; | |
| 23 } | |
| 24 | |
| 25 ul.menu, ul.menu li { | |
| 26 margin: 0;padding:0; | |
| 27 font-size:10px | |
| 28 } | |
| 29 ul.menu li { padding: 3px; padding-left: 1.6em; padding-right:5px; text-indent:
-1.1em !important; text-indent: -.5em; } | |
| 30 ul.menu li:first-letter { font-size:20px;line-height:10px; } | |
| 31 | |
| 32 </style> | |
| 33 <title>Editing Test</title> | |
| 34 </head> | |
| 35 <body> | |
| 36 <div id="container"> | |
| 37 <div contenteditable id="root" class="editing" style="width:120px;"> | |
| 38 <ul class="menu" id="test"> | |
| 39 <li>· <a href="detail.asp?cat=7">Appetizers</a></li> | |
| 40 <li>· <a href="detail.asp?cat=13">Soups & Salads</a></li> | |
| 41 <li>· <a href="detail.asp?cat=5">Sandwiches & Burgers</a></li> | |
| 42 <li>· <a href="detail.asp?cat=14">Steak & Ribs</a></li> | |
| 43 <li>· <a href="detail.asp?cat=11">Seafood</a></li> | |
| 44 <li>· <a href="detail.asp?cat=17">Combos</a></li> | |
| 45 </ul> | |
| 46 </div> | |
| 47 </div> | |
| 48 <!-- | |
| 49 Specifically checks test case in bug: | |
| 50 <rdar://problem/4244976> reproducible hang at ocharleys.com in VisiblePositi
on::initDownstream | |
| 51 --> | |
| 52 <script src="../../resources/js-test.js"></script> | |
| 53 <script> | |
| 54 function $(id) { return document.getElementById(id); } | |
| 55 if (window.internals) | |
| 56 internals.settings.setEditingBehavior('mac'); | |
| 57 var range = document.createRange(); | |
| 58 range.setStart($("test").querySelectorAll("li")[0], 0); | |
| 59 var selection = window.getSelection(); | |
| 60 selection.removeAllRanges(); | |
| 61 selection.addRange(range); | |
| 62 for (var i = 0; i < 6; ++i) | |
| 63 selection.modify('extend', 'forward', 'word'); | |
| 64 shouldBeEqualToString('selection.type', 'Range'); | |
| 65 shouldBe('selection.anchorNode', '$("test").querySelectorAll("li")[0].childNodes
[0]'); | |
| 66 shouldBe('selection.anchorOffset', '0'); | |
| 67 shouldBe('selection.focusNode', '$("test").querySelectorAll("li a")[3].firstChil
d'); | |
| 68 shouldBe('selection.focusOffset', '4'); | |
| 69 if (window.testRunner) | |
| 70 $('container').outerHTML = ''; | |
| 71 </script> | |
| 72 </body> | |
| 73 </html> | |
| OLD | NEW |