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
A user of my rendering library has just discovered a bug triggered by an SVG file which has gradients defined with a missing offset value on the first stop elements.
<stop stop-color="#288549"/>
While checking the correct behaviour, I was surprised to discover that neither SVG 1.1 not SVG 2 have anything to say about what the initial value of offset should be if it is not specified.
From testing it seems that all browsers treat a missing offset as 0 (0%), rather than an error.
So I suggest making that explicit in the definition, by changing the first bullet point in section 13.3.5.3 to read:
Gradient offset values less than 0 (or less than 0%) are rounded up to 0%. Gradient offset values greater than 1 (or greater than 100%) are rounded down to 100%. If offset is not specified, the effect is as if a value of '0%' were specified.
The text was updated successfully, but these errors were encountered:
This rule would have an effect also depending on where in the list the stop is:
Each gradient offset value is required to be equal to or greater than the previous gradient stop's offset value. If a given gradient stop's offset value is not equal to or greater than all previous offset values, then the offset value is adjusted to be equal to the largest of all previous offset values.
A user of my rendering library has just discovered a bug triggered by an SVG file which has gradients defined with a missing
offset
value on the first stop elements.While checking the correct behaviour, I was surprised to discover that neither SVG 1.1 not SVG 2 have anything to say about what the initial value of
offset
should be if it is not specified.From testing it seems that all browsers treat a missing offset as 0 (0%), rather than an error.
https://jsfiddle.net/kLc17qjg/
So I suggest making that explicit in the definition, by changing the first bullet point in section 13.3.5.3 to read:
The text was updated successfully, but these errors were encountered: