Closed Bug 280027 Opened 20 years ago Closed 20 years ago

SVG gradients incorrect if stops not at 0.0 and 1.0

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: chris, Assigned: tor)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050127 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050127 Firefox/1.0+

Using the SVG GDI+ build of Firefox 1.0+, gradients display correctly if there
is at minimum a stop with offset 0.0 and a stop with offset 1.0 (plus zero or
more intermediate stops). However, if the offsets are not exactly 0.0 and 1.0, a
default red to green gradient displays instead. Although most content does in
fact include stops at the extremes of the offset range, this is not required by
the spec
http://www.w3.org/TR/SVG11/pservers.html#GradientStops
and some content does use gradient stops some way from the ends, to give a
little padding. The defauly value for the spreadMethod attribute on
linearGradient and radialGradient is pad, so the color at the stop with the
lowest offset is used for the portion 0 to stop, and the color of the stop at
the highest offset is used for the portion stop to 1.0

Reproducible: Always

Steps to Reproduce:
1. Load attached file blue-red-yellow.svg into an SVg-enabled build of Firefox
2. 
3.

Actual Results:  
Three gradients are displayed. The upper and lower gradients are red to green

Expected Results:  
Three gradients displayed, all blue to red to yellow, with small differences due
to the precise stop offsets.

Note that the lowest gradient of the three has one stop at 0.0, so the bug is
produced when one of the stops is at the extreme of the offset range and the
other is not.
The bug happens with the percentage values of offset, too.
Shows three gradients, the middle one is correct and the top and bottom ones
are incorrect.
Assignee: firefox → general
Component: General → SVG
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
Looks to be a "feature" of GDI+ - testcase works fine with cairo.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: general → tor
Attachment #172593 - Flags: review?(scootermorris)
Attachment #172593 - Flags: review?(scootermorris) → review+
Checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: