Closed Bug 1153075 Opened 10 years ago Closed 10 years ago

SVG linearGradient on stroke bug

Categories

(Firefox :: Untriaged, defect)

37 Branch
All
Windows
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: ifurkend, Unassigned)

Details

Attachments

(1 file)

Attached image linearGradient_test.svg
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:37.0) Gecko/20100101 Firefox/37.0 Build ID: 20150402191859 Steps to reproduce: Load linearGradient (with the default value "objectBoundingBox" of "gradientUnits" parameter) on path or line stroke which is only a horizontal or vertical straight line. Attached the SVG file which reproduces the said bug in Firefox. Actual results: The gradient is not loaded, unless the line/path slants slightly or bent to different direction. Expected results: Produce a similar result to librsvg which can be tested in https://tools.wmflabs.org/svgcheck/index.php.
OS: Windows XP → Windows
Hardware: x86 → All
http://www.w3.org/TR/SVG/coords.html#ObjectBoundingBoxUnits last paragraph Keyword objectBoundingBox should not be used when the geometry of the applicable element has no width or no height, such as the case of a horizontal or vertical line, even when the line has actual thickness when viewed due to having a non-zero stroke width since stroke width is ignored for bounding box calculations. When the geometry of the applicable element has no width or height and objectBoundingBox is specified, then the given effect (e.g., a gradient or a filter) will be ignored. Please raise a bug on librsvg that it is not following the SVG specification correctly.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
TBH, I feel Gnome does this intentionally. Technically it might be incoherent to the specification; practically it is extremely helpful to SVG graphists. I see no reason why Gnome should revert their twist. Your reply only makes us SVG graphists feel Mozilla is mean and rather let us assume gradient/filter is not supported on stroke but in actuality it's not true. I don't think many graphists out there could have figured out the workaround (slant the stroke tiny bit to give it technical dimension) themselves unless Mozilla makes a loud announcement.
Go get the SVG Specification changed so we can change the implementation then. https://lists.w3.org/Archives/Public/www-svg/
A better way to do it would be to use a rect or polygon and fill it with a gradient rather than put the gradient on the stroke of a line BTW.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: