W3C home > Mailing lists > Public > www-svg@w3.org > March 2011

Re: Animating mixed units

From: Jérémie Patonnier <jeremie.patonnier@gmail.com>
Date: Thu, 31 Mar 2011 13:37:57 +0200
Message-Id: <90A82C37-4391-4953-AE04-DC4FE40F342A@gmail.com>
Cc: "www-svg@w3.org" <www-svg@w3.org>
To: "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>


Le 31 mars 2011 à 12:43, "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de> a écrit :

> Hello,
> 
> I think, there is no specific problem in the SVG recommendations.

Well, I'm not sure about that. When different viewers fail on a use case, that mean two things : they do not implement a specified behavior correctly OR the spec does not provide any information about it. For what I know (which is very few I admit it, do not hesitate to point me the relevant part of the spec) there is nothing clearly specified about animating form a fixed unit (pixel, inch, centimeters, etc) to a relative unit ( percentage, em, etc)

> I think, I can simulate what is specified without problems,

Ok, but what about things that are not specified?

> indeed I have
> created last year 15 test cases, available in my test suite.

Are they publicly available?

> 
> There are mainly two points:
> 1. It is obviously difficult to implement it right (this might require to 
> convert all values with units to local coordinates before animating it,
> concerning percentage, the conversion may change at any animation
> step - therefore more difficult to implement than units with always the
> same conversion factor).

Ok, but if it is so hard to implement, the spec should say explicitly to forbid such animation. If it's reasonably implementable, so the spec should explain how and when to do it to avoid inconsistent behaviors.

As an author, I'm less concern by the ability to perform such cross unit animations than by having a coherent behavior among viewers (authors suffer enough that kind of mess in the 90's with HTML, please, give the implementor the ability to give us something coherent)

> 2. The CSS2.1 draft introduces/suggests incompatible changes of the meaning
> of px and absolute units, this might cause problem. Those changes are
> not applicable for SVG, but some have implemented these changes
> anyway for SVG.

Agreed, but it's something required in a Web environment. When an author try to mix SVG and HTML in a HTML5 document, (s)he expect to have similar CSS behaviors regardless of SVG and HTML

> 
> For authors the conclusion is currently: 
> Don't even try it, the feature is broken.

That's my conclusion to, but now the question is : How could we fixe it ?
At first, I strongly suggest that at least the 0 value become a special value that do not require explicit unit declaration because there is no difference between 0, 0px, 0%, 0 whatever. (that the way CSS consider the 0 value)

> 
> In your case, calculate 100% in local coordinates manually and use this to
> avoid nonsense.

I was considering that option, but just setting my original r value to 0% works fine to ;)

> In your example, r="0" may introduce additional complications for some
> viewers, because r="0" has the specific rule not to display the circle at all.
> Not sure, if all viewers manage this switch at the begin of the animation -
> especially together with the unit complication.

All major browsers that implement animations deal with it nicely. They are my viewers main target. But I would be glad if people had input about that point on other viewers :)

Jérémie
----------------------------------
Web : http://jeremie.patonnier.net
Twitter : @JeremiePat
> 
Received on Thursday, 31 March 2011 11:38:17 GMT

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