W3C home > Mailing lists > Public > www-svg@w3.org > June 2017

Re: animateTransform has no default value for 'type'

From: Domenico Strazzullo <strazzullo.domenico@gmail.com>
Date: Tue, 6 Jun 2017 18:57:29 +0200
Message-ID: <CABgXer3urJprsX3NmtX3v=dKpOciW7Jiomq0PB=1yV_-Y1TgDA@mail.gmail.com>
To: Johannes Schoenke <johannes.schoenke@gmail.com>
Cc: www-svg <www-svg@w3.org>
No way to do what, two different animations on two different elements with
the same animation code? It’s not SMIL or CSS that do the animation. You
define the animations using either the declarative approach of SMIL or the
functional one of CSS. You can use CSS if you think it allows much more
concise code.

On the other end, do I have the impression you are bringing forward an
argument (which you don’t demonstrate) for the undermining of SMIL?

On Tue, Jun 6, 2017 at 4:24 PM, Johannes Schoenke <
johannes.schoenke@gmail.com> wrote:

> 2) So I guess that in an SVG 2.0 standard there would still be no way to
> do this because it is still SMIL?
> In this case I think it might be better to let CSS do the animation
> because it allows for a much more concise code.
>
>
> On Jun 1, 2017, at 1:57, Domenico Strazzullo <
> strazzullo.domenico@gmail.com> wrote:
>
> 1) Basically we have Firefox with the correct implementation versus the
> webkit with the wrong one.
>
> 2) OK, but <animateTransform> being a SMIL animation element (hosted by
> SVG) is unique and cannot be re<use>d with different values.
>
> On Wed, May 31, 2017 at 5:07 PM, Johannes Schoenke <
> johannes.schoenke@gmail.com> wrote:
>
>> 1) I’m sorry, Firefox was the one I didn’t test. It appears like the
>> default value is not implemented in Chrome, Opera, and Safari (IE/Edge I
>> have no idea and honestly don’t care). That’s sad.
>>
>> 2) That was not what I meant. Maybe I didn’t explain precisely enough.
>> I'll give an example:
>> I want this
>>
>> <path d='M1 1 1 2 2 2 2 1Z'>
>>   <animateTransform attributeName='transform' type='translate' dur='7s'
>> repeatCount='indefinite' values='0,0;1,0;1,1;0,1;0,0'/>
>> </path>
>> <path d='M2 2 2 3 3 3 3 2Z'>
>>   <animateTransform attributeName='transform' type='translate' dur='7s'
>> repeatCount='indefinite' values='0,0;-1,0;-1,-1;0,-1;0,0'/>
>> </path>
>>
>> to be expressible as this
>>
>> <g>
>>   <animateTransform attributeName='transform' type='translate' dur='7s'
>> repeatCount='indefinite'/>
>>
>>   <path d='M1 1 1 2 2 2 2 1Z'>
>>     <animateTransform values='0,0;1,0;1,1;0,1;0,0'/>
>>   </path>
>>   <path d='M2 2 2 3 3 3 3 2Z'>
>>     <animateTransform values='0,0;-1,0;-1,-1;0,-1;0,0'/>
>>   </path>
>> </g>
>>
>> So all the animation attributes which are identical for both <paths> I
>> just want to have to write once.
>>
>>
>> Hannes
>>
>>
>> On May 31, 2017, at 22:51, Domenico Strazzullo <
>> strazzullo.domenico@gmail.com> wrote:
>>
>> 1) The 'type' attribute of 'animateTransform' does have the default value
>> of 'translate', since the specification says so. Firefox implements
>> correctly and executes a translation if 'type' is not specified (lines 9
>> and 15 in the example below). Chrome doesn’t. You can report the bug with
>> Chrome, but I'm not sure if they care any longer.
>>
>>
>> 2) Animations for a group of different objects (including nested groups)
>> ARE definable for the group:
>>
>>
>> <g>
>>
>>   <set attributeName="visibility" to="hidden" begin="20s"/>
>>
>>   <animateTransform attributeName="transform" type="skewX" from="90"
>> to="0" begin="0s" dur="5s"/>
>>
>>   <g>
>>
>>   <animateTransform attributeName="transform" type="skewY" from="-45"
>> to="0" begin="0s" dur="5s"/>
>>
>>   <g id="tubes">
>>
>> <animateTransform attributeName="transform" type="scale" from="0" to="1"
>> begin="0s" dur="5s" fill="freeze"/>
>>
>>   <g id="hor1">
>>
>> <animateTransform attributeName="transform" from="150 750" to="150 150"
>> begin="0s" dur="5s" fill="freeze"/>
>>
>> <use xlink:href="#left_cap"/>
>>
>> <use xlink:href="#right_cap" transform="translate(360 0)"/>
>>
>> <use id="t1" transform="scale(3.6 1)" xlink:href="#h_tube"/>
>>
>> </g>
>>
>> <g id="vert1">
>>
>> <animateTransform attributeName="transform" from="74 574" to="474 174"
>> begin="0s" dur="5s" fill="freeze"/>
>>
>> <use xlink:href="#top_cap"/>
>>
>> <use xlink:href="#bottom_cap" transform="translate(0 125)"/>
>>
>> <use transform="scale(1 1.25)" xlink:href="#v_tube"/>
>>
>> </g>
>>
>>         ...
>>
>> </g>
>>
>>
>> It is wise before making a suggestion literally, to ask or double-check,
>> because if nobody replies then other readers might see it as a valid
>> suggestion. Some changes to the spec in the past were introduced out of
>> confusional debating where there was no need, without proper auditing.
>>
>>
>>
>> Domenico Strazzullo
>>
>>
>>
>> On Mon, May 29, 2017 at 4:17 PM, Johannes Schoenke <
>> johannes.schoenke@gmail.com> wrote:
>>
>>> I could not find anything about this in the mailing list, so I thought a
>>> share.
>>>
>>> In the SVG 1.1 standard section 19.2.16, right at the beginning of
>>> ‘Attribute definitions’ it says about the ‘type’ attribute:
>>>
>>> ‘… . If the attribute [type] is not specified, then the effect is as if
>>> a value of 'translate' were specified.’
>>>
>>> This is not true.
>>> If ‘type’ is not specified, nothing gets animated.
>>> So it seems like ‘type’ has no default value.
>>>
>>> Hope this helps.
>>>
>>> Best wishes,
>>> Hannes
>>>
>>>
>>> P.S.: Suggestion for the next standard:
>>> For ‘animateTransform’ and all related animation tags attributes like
>>> for example
>>>
>>> attributeName='transform' type='translate' fill='freeze' dur=‘4s’ …
>>>
>>> Should be definable for a group of different objects/animations. At the
>>> moment one has to write them for every single animation tag. Many animated
>>> SVG files would probably be half the size with this feature!
>>>
>>> <https://www.w3.org/TR/SVG/Overview.html>
>>>
>>
>>
>>
>
>
Received on Tuesday, 6 June 2017 16:58:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:55:09 UTC