Re: [svgwg] Potentially invalid value for dasharray (#642)

> But I can't think of a CSS property that accepts a list of numbers

Here's an example of repeated dimensions without spaces, which every browser correctly accepts as valid:

```html
<!DOCTYPE html>
<div>foo</div>
<style>
div { border-width: .2em.2em.2em.2em; border-style: solid; }
</style>
```

(`scale` accepts repeated numbers, but it's not widely supported yet.)

Except where *explicitly* noted (such as in the grammar for `calc()`), CSS doesn't care about spaces *at all*. If you can produce the right token stream without them, it's fine; this can be reliably achieved by using comments to separate things instead, and in some cases (such as the example above) by just using characters that aren't valid at that spot in the current token, so it ends and a new token begins.

It just so happens that the vast majority of the time, spaces are the easiest, shortest way to separate your tokens.

---------

The correct way to indicate that something can be repeated, with either WS or comma between them (but not multiple commas in a row) is with the `+#` stacked combinator. That handles all variants correctly. So the grammar for `dasharray` is already correct.

@AmeliaBR's suggested fix is unnecessary, but not incorrect; it's identical in meaning.

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

Received on Monday, 18 March 2019 20:56:12 UTC