W3C home > Mailing lists > Public > www-style@w3.org > November 2011

Re: [css3-transitions] interpolation between value types

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 8 Nov 2011 14:54:19 -0800
To: Jennifer Yu <Jennifer.Yu@microsoft.com>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <20111108225419.GA11664@pickering.dbaron.org>
On Tuesday 2011-11-08 22:37 +0000, Jennifer Yu wrote:
> While
> http://dev.w3.org/csswg/css3-transitions/#animation-of-property-types-
> describes how each property type undergoes a transition, it
> doesn't define how interpolation should occur between value types.
> eg. between a percentage and a length.

In the general case, it's not possible to interpolate between
arbitrary value types.  In such cases, there's no
transition/animation.

In the particular case of lengths and percentages (for most
properties), and maybe in the future for some other cases, I think
interpolation can use calc().  This is what I've implemented in
Gecko.  For example, 25% of the way from 50% to 200px is calc(0.75
* 50% + 0.25 * 200px).

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Tuesday, 8 November 2011 22:54:52 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT