-moz-linear-gradient(top, yellow, blue) and -moz-linear-gradient(bottom, blue, yellow) don't agree when applied to the same box

NEW
Unassigned

Status

()

Core
Graphics
8 years ago
6 years ago

People

(Reporter: zwol, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
Two of the test cases added in bug 526402 assert that a gradient drawn from point A to point B, color X to color Y, is pixel-identical with a gradient drawn from B to A, color Y to X.  We currently manage this visually but not pixel-for-pixel (thus those test cases are todos).

Examining the test and reference images for the simpler of these tests in an image editor, it appears to me that the problem is with mapping the endpoints onto the box.  aja-linear-1b draws a vertical gradient from bottom up, blue to yellow, and expects it to match a vertical gradient from top down, yellow to blue.  Here's the pixel values for the top and bottom four rows of test and reference:

test     reference
#fdfd01  #ffff00
#fcfc02  #fefe00
#fbfb03  #fcfc02
#f9f905  #fbfb03
...      ...
#0303fb  #0505f9
#0202fc  #0303fb
#0000fe  #0202fc
#0000ff  #0101fd

so that looks to me like the map from (x,y) to t is shifted by two pixels, or possibly two and a half pixels, between the two.  Fencepost error?  Note that the problem can be reproduced with canvas as well as with CSS gradients, and is consistent among canvas/canvas, canvas/CSS, CSS/canvas, CSS/CSS; so I imagine it is in thebes or cairo.
(Reporter)

Updated

8 years ago
OS: Linux → All
Hardware: x86 → All
Still a bug everywhere (Except d2d).
Component: Graphics → Canvas: 2D
(Reporter)

Comment 2

6 years ago
Uh, why did you recharacterize this as a *canvas* bug? It can be triggered by CSS gradients.
Component: Canvas: 2D → Graphics
Right, accidental change.
You need to log in before you can comment on or make changes to this bug.