[svgwg] Issue: Define behaviour of `<stop>` if `offset` value not specified. marked as Needs editing

nikosandronikos has just labeled an issue for 
https://github.com/w3c/svgwg as "Needs editing":

== Define behaviour of `<stop>` if `offset` value not specified. ==
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.

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:

> 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.



See https://github.com/w3c/svgwg/issues/217

Received on Tuesday, 26 July 2016 11:12:29 UTC