SVGRenderingContext::createImageBuffer always makes a 1x buffer. This makes <mask> and maybe other things always use 1x on 2x devices. We really need to audit all places that call ImageBuffer::create with a hardcoded 1! (This was going to affect Web Inspector but I was able to use <clipPath> instead.)
<rdar://problem/20506912>
Created attachment 297130 [details] Test case: the two circles should look identical. I would like to point out that this is not just an issue for Retina screens; it also affects zoomed in pages (either manually or through CSS).
I do not think we currently have a problem in SVGRenderingContext::createImageBuffer() when calling ImageBuffer::create(). Yes, we are still sending resolutionScale = 1 to ImageBuffer::create() but this is correct. We send absoluteTransform = zooming_factor * device_scaling to SVGRenderingContext::createImageBuffer() which uses it to scale the ImageBuffer bitmap and to transform its context accordingly. So the caller (RenderSVGResourceMasker::applyResource() in this case) can still draw using logical units on the ImageBuffer. Regarding the new test case, I think it is unrelated to this bug. It is related to displaying an <img> element whose src is an SVG data uri. In this case, we do not respect the zooming_factor because the SVG root element belongs to an SVGDocument which does not inherit the deviceScaleFactor of the containing HTMLDocument. I am going to close this bug and open a new one for the data uri case.
See https://bugs.webkit.org/show_bug.cgi?id=166750