On 2014/12/11 19:18, Aleksei Semenov wrote:
Hi, everyone.
Please, consider the following example:
var keyframes = [
{top: '10%'},
{top: '20%'},
{top: '50%'}
];
var effect = new KeyframeEffect(keyframes, 'paced(top)');
effect.getFrames(); // value of computedOffset in returned frames?
To calculate computedOffset spacing keyframes procedure needs to calculate
distance between values of paced property. Distance computation for
percentage values
is specified here
http://w3c.github.io/web-animations/#animatable-as-length-percentage-or-calc-section
distance computation: as with animatable as real number but using the
used value [CSS21] for Vstart and Vend.
Used value definition http://www.w3.org/TR/CSS2/cascade.html#used-value
Computed values are processed as far as possible without formatting
the document.Some values, however, can only be determined when the
document is being laid out.For example, if the width of an element is
set to be a certain percentage of itscontaining block, the width
cannot be determined until the width of the containingblock has been
determined. The used value is the result of taking the computedvalue
and resolving any remaining dependencies into an absolute value.
Since the actual element and its container are not available, the "used
value" can not be determined here.
So the distance and computed offset also can not be calculated.
Hi Aleksei,
Thanks for reporting this.
We discussed this last December.[1] I've now updated the spec to address
this.[2] I hope this resolves the issue.
Best regards,
Brian
[1] https://lists.w3.org/Archives/Public/public-fx/2014OctDec/0126.html,
item 4
[2]
https://github.com/w3c/web-animations/commit/6b85b490a41b142b282df0c2e2f2b990cea470c3