W3C home > Mailing lists > Public > public-svg-issues@w3.org > March 2019

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

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Mon, 18 Mar 2019 20:56:08 +0000
To: public-svg-issues@w3.org
Message-ID: <issue_comment.created-474097525-1552942567-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.3.1 : Monday, 18 March 2019 20:56:13 UTC