Closed Bug 1816645 Opened 3 years ago Closed 2 years ago

Inlined svg filters aren't working correctly

Categories

(Core :: Graphics: Canvas2D, defect, P3)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: calixte, Unassigned)

Details

Attachments

(1 file)

Attached file canvas_filter1.html —

SVG filters defined with something like url("data:image/svg+xml,<svg... are not working at all.

Nical, do you have an idea why this is the case?

Severity: -- → S3
Flags: needinfo?(nical.bugzilla)
Priority: -- → P3

It's a race condition. You need to wait for the filter to render before drawing the image.

            requestAnimationFrame(() => {
	  ctx1.drawImage(img, 0, 0, 1279, 1279, 10, 10, 200, 200);
});
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(nical.bugzilla)
Resolution: --- → INVALID

https://html.spec.whatwg.org/multipage/canvas.html#working-with-externally-defined-svg-filters

Since drawing is performed using filter value "none" until an externally-defined filter has finished loading, authors might wish to determine whether such a filter has finished loading before proceeding with a drawing operation...

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: