Re: Firefox white space between <object> and referenced SVG

On 07/21/2015 10:17 AM, anatoly techtonik wrote:
> Chrome: http://techtonik.bitbucket.org/svg/chrome43.png
> Firefox: http://techtonik.bitbucket.org/svg/firefox39.png

Yeah, this is an old Firefox bug:
 https://bugzilla.mozilla.org/show_bug.cgi?id=608812

Basically, you're seeing a difference in pixel-snapping vs.
not-pixel-snapping, between the border vs. the SVG content there.  In
your example, the <object> happens to have its top edge in between exact
pixel values (due to the particular size of the text above it). We snap
the border to the nearest pixel value (upwards), so it's nice and crisp.
But we allow the SVG content itself to have a fractional-position, so it
gets smeared across adjacent pixels. This produces a whitish-gray white
area on the top row of SVG pixels, from the first pixel only being
partially covered by SVG content.

You can work around this by making sure your SVG is positioned at a
whole-pixel position -- not a fractional position. Layerization hacks
are one way to do this (e.g. "transform: translate(0,0)" on your
object), though there are probably better ways.

Anyway, further discussion of this should probably go on the bug & not
on www-svg, since this is a Firefox-specific issue.

Received on Tuesday, 21 July 2015 18:01:08 UTC