Repeated 0 and 1 radial gradient stops don't behave to spec on OS X

RESOLVED WONTFIX

Status

()

Core
Canvas: 2D
RESOLVED WONTFIX
4 years ago
4 years ago

People

(Reporter: milan, Assigned: milan)

Tracking

26 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

Created attachment 8458179 [details]
If the two canvas are "the same", we're good

This came up during the investigation of bug 1038277, but better to keep it separate.  Based on the spec: http://www.w3.org/TR/2dcontext/#dom-canvasgradient-addcolorstop, these two radial gradients should be "almost the same":
g1.addColorStop(0, '#0f0');
g1.addColorStop(0.01, '#f00');
g1.addColorStop(0.5, '#00f');
g1.addColorStop(0.99, '#ff0');
g1.addColorStop(1, '#0f0');

and

g2.addColorStop(0, '#0f0');
g2.addColorStop(0, '#f00');
g2.addColorStop(0.5, '#00f');
g2.addColorStop(1, '#ff0');
g2.addColorStop(1, '#0f0');

They are not.
Just to clarify - "the same" really means inside of the inner circle, and outside of the outer circle.  As long as those are green, we're OK.  We're really bad on OS X with CoreGraphics, better on Windows, good on Linux:

(good) Linux = the inside is green (good), the outside is green (good)
(bad) OS X + CoreGraphics = the inside is *missing* (really bad), the outside is yellow (bad)
(bad) OS X + Skia = the inside is red (bad), the outside is yellow (bad)
(bad) Windows 7 = the inside is green (good), the outside is yellow (bad)

Other browsers:

(bad) Chrome & Safari = the inside is red (bad), the outside is yellow (bad)
(good) Windows 7 IE = the inside is green (good), the outside is green (good)
Created attachment 8458769 [details]
More examples - top and bottom should match
Created attachment 8460509 [details] [diff] [review]
Work around CG bug with radial gradients and repeated end stops

Is it worth it, or should we just live with this CG bug? It only came up because we're kludging a canvas test content/canvas/test/test_2d.gradient.radial.outside3.html to not repeat the zero radial gradient stop.

But this hack is just working around that, so that we can say we follow the standard, creates extra radial gradients, etc.
Attachment #8460509 - Flags: feedback?(jmuizelaar)
Created attachment 8470314 [details] [diff] [review]
Work around CG bug with radial gradients and repeated start/end stops

https://tbpl.mozilla.org/?tree=Try&rev=048b7824c7df
Attachment #8460509 - Attachment is obsolete: true
Attachment #8460509 - Flags: feedback?(jmuizelaar)
Attachment #8470314 - Flags: review?(jmuizelaar)
Assignee: nobody → milan
Blocks: 1038277
Summary: Repeated 0 and 1 radial gradient stops don't behave to spec → Repeated 0 and 1 radial gradient stops don't behave to spec on OS X
Is complicating this code in order to hit the standard worth the effort?
Flags: needinfo?(jmuizelaar)
(In reply to Milan Sreckovic [:milan] from comment #5)
> Is complicating this code in order to hit the standard worth the effort?

Nope.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: needinfo?(jmuizelaar)
Resolution: --- → WONTFIX
Attachment #8470314 - Flags: review?(jmuizelaar)
You need to log in before you can comment on or make changes to this bug.