Re: Animating length values on gradients

Hi Doug.

Doug Schepers:
> Actually, in the case of percentages in the lexical space, there should
> always be a computed value in the value space, since there must be a
> percentage of some number, be it the viewport's dimensions or the bbox of an
> element. Therefore, the UA should interpolate between the computed values.

But that percentage→user unit value conversion can only be relevant for
each different element that references the linearGradient.  Since the
SVGLinearGradientElement interface has SVGAnimatedElement attributes on
it for the lengths that define the gradient space, there must be
single, interpolated values, independent of the referencing elements,
that will be stored as the current animated values.

For example:

  <svg width="1000" height="1000">
    <linearGradient id="g" gradientUnits="userSpaceOnUse">
      <animate attributeName="x1" begin="0s" dur="5s" from="50%" to="150"/>
    </linearGradient>

    <rect id="r1" width="100" height=”100" fill="url(#g)"/>

    <svg width="200" height="200">
      <rect id="r2" width="100" height=”100" fill="url(#g)"/>
    </svg>
  </svg>

The gradient is referenced from two coordinate systems: the outer 'svg'
element, where percentages are proportions of 1000, and the inner 'svg'
element, where percentages are proportions of 200.  If the value of

  document.getElementById("g").x1.animVal.value

were queried at 1s, what value would it have?

-- 
Cameron McCormack, http://mcc.id.au/
 xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

Received on Monday, 19 June 2006 12:36:18 UTC