Re: [svgwg] Is the `path()` function allowed for the `d` property? (#939)

This is the definition of the `d` property used as a DOM attribute for the `<path>` element. In that case, yes, the CSS `path()` function is not supported. To my knowledge, no browser will render the following SVG document : 

```xml
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
  <path d="path('M1,1 9,1 9,9 1,9z')" />
</svg>
```

The CSS path function is only allowed when the `d` property is used as a CSS property with a stylesheet (it's actually mandatory for parsing reasons), which make that document okay to be rendered : 

```xml
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
  <style>
    path {
      d: path('M1,1 9,1 9,9 1,9z');
    }
  </style>
  <path />
</svg>
```

Not that currently, Safari doesn't support the `d` property as a CSS property while Chrome and Firefox do.

That said, to my knowledge there is no clear spec that summarize that behavior in CSS, and FWIW, the current SVG2 spec, even if it is the most accurate SVG spec currently available, doesn't really reflect the actual state of implementation of SVG within browsers... especially when it comes to CSS.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 9 April 2024 16:15:03 UTC