| OLD | NEW |
| 1 <html dir=rtl> | 1 <html dir=rtl> |
| 2 <head> | 2 <head> |
| 3 <script language="javascript"> | 3 <script language="javascript"> |
| 4 function log(str) | 4 function log(str) |
| 5 { | 5 { |
| 6 var li = document.createElement("li"); | 6 var li = document.createElement("li"); |
| 7 li.appendChild(document.createTextNode(str)); | 7 li.appendChild(document.createTextNode(str)); |
| 8 var console = document.getElementById("console"); | 8 var console = document.getElementById("console"); |
| 9 console.appendChild(li); | 9 console.appendChild(li); |
| 10 } | 10 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 window.resizeTo(1000, window.innerHeight); | 56 window.resizeTo(1000, window.innerHeight); |
| 57 window.scrollTo(expectedScrollX, expectedScrollY); | 57 window.scrollTo(expectedScrollX, expectedScrollY); |
| 58 window.resizeTo(2000, window.innerHeight); | 58 window.resizeTo(2000, window.innerHeight); |
| 59 assertEqual("resize preserves scroll position", window.scrollX,
expectedScrollX); | 59 assertEqual("resize preserves scroll position", window.scrollX,
expectedScrollX); |
| 60 // Test HOME/END operation. | 60 // Test HOME/END operation. |
| 61 if (window.eventSender) { | 61 if (window.eventSender) { |
| 62 // Not using assert equal here since the behavior is differe
nt in each port. | 62 // Not using assert equal here since the behavior is differe
nt in each port. |
| 63 // For example, in Mac, HOME/END key reset both x and y scro
ll position. | 63 // For example, in Mac, HOME/END key reset both x and y scro
ll position. |
| 64 // In Chromium, HOME/END key only reset y scroll position, a
nd x scroll position is preserved. | 64 // In Chromium, HOME/END key only reset y scroll position, a
nd x scroll position is preserved. |
| 65 window.scrollTo(expectedScrollX, expectedScrollY); | 65 window.scrollTo(expectedScrollX, expectedScrollY); |
| 66 eventSender.keyDown("home"); | 66 eventSender.keyDown("Home"); |
| 67 log("KeyDown HOME move x-scroll position to right for RTL pa
ge: " + window.scrollX, 0); | 67 log("KeyDown HOME move x-scroll position to right for RTL pa
ge: " + window.scrollX, 0); |
| 68 window.scrollTo(expectedScrollX, expectedScrollY); | 68 window.scrollTo(expectedScrollX, expectedScrollY); |
| 69 eventSender.keyDown("end"); | 69 eventSender.keyDown("End"); |
| 70 log("KeyDown END move x-scroll position to right for RTL pag
e: " + window.scrollX, 0); | 70 log("KeyDown END move x-scroll position to right for RTL pag
e: " + window.scrollX, 0); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Test select all selects all document content. | 73 // Test select all selects all document content. |
| 74 window.resizeTo(500, 500); | 74 window.resizeTo(500, 500); |
| 75 var div = document.getElementById("div"); | 75 var div = document.getElementById("div"); |
| 76 div.focus(); | 76 div.focus(); |
| 77 document.execCommand("SelectAll"); | 77 document.execCommand("SelectAll"); |
| 78 var selection = window.getSelection(); | 78 var selection = window.getSelection(); |
| 79 assertEqual("selectAll selects all document", selection.toString
().substring(0, div.innerHTML.length), div.innerHTML); | 79 assertEqual("selectAll selects all document", selection.toString
().substring(0, div.innerHTML.length), div.innerHTML); |
| 80 | 80 |
| 81 div.style.display = "none"; | 81 div.style.display = "none"; |
| 82 | 82 |
| 83 } | 83 } |
| 84 </script> | 84 </script> |
| 85 </head> | 85 </head> |
| 86 <body> | 86 <body> |
| 87 <div id="div" style="whitespace:nowrap; width: 4000px; height: 1000px; b
order: 1px solid red;">Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad m
inim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea com
modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse c
illum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non pro
ident, sunt in culpa qui officia deserunt mollit anim id est laborum."</div> | 87 <div id="div" style="whitespace:nowrap; width: 4000px; height: 1000px; b
order: 1px solid red;">Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad m
inim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea com
modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse c
illum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non pro
ident, sunt in culpa qui officia deserunt mollit anim id est laborum."</div> |
| 88 <ul id="console" dir=ltr></ul> | 88 <ul id="console" dir=ltr></ul> |
| 89 </body> | 89 </body> |
| 90 </html> | 90 </html> |
| OLD | NEW |