Chromium Code Reviews| Index: LayoutTests/fast/canvas/canvas-text-ideographic-space.html |
| diff --git a/LayoutTests/fast/canvas/canvas-text-ideographic-space.html b/LayoutTests/fast/canvas/canvas-text-ideographic-space.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3aaa61eaadfd818fadef0e3a8ee2fe0f9d23f85d |
| --- /dev/null |
| +++ b/LayoutTests/fast/canvas/canvas-text-ideographic-space.html |
| @@ -0,0 +1,39 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| + <meta charcode="utf-16"> |
| + <script src="../../resources/js-test.js"></script> |
| + <style> |
| + |
| + span { |
| + padding : 0px; |
| + font-size : 12px; |
| + font-family : Arial; |
| + display : inline; |
| + } |
| + |
| + </style> |
| +</head> |
| +<body> |
| + <div><span>a b c</span></div> |
| + <div><canvas></canvas></div> |
| + <script> |
| + |
| + if (window.testRunner) |
| + testRunner.dumpAsTextWithPixelResults(); |
| + |
| + var canvas = document.querySelector("canvas"); |
| + var context = canvas.getContext("2d"); |
| + var span = document.querySelector("span"); |
| + |
| + var abc = 'a' + '\u3000' + 'b' + '\u3000' + 'c'; |
|
Justin Novosad
2014/05/20 18:29:50
Please add more tests to cover cases that contain
|
| + context.font = "12px Arial"; |
| + context.fillText(abc, 0, 20); |
| + |
| + spanWidth = span.offsetWidth; |
| + canvasWidth = context.measureText(abc).width; |
| + shouldBeTrue("spanWidth == canvasWidth"); |
| + |
| + </script> |
| +</body> |
| +</html> |