Re: [svgwg] [svg-native] Which CSS concepts should be supported in presentation attributes? (#681)

Going through Myles' list:

- I agree that `var()` and `env()` are fairly equal from an implementation perspective. Might as well allow both.  But no requirements that a renderer needs to provide any initial values, only that they can parse the function and apply the fallback.

- `calc()` is most useful in combination with relative or percentage units. If those are going to be banned, banning calc also makes sense, given the implementation complexity. Same for other math functions, which are most useful for dynamic graphical layouts, where you don't want to pre-calculate all the results.

- For percentages, the implementation complexity evaporates if we require `viewBox` on the root `<svg>` (and continue to disallow nested SVG viewports). But, the authoring benefits evaporate, too: you can always directly convert the percentages to user units if you know the viewBox size.

- Font-relative units aren't very useful _inside_ a graphic if there is no text within it.  But maybe we could still allow all units (and percentages) on the `width` and `height` attributes on the outer `<svg>`, since they set the default size when the graphic is rendered. (E.g., it's common to set them to 1em for an icon.)  Viewport-relative units in SVG are like percentages with extra complications, so I suppose they are reasonable to exclude, as well.

- I don't see why there is any implementation complexity to supporting `initial` and `inherit`, to cancel inheritance in a normally inherited property or force inheritance in a normally uninherited one.

- `all` is more complex, but we've already prohibited it by saying we only support styling via presentation attributes; there is no `all` attribute.

- **Full property inheritance is essential.**

- `attr()` doesn't offer any benefits in SVG that only uses presentation attributes.

Other things to think of:

- Which color syntaxes must be supported?
- Should URL values support data URIs?

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

Received on Monday, 20 May 2019 03:36:43 UTC