| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-text-ideographic-space.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-text-ideographic-space.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-text-ideographic-space.html
|
| index 5982e026674f8fd20a8b02f81502156ab1a66992..97c0e5dad154b74284a06723e482b2187a31a6c4 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-text-ideographic-space.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-text-ideographic-space.html
|
| @@ -1,25 +1,40 @@
|
| -<!DOCTYPE html>
|
| -<html>
|
| -<head>
|
| - <meta charcode="utf-16">
|
| - <script src="../../resources/js-test.js"></script>
|
| - <style>
|
| -
|
| +<meta charcode="utf-16">
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<style>
|
| span {
|
| padding : 0px;
|
| font-size : 12px;
|
| font-family : Arial;
|
| display : inline;
|
| }
|
| -
|
| - </style>
|
| -</head>
|
| +</style>
|
| <body>
|
| - <div><span>a b c</span></div>
|
| - <div><canvas></canvas></div>
|
| - <script>
|
| +<div><span>a b c</span></div>
|
| +<div><canvas></canvas></div>
|
| +
|
| +<script>
|
| +var PIXEL_RATIO = (function () {
|
| + var ctx = document.createElement("canvas").getContext("2d"),
|
| + dpr = window.devicePixelRatio || 1,
|
| + bsr = ctx.webkitBackingStorePixelRatio ||
|
| + ctx.mozBackingStorePixelRatio ||
|
| + ctx.msBackingStorePixelRatio ||
|
| + ctx.oBackingStorePixelRatio ||
|
| + ctx.backingStorePixelRatio || 1;
|
| +
|
| + return dpr / bsr;
|
| +})();
|
|
|
| +
|
| +test(function(t) {
|
| var canvas = document.querySelector("canvas");
|
| + canvas.width = 300 * PIXEL_RATIO;
|
| + canvas.height = 150 * PIXEL_RATIO;
|
| + canvas.style.width = 300 + "px";
|
| + canvas.style.height = 150 + "px";
|
| + canvas.getContext("2d").setTransform(PIXEL_RATIO, 0, 0, PIXEL_RATIO, 0, 0);
|
| +
|
| var context = canvas.getContext("2d");
|
| var span = document.querySelector("span");
|
|
|
| @@ -29,8 +44,8 @@
|
|
|
| spanWidth = span.offsetWidth;
|
| canvasWidth = context.measureText(abc).width;
|
| - shouldBeTrue("spanWidth == canvasWidth");
|
| -
|
| - </script>
|
| + assert_approx_equals(spanWidth, canvasWidth, 0.999);
|
| +}, 'Test canvas text ideographic space.');
|
| +</script>
|
| </body>
|
| -</html>
|
| +
|
|
|