Opened 7 years ago

Last modified 4 years ago

#13553 new bug

Webkit: gradient drawing doesn't always work correctly

Reported by: accessays Owned by: pulkomandy
Priority: normal Milestone: Unscheduled
Component: Kits/Web Kit Version: R1/Development
Keywords: gradient, web+, rendering Cc: accessays
Blocked By: Blocking:
Platform: x86

Description

On this page: https://www.w3schools.com/css/css3_gradients.asp. Open with WebPositive and Firefox for comparison. Stuff like Gradient Background and Radial Gradient - Evenly Spaced Color Stops doesn't render correctly. Might be related to #13101.

Change History (5)

comment:1 by pulkomandy, 6 years ago

They all look ok to me, even if they use a different color mixing algorithm. Does the spec define how the colors are mixed, which colorspace, etc?

comment:2 by nephele, 4 years ago

Component: Applications/WebPositiveKits/Web Kit
Summary: WebPositive gradient drawing doesn't always work correctlyWebkit: gradient drawing doesn't always work correctly

The gradients are a lot more "blocky" in some cases compared to rendering on iOS (as in Rainbow background renders in sections in Web+ but renders smooth in safari)

comment:3 by pulkomandy, 4 years ago

Does the css spec defines how the intermediate colors in a gradient are computed?

Because we just get the color stops from WebKit and put them in our BGradient class, which may not use the expected blending algorithm.

comment:4 by nephele, 4 years ago

It seems somewhat ambiqious, it doesn't seem to say anything about the colors between defined ones, unless i missed something.

"The point’s color is the color of the gradient line at the point where this line intersects it." https://drafts.csswg.org/css-images-3/#linear-gradients

comment:5 by madmax, 4 years ago

Down in section 3.4.2:

"Between two color stops, the gradient line’s color is interpolated between the colors of the two color stops, with the interpolation taking place in premultiplied RGBA space."

"By default, this interpolation is linear [... except when there's a transition hint, in which case you do ...]"

Also in 3.4: "UAs may “dither” gradient colors slightly [...] to effect a smoother gradient."

Note: See TracTickets for help on using tickets.