Re: Promoting more SVG attributes into properties

On Wed, Jan 23, 2013 at 10:54 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> The CSSWG today resolved to allow more SVG attributes into CSS
> properties, as requested by the SVGWG.  Starting from the list at
> <
> http://dev.w3.org/SVG/proposals/css-animation/animation-proposal.html#def_attributes
> >,
> we removed all the attributes that only have meaning within filters,
> and agreed to add the rest.
>
> This leaves us with the following list of attributes being promoted to
> properties:
>
> cx, cy, dx, dy, fx, fy, height, width, offset, r, rx, ry, x, x1, x2,
> y, y1, y2 and maybe d
>
> (d is a harder one - I *really* want it, but the syntax isn't
> compatible with CSS right now, and would require a reparse step to
> make it meaningful - for example, the valid path string "M0,0h1v1h1v1"
> produces three tokens in the CSS parser - IDENT(M0) COMMA DIMENSION(0,
> h1v1h1v1).  Are we interested in pursuing a more CSS-compatible syntax
> for path data?  Please say yes - I *really* want to be able to use
> units in path data, as I was *just* working on something made harder
> and uglier by that lack.)
>

I'm unsure if we should promote "d" to CSS.
"d" is certainly the content of the path. It would be as if you allow
styling 'src' on the html image or content of a <p>.

Maybe animating the path should be done with a scheme that allows any
content to change.


>
> We accepted them as-is, without any name changes.  As these are
> properties, they parse with the usual CSS rules, which means no
> unitless lengths.
>
> The only issue is still that of collisions between attributes with the
> same name but different values, such as "x" on <rect> and <text>.  We
> can't reject mismatches at parse-time, like we usually do, because you
> can't tell whether it's wrong until you try to apply it.  There are a
> few ways to resolve this:
>
> 1. If the wrong syntax is used on a given element, treat it like an
> invalid variables, and just use the initial value for the property.
>
> 2. Restrict the property to a single syntax that works on both
> instances.  For example, for the 'x' property, only allow a single
> length.  If you want to specify multiple lengths for a <text> element,
> you need to use the attribute form.
>
> I'm ambivalent on which solution to use.  If the WG has opinions, or a
> third option, let us know!
>
> ~TJ
>
>

Received on Thursday, 24 January 2013 17:34:40 UTC