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

[css3-transitions] Rounding behaviour

From: Brian Birtles <birtles@gmail.com>
Date: Fri, 03 Feb 2012 12:10:06 +0900
Message-ID: <4F2B500E.4010606@gmail.com>
To: www-style@w3.org
[Reposting, this time referring to the correct spec :)]

Dear all,

The SVG WG would like to align SVG animation features with CSS 
Transitions and CSS Animations where 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 Transitions use round for 
consistency with SVG 1.1 and SMIL 3.

Thank you!

Best regards,

Brian Birtles


[2] http://dev.w3.org/csswg/css3-transitions/#animation-of-property-types-
Received on Friday, 3 February 2012 03:10:37 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:35:04 UTC