OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charcode="utf-16"> |
| 5 <script src="../../resources/js-test.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <canvas></canvas> |
| 9 <script> |
| 10 |
| 11 if (window.testRunner) |
| 12 testRunner.dumpAsTextWithPixelResults(); |
| 13 |
| 14 var canvas = document.querySelector("canvas"); |
| 15 var context = canvas.getContext("2d"); |
| 16 |
| 17 var testStr1 = 'a' + '\u0009' + 'b' + '\u000A' + 'c' + '\u000C' + 'd' + '\u0
00D' + 'e'; |
| 18 var testStr2 = 'a' + '\u0020' + 'b' + '\u0020' + 'c' + '\u0020' + 'd' + '\u0
020' + 'e'; |
| 19 |
| 20 context.font = "12px Arial"; |
| 21 context.fillText(testStr1, 0, 10); |
| 22 context.fillText(testStr2, 0, 30); |
| 23 |
| 24 testStr1Width = context.measureText(testStr1).width; |
| 25 testStr2Width = context.measureText(testStr2).width; |
| 26 |
| 27 shouldBeTrue("testStr1Width == testStr2Width"); |
| 28 |
| 29 </script> |
| 30 </body> |
| 31 </html> |
OLD | NEW |