| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <style> | |
| 4 .editing { | |
| 5 border: 2px solid red; | |
| 6 padding: 12px; | |
| 7 font-size: 24px; | |
| 8 } | |
| 9 </style> | |
| 10 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script
> | |
| 11 <script> | |
| 12 | |
| 13 function print(message) { | |
| 14 var paragraph = document.createElement('p'); | |
| 15 paragraph.appendChild(document.createTextNode(message)); | |
| 16 document.getElementById('console').appendChild(paragraph); | |
| 17 } | |
| 18 | |
| 19 function editingTest() { | |
| 20 if (!window.objCPlugin) | |
| 21 return print('FAIL - no objCPlugin'); | |
| 22 | |
| 23 objCPlugin.removeBridgeRestrictions_(window); | |
| 24 if (!window.objc) | |
| 25 return print('FAIL - no window.objc'); | |
| 26 | |
| 27 // get the data for the pasteboard | |
| 28 var myURL = document.URL; | |
| 29 var resourceURL = myURL.replace('pasteboard/paste-TIFF.html','resources/TIFF
-pasteboard-data.dat'); | |
| 30 var data = objc('NSData').dataWithContentsOfURL_(objc('NSURL').URLWithString
_(resourceURL)); | |
| 31 | |
| 32 // This actually returns DumpRenderTree's local pasteboard | |
| 33 var pasteboard = objc('NSPasteboard').generalPasteboard(); | |
| 34 var pasteboardType = 'NeXT TIFF v4.0 pasteboard type'; | |
| 35 | |
| 36 pasteboard.declareType_owner_(pasteboardType, 0); | |
| 37 pasteboard.setData_forType_(data, pasteboardType); | |
| 38 | |
| 39 pasteCommand(); | |
| 40 | |
| 41 | |
| 42 } | |
| 43 </script> | |
| 44 | |
| 45 <title>Image (TIFF) paste test</title> | |
| 46 </head> | |
| 47 <body> | |
| 48 <div contentEditable="true" id="root" class="editing"> | |
| 49 <div id="test"> </div> | |
| 50 </div> | |
| 51 <div id='console'/> | |
| 52 | |
| 53 <script> | |
| 54 runEditingTest(); | |
| 55 </script> | |
| 56 | |
| 57 </body> | |
| 58 </html> | |
| OLD | NEW |