Closed Bug 494744 Opened 11 years ago Closed 9 years ago

Incorrect canvas test - getImageData() with negative dimensions

Categories

(Core :: Canvas: 2D, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: wesongathedeveloper, Assigned: Ms2ger)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1pre) Gecko/20090524 Shiretoko/3.5pre
Build Identifier: 

The file /content/canvas/test/test_2d.imageData.get.source.negative.html has errors in it.

1. Lines 30-33 look like:

ok(imgdata1.data[imgdata1.length-4+0] === 255, "imgda...
ok(imgdata1.data[imgdata1.length-4+1] === 255, "imgda...
ok(imgdata1.data[imgdata1.length-4+2] === 255, "imgda...
ok(imgdata1.data[imgdata1.length-4+3] === 255, "imgda...

instead of (referencing the 'length' attr of the 'data' member of the imgdata1 object):

ok(imgdata1.data[imgdata1.data.length-4+0] === 255, "imgda...
ok(imgdata1.data[imgdata1.data.length-4+1] === 255, "imgda...
ok(imgdata1.data[imgdata1.data.length-4+2] === 255, "imgda...
ok(imgdata1.data[imgdata1.data.length-4+3] === 255, "imgda...

2. The test is related to functionality that has not yet been implemented - (see https://bugzilla.mozilla.org/show_bug.cgi?id=392751). Nonetheless, I am working on the aforementioned bug and find that the logic in this test seems to be incorrect. The pixel at 85,25 should actually be the lower right pixel of the region to be returned by the getImageData() call because the dimensions specified are negative. Consequently, the next 8 tests after the call should be verifying that the first 4 array elements represent the (white) top left pixel and that the last 4 array elements represent the (black) bottom right pixel (and not vice versa as is currently the case)

Reproducible: Always
Bugs against tests go in the component for the relevant code.
Component: General → DOM: Other
OS: Windows XP → All
Product: Testing → Core
QA Contact: general → general
Hardware: x86 → All
Component: DOM: Other → Layout: Canvas
QA Contact: general → layout.canvas
Attached patch Patch v1Splinter Review
Assignee: nobody → Ms2ger
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #516890 - Flags: review?(roc)
Blocks: 630052
Thanks.
Depends on: post2.0
Whiteboard: [needs landing]
Version: unspecified → Trunk
Keywords: checkin-needed
Whiteboard: [needs landing]
http://hg.mozilla.org/mozilla-central/rev/02b10719b050
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
No longer depends on: post2.0
Resolution: --- → FIXED
Whiteboard: fixed-in-cedar
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.