W3C home > Mailing lists > Public > www-svg@w3.org > July 2015

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

From: Daniel Holbert <dholbert@mozilla.com>
Date: Tue, 21 Jul 2015 11:00:28 -0700
To: anatoly techtonik <techtonik@gmail.com>, Jeremie Patonnier <jeremie.patonnier@gmail.com>
Cc: www-svg <www-svg@w3.org>
Message-ID: <55AE88BC.90704@mozilla.com>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:55:02 UTC