Closed Bug 1799058 Opened 2 years ago Closed 1 year ago

Setting OffscreenCanvas's width or height must reset the 2D context

Categories

(Core :: Graphics: Canvas2D, defect, P2)

Firefox 108
defect

Tracking

()

VERIFIED FIXED
109 Branch
Tracking Status
firefox109 --- verified
firefox110 --- verified

People

(Reporter: tristan.fraipont, Assigned: tristan.fraipont)

Details

Attachments

(2 files)

Attached file test-case.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

Create a new 2D context from an OffscreenCanvas.
Set a property on this context, e.g its fillStyle, and draw on it.
Set either the width or the height of the OffscreenCanvas to the current value (+= 0).

Actual results:

The context isn't reset, the property isn't reset, the buffer isn't cleared.

Expected results:

Per specs,

If either the width or height attributes of an OffscreenCanvas object are set (to a new value or to the same value as before) and the OffscreenCanvas object's context mode is 2d, then reset the rendering context to its default state and [...
]
(emphasize mine).

The context must be reset, even when set "to the same value as before".

Andrew, could you please have a look?

Severity: -- → S3
Flags: needinfo?(aosmond)
Priority: -- → P2
Assignee: nobody → tristan.fraipont
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fd460d08d6ca
Reset context on SetWidth and SetHeight. r=jgilbert
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
QA Whiteboard: [qa-109b-p2]

Reproducible on a 2022-11-03 Nightly build on macOS 12 using the testcase from Comment 0.
Verified as fixed on Firefox 109.0b5(build ID: 20221220185745) and Nightly 110.0a1(build ID: 20221222094520) on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-109b-p2]
Flags: needinfo?(aosmond)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: