I have the beginnings of a jigsaw demo in SVG that works in Opera, Chrome, and Safari, but not Firefox: the background rect
shows, but the pieces are all entirely missing.
The pieces consist of a path
element whose fill
property references a pattern
that in turn contains a copy of the image translated so that the correct part of the image falls under the path‘s clip. These pieces are generated by JavaScript code.
I have occasionally had a failure mode where the image fails to appear—but in that case, the stroke of the path should be visible. On Firefox I do not even see the stroke.
I’d be interested if anyone can tell me whether
I have misread the SVG specs and what I am doing should not work at all—Opera, Chrome, and Safari were just being kind; or
Firefox has a well-known patterns-containing-images bug that has a simple workaround.
This is my third attempt at getting an image to work as the background for an irregularly-shaped puzzle piece: filters do not work because they do not seem to have a way to translate the image they refer to, and just placing an image with clipPath
does not work because dragging an image in Safari attempts to drag the image file on to the desktop, whch interferes with dragging pieces around the puzzle!