W3C home > Mailing lists > Public > www-style@w3.org > February 2012

[css3-animations] Rounding behaviour

From: Brian Birtles <birtles@gmail.com>
Date: Thu, 02 Feb 2012 12:49:45 +0900
Message-ID: <4F2A07D9.3070203@gmail.com>
To: www-style@w3.org
Dear all,

The SVG WG would like to align SVG Animation features with CSS 
Animations were possible.

One area where this is difficult is with regards to interpolating 
integer values.

SVG (referencing SMIL) defines such interpolation as happening in 
floating point space and then being rounded:

   The semantics of clamping values for attributes should be performed 
in floating point with a precision of at least that given by a 4-byte 
IEEE-format real number [IEEE-Arithmetic]. ... For integer attributes 
the computed value should then be rounded to the nearest integer 
(coerced-integer-value). The mathematical definition of rounding is:

   coerced-integer-value = Math.floor( interpolated-value + 0.5 )[1]

CSS on the other hand uses floor:

   The interpolation happens in real number space and is converted to an 
integer using floor().[2]

Is there a particular reason to prefer the floor behaviour over rounding?

If not, I would like to request that CSS Animations use round for 
consistency with SVG 1.1 and SMIL 3, both of which are W3C Recommendations.

Thank you!

Best regards,

Brian Birtles

[1] 
http://www.w3.org/TR/SMIL/smil-profile.html#SMILProfileNS-animation-module

[2] http://dev.w3.org/csswg/css3-transitions/#animation-of-property-types-
Received on Thursday, 2 February 2012 03:50:26 GMT

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