Creating a mask with a PNG (black circle, transparent background) and using
-webkit-mask-image:url(images/mask.png)
has been easy for browsers like Chrome. However, I've been encountering significant difficulties in getting the mask to display properly in Firefox when using SVG.
<svg>
<defs>
<mask id="mask" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse">
<image width="78px" height="78px" xlink:href="images/mask.png"/>
</mask>
</defs>
<foreignObject width="78px" height="78px" style="mask: url(#mask);">
<img src="images/avatar-sample.jpg" />
</foreignObject>
</svg>
The reason behind why this isn't functioning seamlessly in Firefox continues to elude me!