| OLD | NEW |
| (Empty) |
| 1 description("This verifies that the browser does not crash when drawing text to
a canvas in a frame-less document."); | |
| 2 | |
| 3 // It is not clear from the spec whether this is supposed to work and how. | |
| 4 // Therefore, we do not validate the rendering results. We just make sure | |
| 5 // this does not crash the browser. | |
| 6 var canvas1 = document.createElement('canvas'); | |
| 7 var ctx1 = canvas1.getContext('2d'); | |
| 8 var htmlDoc = document.implementation.createHTMLDocument('', '', null); | |
| 9 htmlDoc.adoptNode(canvas1); | |
| 10 var canvas2 = htmlDoc.createElement('canvas'); | |
| 11 var ctx2 = canvas2.getContext('2d'); | |
| 12 | |
| 13 ctx1.font = 'italic 30px Arial'; | |
| 14 ctx2.font = 'italic 30px Arial'; | |
| 15 ctx1.fillText('Text1', 0, 30); | |
| 16 ctx2.fillText('Text1', 0, 30); | |
| 17 ctx1.strokeText('Text2', 0, 60); | |
| 18 ctx2.strokeText('Text2', 0, 60); | |
| 19 ctx1.measureText('Text3'); | |
| 20 ctx2.measureText('Text3'); | |
| OLD | NEW |