| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 <script src="resources/util.js"></script> | 5 <script src="resources/util.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <div id="container"> | 8 <div id="container"> |
| 9 <div id="destination" contentEditable></div> | 9 <div id="destination" contentEditable></div> |
| 10 </div> | 10 </div> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling",
0); | 23 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling",
0); |
| 24 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); | 24 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); |
| 25 shouldBeEqualToString("window.getSelection().toString()", ""); | 25 shouldBeEqualToString("window.getSelection().toString()", ""); |
| 26 | 26 |
| 27 // Context click on "wellcome" to show the context menu. | 27 // Context click on "wellcome" to show the context menu. |
| 28 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 4
0; | 28 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 4
0; |
| 29 var y = destination.offsetParent.offsetTop + destination.offsetTop + des
tination.offsetHeight / 2; | 29 var y = destination.offsetParent.offsetTop + destination.offsetTop + des
tination.offsetHeight / 2; |
| 30 eventSender.mouseMoveTo(x, y); | 30 eventSender.mouseMoveTo(x, y); |
| 31 contextMenuElements = eventSender.contextClick(); | 31 contextMenuElements = eventSender.contextClick(); |
| 32 // Esc key to hide the context menu. | 32 // Esc key to hide the context menu. |
| 33 eventSender.keyDown(String.fromCharCode(0x001B), null); | 33 eventSender.keyDown("escape", null); |
| 34 | 34 |
| 35 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling",
0); | 35 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling",
0); |
| 36 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); | 36 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); |
| 37 shouldBeEqualToString("window.getSelection().toString()", "wellcome"); | 37 shouldBeEqualToString("window.getSelection().toString()", "wellcome"); |
| 38 shouldBeEqualToString("contextMenuElements[contextMenuElements.length -
1]", "welcome"); | 38 shouldBeEqualToString("contextMenuElements[contextMenuElements.length -
1]", "welcome"); |
| 39 | 39 |
| 40 window.getSelection().removeAllRanges(); | 40 window.getSelection().removeAllRanges(); |
| 41 shouldBeEqualToString("window.getSelection().toString()", ""); | 41 shouldBeEqualToString("window.getSelection().toString()", ""); |
| 42 | 42 |
| 43 // Context click on "home" to show the context menu. | 43 // Context click on "home" to show the context menu. |
| 44 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 8
0; | 44 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 8
0; |
| 45 var y = destination.offsetParent.offsetTop + destination.offsetTop + des
tination.offsetHeight / 2; | 45 var y = destination.offsetParent.offsetTop + destination.offsetTop + des
tination.offsetHeight / 2; |
| 46 eventSender.mouseMoveTo(x, y); | 46 eventSender.mouseMoveTo(x, y); |
| 47 contextMenuElements = eventSender.contextClick(); | 47 contextMenuElements = eventSender.contextClick(); |
| 48 // Esc key to hide the context menu. | 48 // Esc key to hide the context menu. |
| 49 eventSender.keyDown(String.fromCharCode(0x001B), null); | 49 eventSender.keyDown("escape", null); |
| 50 | 50 |
| 51 // Context click should select correctly spelled words only with "win" e
diting behavior. | 51 // Context click should select correctly spelled words only with "win" e
diting behavior. |
| 52 if (behaviors[i] == "mac") | 52 if (behaviors[i] == "mac") |
| 53 shouldBeEqualToString("window.getSelection().toString()", "home"); | 53 shouldBeEqualToString("window.getSelection().toString()", "home"); |
| 54 else | 54 else |
| 55 shouldBeEqualToString("window.getSelection().toString()", ""); | 55 shouldBeEqualToString("window.getSelection().toString()", ""); |
| 56 shouldBeEqualToString("contextMenuElements[contextMenuElements.length -
1]", "<separator>"); | 56 shouldBeEqualToString("contextMenuElements[contextMenuElements.length -
1]", "<separator>"); |
| 57 | 57 |
| 58 window.getSelection().removeAllRanges(); | 58 window.getSelection().removeAllRanges(); |
| 59 } | 59 } |
| 60 }); | 60 }); |
| 61 | 61 |
| 62 </script> | 62 </script> |
| 63 </body> | 63 </body> |
| 64 </html> | 64 </html> |
| OLD | NEW |