CanvasRenderingContext2D drawImage ignores globalAlpha for "data:image/svg+xml" source

RESOLVED DUPLICATE of bug 1074948

Status

()

Firefox
Untriaged
RESOLVED DUPLICATE of bug 1074948
3 years ago
3 years ago

People

(Reporter: Thomas Fischer, Unassigned)

Tracking

31 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36

Steps to reproduce:

canvas = document.body.appendChild(
  document.createElement('CANVAS')
);
canvas.width = canvas.height = 42;
context = canvas.getContext('2d');
context.globalAlpha = .5;

svg =
  '<svg xmlns="http://www.w3.org/2000/svg" width="42px" height="42px">' +
  '<rect width="42" height="42" style="fill:rgb(255,0,0);"/></svg>';
img = document.createElement('IMG');
img.onload = function() { context.drawImage(img, 0, 0, 42, 42); };
img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg);



Actual results:

The image (a red rectangle) is drawn full opaque


Expected results:

The image should be drawn HALF opaque, because of:
    context.globalAlpha = .5;
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1074948
You need to log in before you can comment on or make changes to this bug.