[Bug 10930] New: CanvasPixelArray out of range behavior needs clarification

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10930

           Summary: CanvasPixelArray out of range behavior needs
                    clarification
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML Canvas 2D Context (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: jmann@microsoft.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


The spec is clear that the CanvasPixelArray contains image data in the range of
0..255, representing the 8 bit value for that component. However, the spec is
not clear on what the expected behavior should be when a value greater or less
than the range of 0..255 is assigned to the array.

The spec should be updated to include the following text:

"When a CanvasPixelArray object is indexed to modify an indexed property index,
with value value, the value of the component occupying the position index, in
the array must be set to value. If value is less than 0, it must be clamped to
zero. If value is more than 255, it must be clamped to 255."

Firefox, Chrome and Safari follow the behavior described in the proposed text.
This behavior is more inline with a previous version of the spec.

Rounding to the limits of 0 or 255 when out of range seems to be more logical
to a web developer than wrapping the value. 

http://lists.w3.org/Archives/Public/public-canvas-api/2010AprJun/0001.html

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 1 October 2010 01:09:25 UTC