W3C home > Mailing lists > Public > www-svg@w3.org > January 2013

Re: Promoting more SVG attributes into properties

From: Rik Cabanier <cabanier@gmail.com>
Date: Thu, 24 Jan 2013 09:34:12 -0800
Message-ID: <CAGN7qDCdON2H7ZeR0jWnvv-wAB5FKs5fVyusgo6hF0Q9zvTy2w@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-svg <www-svg@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:54 GMT