summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/script-tests/text-globalAlpha.js
blob: fb78d67bb1dcdca86b3930af72c962d07b10c009 (plain)
1
2
3
4
5
6
7
8
9
10
description("Ensure that globalAlpha is applied correctly to text.");
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
ctx.fillStyle = "black";
ctx.globalAlpha = 0.5;
ctx.font = "50px Arial";
ctx.fillText("A",50,50);
var imageData = ctx.getImageData(63, 22, 1, 1);
var imgdata = imageData.data;
shouldBeTrue("imgdata[3] == 127 || imgdata[3] == 128");