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

Re: Animating mixed units

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Thu, 31 Mar 2011 13:27:09 +0100
To: Jérémie Patonnier <jeremie.patonnier@gmail.com>, www-svg@w3.org
Message-Id: <201103311427.09674.Dr.O.Hoffmann@gmx.de>
Jérémie Patonnier :
> 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)

SVG specifies, how the units for length for example are related to
local units. Which lengths are represented by the units is defined in
CSS2.0, SVG is referencing to.
And SVG specifies, how percentages have to be interpreted.
What do you need more? There is nothing specific about animation here,
except that is is diffi

Currently implementations still fail quite often.
Obviously, if the feature is complex, the risk is even higher to fail ;o)
It takes some years to get a meaningful implementation of such a huge
task than SVG. And sometimes there is a stagnation on an intermediate
level (as currently for Opera for example). Several others currently 
improve fast on a low level. There is still a long way for all of them to 
get 'it' right ;o)

> > I think, I can simulate what is specified without problems,
> Ok, but what about things that are not specified?

Then I do not simulate, I ask in this list, if it comes to my attention.
Sometimes it is added to a draft, that a feature is explictly undefined,
if there is no agreement on how it should be defined. Then at least
authors know, that they should not use such a feature combination,
if they need predictable behaviour.

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

See the other reply.

> > 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.

This happened already for SVG tiny, there this is restricted on width
and height of the svg element.
Typically this approach is desireable for all profile. As far as you can
avoid it, do not use units within the inner part of the SVG file.
Percentages can be a useful exception of course, then it is typically
helpful not to mix it with other units to work around bugs in viewers.
There is a lower risk of a bug, if always the same unit is used.

> 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)

Hmmm yes, as authors we have to suffer a lot, after HTML there was
the same for many years for CSS. Very frustrating indeed.
But we cannot force anybody to write programs without bugs and
with a complete implementation of a specification. 
Of course, we can force many people with enough money to
do it right - but who wants to spend so much money to get
everything right in one implementation within maybe one or
two years? ;o)

Apart from spending money, authors can mainly write tests 
and report bugs. However my experience is, that 
a) Many tests are ignored anyway for different reasons. 
b) It can take years, until reported bugs are fixed, sometimes
the reports are ignored completely
c) Programmers try to be more clever than they are and try to 
optimise their code, resulting sometimes in pessimisations and

> 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)

SVG references only the CSS rules, this happened already.
What happens in similar situations with viewers, that interprete already
the CSS animation/transition draft? Do they have similar problems?
I think, the drafts do not have specific rules about this either, therefore
the same complexity applies for CSS.

Received on Thursday, 31 March 2011 12:27:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:24 UTC