OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body oncopy="copy(event)" onpaste="paste(event)"> | 3 <body oncopy="copy(event)" onpaste="paste(event)"> |
4 <div>This file tests the basic functionality and properties of DataTransferItems
. This test requires DRT.</div> | 4 <div>This file tests the basic functionality and properties of DataTransferItems
. This test requires DRT.</div> |
5 <div id="console"></div> | 5 <div id="console"></div> |
6 | 6 |
7 <script src="../editing.js"></script> | 7 <script src="../editing.js"></script> |
8 <script> | 8 <script> |
9 var undefined; | 9 var undefined; |
10 var pendingCallbacks = 0; | 10 var pendingCallbacks = 0; |
11 var savedDataTransferItems = null; | 11 var savedDataTransferItems = null; |
12 var savedDataTransferItem = null; | 12 var savedDataTransferItem = null; |
13 | 13 |
14 function log(text) | 14 function log(text) |
15 { | 15 { |
16 var console = document.getElementById('console'); | 16 var console = document.getElementById('console'); |
17 console.appendChild(document.createTextNode(text)); | 17 console.appendChild(document.createTextNode(text)); |
18 console.appendChild(document.createElement('br')); | 18 console.appendChild(document.createElement('br')); |
19 } | 19 } |
20 | 20 |
21 function removeFontName(text) | 21 function removeFontName(text) |
22 { | 22 { |
23 if (!text) | 23 if (!text) |
24 return text; | 24 return text; |
25 return text.replace(/font-family: [^;]+;/g, ''); | 25 return text.replace(/font-family: .+?; /, ''); |
26 } | 26 } |
27 | 27 |
28 function handleEvent(data) | 28 function handleEvent(data) |
29 { | 29 { |
30 log(data); | 30 log(data); |
31 if (--pendingCallbacks == 0) { | 31 if (--pendingCallbacks == 0) { |
32 window.testRunner.notifyDone(); | 32 window.testRunner.notifyDone(); |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 if (typeof savedDataTransferItem == 'undefined') { | 115 if (typeof savedDataTransferItem == 'undefined') { |
116 log('DataTransferItem accessed outside event handler!'); | 116 log('DataTransferItem accessed outside event handler!'); |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 runTest(); | 120 runTest(); |
121 | 121 |
122 </script> | 122 </script> |
123 </body> | 123 </body> |
124 </html> | 124 </html> |
OLD | NEW |