Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: LayoutTests/fast/canvas/canvas-text-ideographic-space.html

Issue 293653002: Canvas fillText and measureText handle ideographic spaces differently. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add v/g/* test expectations Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5982e026674f8fd20a8b02f81502156ab1a66992
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-text-ideographic-space.html
@@ -0,0 +1,36 @@
+<!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&#x3000;b&#x3000;c</span></div>
+ <div><canvas></canvas></div>
+ <script>
+
+ var canvas = document.querySelector("canvas");
+ var context = canvas.getContext("2d");
+ var span = document.querySelector("span");
+
+ var abc = 'a' + '\u3000' + 'b' + '\u3000' + 'c';
+ context.font = "12px Arial";
+ context.fillText(abc, 0, 20);
+
+ spanWidth = span.offsetWidth;
+ canvasWidth = context.measureText(abc).width;
+ shouldBeTrue("spanWidth == canvasWidth");
+
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698