Open the attached test case. It contains three identical SVGs. The first one is a data uri referenced from an <img> element. The second is an external SVG referenced from another <img> element. The third one is an inline SVG.
The non-inline SVG images are not drawn correctly. The reason is the SVG includes a <mask> element which creates an ImageBuffer for applying the mask. For the non-inline case, SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem() returns an identity transform because RenderSVGRoot::localToParentTransform() does not return the zooming factor of the HTMLDocument since its document is an SVGDocument. Also deviceScaleFactor returns 1 in this case on Retina devices.
Created attachment 298161 [details]
Created attachment 298162 [details]