line fails to render when stroke color associated with gradient

RESOLVED INVALID

Status

()

Core
SVG
RESOLVED INVALID
11 years ago
5 years ago

People

(Reporter: JP Fiset, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a4) Gecko/20070427 GranParadiso/3.0a4
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a4) Gecko/20070427 GranParadiso/3.0a4

Create a line and assign a gradient for color. The line fails to render in Gran Paradiso 4. This problem was reproduced on MacOS and Windows.

Reproducible: Always

Steps to Reproduce:
1. Create a line
2. Assign a gradient for color
3.
Actual Results:  
Line is not painted

Expected Results:  
Line should be painted with correct gradient
(Reporter)

Comment 1

11 years ago
Created attachment 265821 [details]
Test case
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hardware: PC → All
Version: unspecified → Trunk
I really doubt that bug 321294 is the cause, it only removed unused code.
It is much more likely one of the cairo changes.
cairo won't calculate the bounding box of the line properly and so gecko doesn't draw it.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 377085
Actually this is invalid, and is not a duplicate of bug 3777085 at all.

Explanation...

The linearGradient does not specify gradientUnits and therefore defaults to objectBoundingBox per http://www.w3.org/TR/SVG/pservers.html#LinearGradients.

Bearing this in mind...
http://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBox says that 
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.

Therefore the line should be drawn without a gradient.

So what Firefox 3 is doing is correct and Firefox 2 is incorrect.
Resolution: DUPLICATE → INVALID
Duplicate of this bug: 701053

Comment 9

5 years ago
hi, Robert

Could you please show us the way to draw a horizontal/vertical line with gradient? Thanks!
You need to log in before you can comment on or make changes to this bug.