Re: [svgwg] stroke-width initial value must include units

> The stroke-width syntax should actually be `<length-percentage> | <number>`, since plain numbers are valid in CSS properties, not only presentation attributes.

I’m not sure what you mean by *“plain numbers are valid in CSS properties”* but as far as the CSS `stroke-width` property specifically, unit-less numbers aren’t valid values for it per https://www.w3.org/TR/fill-stroke-3/#stroke-width and https://drafts.fxtf.org/fill-stroke/#stroke-width, which both define the allowed value as `<length-percentage>`.

> Confirmed support for plain numbers in all browsers.

It’s unsurprising that browsers accept and process unit-less numbers in the value. The issue here isn’t about the processing behavior/requirements in browsers; instead it’s about the document-conformance requirements — the authoring rules.

And naively I’d assume that a goal here is to be consistent with how the CSS specs define the document-conformance requirements for CSS `stroke-width` property. And the relevant CSS specs at https://www.w3.org/TR/fill-stroke-3/#stroke-width and https://drafts.fxtf.org/fill-stroke/#stroke-width both state the allowed value is `<length-percentage>` and the initial value is `1px`.

-- 
GitHub Notification of comment by sideshowbarker
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/529#issuecomment-414192875 using your GitHub account

Received on Monday, 20 August 2018 04:15:54 UTC