You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug 1939948 - When extending a gradient beyond the first/last specified color stops, do not add interpolated stops between the specified stops and the newly-added ones at 0% and/or 100%. r=longsonr
Per spec[1],
"Before the first color stop, the gradient line is the color of the first color stop,
and after the last color stop, the gradient line is the color of the last color stop."
Thus, these areas (if they exist, i.e. if the specified color stops do not reach to the
ends of the gradient line being rendered) are simply solid areas of the first or last
color respectively.
In most cases, adding interpolated stops within these areas would be harmless, as they
would all be the same color. But in the case of longer-hue interpolation, this is not
the case, and if we allow interpolation of extra stops, they will create an additional
"cycle" of the gradient, outside the range for which it was actually defined.
To avoid this, we ensure that when extending the color line in this way, only the new
end stop is added, without any intermediate interpolated stops.
[1] https://drafts.csswg.org/css-images-4/#coloring-gradient-line
Differential Revision: https://phabricator.services.mozilla.com/D233216
0 commit comments