This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18556 - 2d.imageData.object.round.html has wrong expectations
Summary: 2d.imageData.object.round.html has wrong expectations
Status: NEW
Alias: None
Product: HTML WG
Classification: Unclassified
Component: testsuite (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-14 12:36 UTC by Dominik Röttsches (drott)
Modified: 2012-08-15 09:18 UTC (History)
4 users (show)

See Also:


Attachments

Description Dominik Röttsches (drott) 2012-08-14 12:36:48 UTC
2d.imageData.object.round.html expects flooring for decimal values. AFAICS, this is not up to date any more. I conclude that there's the following chain:

ctx.getImageData() returns an ImageData object whose data property is of type Uint8ClampedArray. According to:
http://www.khronos.org/registry/typedarray/specs/latest/#7.1
Uint8ClampedArray uses WebIDL's _Clamping_ semantics, not EnforceRange semantics. 

Looking at 
http://www.w3.org/TR/WebIDL/#Clamp , we read:
"See the rules for converting ECMAScript values to the various IDL integer types in section 4.2 for the specific requirements that the use of [Clamp] entails."

which then redirects to 4.2.5.3 (the Clamp case, not the EnforceRange) case:
http://www.w3.org/TR/WebIDL/#es-octet
which mandates rounding, not flooring.

Hence, the expectations in the patch should be changed to nearest values, not floored values.
Comment 1 Dominik Röttsches (drott) 2012-08-14 12:57:17 UTC
Actually, correction: The test assertions actually don't expect flooring any more, they expect rounding, plus choosing the even integer when exactly in the middle (i.e. +0.5). But the description still needs to be updated and should contain newer spec references.