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

Unified Diff: LayoutTests/fast/canvas/canvas-text-space-characters.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-space-characters.html
diff --git a/LayoutTests/fast/canvas/canvas-text-space-characters.html b/LayoutTests/fast/canvas/canvas-text-space-characters.html
new file mode 100644
index 0000000000000000000000000000000000000000..b42f32855a513fbc311f6ea363e8962382f255c6
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-text-space-characters.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charcode="utf-16">
+ <script src="../../resources/js-test.js"></script>
+</head>
+<body>
+ <canvas></canvas>
+ <script>
+
+ if (window.testRunner)
+ testRunner.dumpAsTextWithPixelResults();
+
+ var canvas = document.querySelector("canvas");
+ var context = canvas.getContext("2d");
+
+ var testStr1 = 'a' + '\u0009' + 'b' + '\u000A' + 'c' + '\u000C' + 'd' + '\u000D' + 'e';
+ var testStr2 = 'a' + '\u0020' + 'b' + '\u0020' + 'c' + '\u0020' + 'd' + '\u0020' + 'e';
+
+ context.font = "12px Arial";
+ context.fillText(testStr1, 0, 10);
+ context.fillText(testStr2, 0, 30);
+
+ testStr1Width = context.measureText(testStr1).width;
+ testStr2Width = context.measureText(testStr2).width;
+
+ shouldBeTrue("testStr1Width == testStr2Width");
+
+ </script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/fast/canvas/canvas-text-ideographic-space.html ('k') | Source/core/html/canvas/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698