Open Bug 1096885 Opened 11 years ago Updated 3 years ago

SVG image as CSS background has left edge flattened/cropped, with fractional pixel sizing & positioning

Categories

(Core :: SVG, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: yem_salat, Unassigned)

References

Details

Attachments

(2 files)

Attached image scr.png
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0 Build ID: 20141101211637 Steps to reproduce: http://codepen.io/anon/pen/yyBZKG Actual results: The left side is slightly cut off when background-size is 100% http://i.imgur.com/oX4x1S7.png Expected results: Shouldn't be cut out at all, works correctly in Chrome and Opera (Blink)
UPD: OS Windows 8.1
Component: Untriaged → SVG
Product: Firefox → Core
Seems significantly better on trunk. https://nightly.mozilla.org/ what do you think Vladimir?
Flags: needinfo?(yem_salat)
To be clear, the screenshot from the reporter in comment 0 *is* from trunk, per the UA string in that comment. It also matches what I see on my linux nightly -- the left edge is flattened a bit. ( --> Canceling needinfo, as I think Robert might've missed the comment 0 screenshot/UA-string.) Seth, do you know of any ongoing imagelib refactoring that might help here?
Flags: needinfo?(yem_salat) → needinfo?(seth)
Version: 36 Branch → Trunk
Attached file testcase 1
Here's the reporter's testcase, with the SVG simplified a bit (and encoded as a data URL), and with the HTML simplified a bit as well. Note that the HTML has a fractional pixel values for positioning and sizing. If I change *either* the "width" value or the "padding-left" value to be a whole number, then the flattening goes away. So, this is clearly a rounding/snapping bug at some level.
Status: UNCONFIRMED → NEW
Ever confirmed: true
The screenshot in comment 1 looks like it isn't from trunk, the one in comment 0 looks like it is. Hence my confusion.
In Nightly, the rendering is better at default zoom level, but if I zoom out/in, I can the see the bad rendering again.
As Daniel mentioned - my screen is from nightly trunk on linux, the result is the same on on regular firefox (also linux) Everything looks fine on a Mac. Vladimir's screen is made on regular ff in windows 8.1, setting background-size to 99% does not help his case, I asked him to re-test on latest nightly.
Vladimir reports that on Windwows 8.1 on nightly build the situation is the same as on linux: http://www.imageup.ru/img278/1941213/77651919.png
(In reply to Daniel Holbert [:dholbert] from comment #4) > Seth, do you know of any ongoing imagelib refactoring that might help here? There's no ongoing refactoring that might help here. This is just a numerical accuracy bug that somehow didn't get fixed by bug 1037713. Most of the other bugs like that involve issues with the layers system. I wonder if there's something SVG-specific here? (i.e., the bug is either in VectorImage or in the underlying SVG code) I'll make this depend on bug 1037713 so it has a connection to the other numerical accuracy bugs.
Depends on: DrawAPIRefactor
Flags: needinfo?(seth)
Summary: SVG is displayed incorrectly, when used as background → SVG background has "flattened" left edge (with fractional pixel sizing & positioning)
Summary: SVG background has "flattened" left edge (with fractional pixel sizing & positioning) → SVG image as CSS background has left edge flattened/cropped, with fractional pixel sizing & positioning
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: