w3c / svgwg

SVG Working Group specifications
Other
699 stars 132 forks source link

[svg-native] Some useful style properties do not have corresponding style attributes #679

Open BigBadaboom opened 5 years ago

BigBadaboom commented 5 years ago

(This issue broken out of #658 per request of @dirkschulze )

The current SVG Static spec has removed CSS and the style attribute. However there are some useful properties that don't exist as style attributes.

For example:

There may be others I haven't thought of.

litherum commented 5 years ago

I'm not sure we want non-scaling-stroke. It's not in SVG 1.1, and so isn't included in the draft right now.

I'm also not sure if any existing SVG Native implementation supports shape-rendering. If no implementation supports it, that's a fairly strong signal that it isn't necessary (at least for now).

AmeliaBR commented 5 years ago

Both of the properties mentioned above are available as presentation attributes in SVG 2, so that alone shouldn't be a deciding factor on whether to include them in SVG Native.

shape-rendering can be useful for drawing small icons (or font glyphs?) in environments where aliasing is an issue, and is very important for line drawings. Can we be more specific about which graphics libraries do or don't support controlling aliasing on a shape-by-shape level?

vector-effect is also very useful, but is even more complicated to implement. If the goal of SVG Native is to represent simple vector graphics that scale up & down uniformly (other than resolution adjustments) then it makes sense to disallow it. (Although there are probably other restrictions still required to make that really true.)

dirkschulze commented 5 years ago

shape-rendering is seen as an optimization hint for user agents. IMO it would not be a harm to add it but IIRC it makes no visual difference on any browser implementation today. So in reality it might not be useful.

Agree with @AmeliaBR on vector-effect.

AmeliaBR commented 5 years ago

it makes no visual difference on any browser implementation today

*Every** major browser implementation does change rendering for shape-rendering: crispEdges.

Demo: http://oreillymedia.github.io/SVG_Colors_Patterns_Gradients/ch02-paintBasics-files/shape-rendering.svg

* Correction: except EdgeHTML. But that's soon not to be a major browser implementation.

dirkschulze commented 5 years ago

Thanks @AmeliaBR! I probably mixed it up.

shape-rendering still is a rendering hint. I could imagine that implementations do want to have a consistent appearance. Especially for use cases like fonts or application icons. So unsure if it would actually be implemented at all. However, no objection from my side.