New issue
Advanced search Search tips

Issue 791270 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Calling setAttribute on a canvas will reset its context.imageSmoothingEnabled to true

Reported by aaron.de...@gmail.com, Dec 2 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
Please find a test case here: https://codepen.io/AaronGeorge/pen/pdGNBj?editors=1111

What is the expected behavior?
context.imageSmoothingEnabled stays set at the value it was before setAttribute is called

What went wrong?
Calling setAttribute on a canvas will reset its context.imageSmoothingEnabled to true, even if it was set to false previously

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 62.0.3202.94  Channel: stable
OS Version: OS X 10.12.6
Flash Version:
 
Cc: mmanchala@chromium.org
Labels: Needs-Triage-M62 Needs-Feedback
Tested this issue on Mac-10.12.6 using chrome latest stable #62.0.3202.94, #50.0.2625.0 and on canary # 65.0.3284.0. Observed False and True output at Console

aaron.dean.george@ Could you please find the attachment and confirm if it is the issue you are facing?

Thanks..!!
791270.webm
969 KB View Download

Comment 2 by junov@chromium.org, Dec 4 2017

Status: WontFix (was: Unconfirmed)
This is working as intended.  Setting the width or height attributes (even resetting them to the same value as before) results in the entire 2d context state being reset. It also result in the canvas pixels getting cleared.  This is cross-browser compatible behavior and it is required by the specification.

For reference: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-set-bitmap-dimensions
@mmanchala yeah that's correct.

@junov, ohh okay. I wasn't aware that setting width or height will reset the context. Thanks for clarifying.

Sign in to add a comment