<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18556</bug_id>
          
          <creation_ts>2012-08-14 12:36:48 +0000</creation_ts>
          <short_desc>2d.imageData.object.round.html has wrong expectations</short_desc>
          <delta_ts>2012-08-15 09:18:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>testsuite</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dominik Röttsches (drott)">dominik.rottsches</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>tmpsantos</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72160</commentid>
    <comment_count>0</comment_count>
    <who name="Dominik Röttsches (drott)">dominik.rottsches</who>
    <bug_when>2012-08-14 12:36:48 +0000</bug_when>
    <thetext>2d.imageData.object.round.html expects flooring for decimal values. AFAICS, this is not up to date any more. I conclude that there&apos;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&apos;s _Clamping_ semantics, not EnforceRange semantics. 

Looking at 
http://www.w3.org/TR/WebIDL/#Clamp , we read:
&quot;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.&quot;

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72161</commentid>
    <comment_count>1</comment_count>
    <who name="Dominik Röttsches (drott)">dominik.rottsches</who>
    <bug_when>2012-08-14 12:57:17 +0000</bug_when>
    <thetext>Actually, correction: The test assertions actually don&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>