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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-text-baseline-tiny-fonts.html

Issue 2392033002: Correcting text baseline for tiny fonts (Closed)
Patch Set: Rebaseline. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <canvas id="canvas1" width=200 height=200></canvas>
3 <canvas id="canvas2" width=200 height=200></canvas>
4 <canvas id="canvas3" width=200 height=200></canvas>
5 <canvas id="canvas4" width=200 height=200></canvas>
6
7 <script>
8 if (window.testRunner)
9 window.testRunner.dumpAsTextWithPixelResults();
10
11 function draw() {
12 for(i = 1; i <= 4; i++) {
13 var ctx = document.getElementById("canvas" + i).getContext("2d");
14 ctx.scale(10, 10);
15 ctx.lineWidth = 0.1;
16
17 ctx.beginPath();
18 ctx.moveTo(0, 10);
19 ctx.lineTo(20, 10);
20 ctx.stroke();
21
22 ctx.font = i + "px sans-serif"
23 ctx.textBaseline = "top"
24 ctx.strokeText("A", 1, 10);
25 ctx.textBaseline = "middle"
26 ctx.strokeText("B", 5, 10);
27 ctx.textBaseline = "alphabetic"
28 ctx.strokeText("C", 10, 10);
29 ctx.textBaseline = "bottom"
30 ctx.strokeText("D", 15, 10);
31 }
32 }
33
34 window.onload = draw;
35 </script>
36
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698