New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 700130 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 701490
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Task



Sign in to add a comment

Interoperability of getImageData with floating point parameters

Project Member Reported by zakerinasab@chromium.org, Mar 9 2017

Issue description

The HTML standard is not clear on how CanvasRenderingContext2D.getImageData should handle floating point parameters:

https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-getimagedata

This has led to different behavior of browsers when floating point parameters are passed to getImageData. Here is the number of pixels returned by each browser when the given set of parameters is passed to getImageData:

Parameters                   Chrome    Opera     Firefox     IE & Edge
(1, 1, 1, 1)                 1         1         1           1
(1.5, 1.5, 1, 1)             4         4         1           1
(1, 1, 1.5, 1)               2         2         1           2
(1, 1, 1.5, 1.5)             4         4         1           4 
(1.01, 1.01, 1.01, 1.01)     4         4         1           1
(1.5, 1.5, 1.5, 1.5)         4         4         1           1
(1.99, 1.99, 1.99, 1.99)     9         9         1           4 

Safari is not tested. The test script is attached.
 
getImageData-floatingPointParameters.html
808 bytes View Download

Comment 1 by fs...@chromium.org, Mar 9 2017

Safari 10:
1
4
2
4
4
4
9

Comment 2 by fs...@chromium.org, Mar 14 2017

Mergedinto: 701490
Status: Duplicate (was: Assigned)

Sign in to add a comment