This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
2d.imageData.object.round should test for "Round x to the nearest integer, choosing the even integer if it lies halfway between two." as changed in <http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.html.diff?r1=1.393;r2=1.394;f=h>
http://dvcs.w3.org/hg/html/rev/1d201654fce1 Please review.
As defined in latest spec (Editor's Draft 29 February 2012) at http://dev.w3.org/html5/2dcontext/#imagedata, the data of imagedata is initialized to a Uint8ClampedArray object which maps to a octet type in Web IDL. According to the mapping rule defined at http://dev.w3.org/2006/webapi/WebIDL/#es-octet, an attribute annotated with the [Clamp] extended attribute should handle as follows: 1. Round x to the nearest integer, choosing the even integer if it lies halfway between two. 2. Set x to min(max(x, 0), 2^8 − 1). 3. Return the IDL octet value that represents the same numeric value as x. e.g. 0.499 -> 0 0.5 -> 0 0.501 -> 1 1.499 -> 1 1.5 -> 2 1.501 -> 2 2.5 -> 2 3.5 -> 4 252.5 -> 252 253.5 -> 254 254.5 -> 254 256.5 -> 255 -0.5 -> 0 -1.5 -> 0 So this test should be updated.
Thanks, I've updated the approved version. http://dvcs.w3.org/hg/html/rev/c3f2f7da0bfb