I created a lib to work with HTML 5 Canvas. I was able to make it work from Salesforce and everything was working well, but when I tried to pan and zoom, I discovered the method getTransform(), from 2D Context, was not available. I think Salesforce used a polifyl in the Canvas 2D Ctx and removed it, or did not added it, because the setTransform() is available. Moreover, the method is supported by Chrome
Also, the lib works fine when running outside of Salesforce, like in Netlify. Inside Salesforce for some reason the only thing I can't do is getting the Transform of the canvas.
The image below shows that the getTransform() is not available in the context 2D.

The image below shows that the setTransform() is available in the context 2D.

Another weird thing is that when it reaches the line that uses getTransform(), it does not throw any exception, nor warning message. And then after clicking on the next step, on the browser debugger, it goes to this place:

Add a canvas to a LWC, like this:
<canvas lwc:dom="manual"></canvas>
Then use this to get the canvas element
const canvas = this.template.querySelector('canvas');
Then use this to get the canvas 2D Context:
let ctx = canvas.getContext('2d');
Then verify that getTransform() is not available.
Browser: Chrome 84.0.4147.89
Seems like a Locker issue, @manuel-jasso are you aware of this?
Thanks @diervo we will take a look and see if this falls under Locker.
FYI @seksenov @animmakayala
This seems to be a Locker issue, tracking internally with W-7893940
FYI @animmakayala @seksenov @diervo @salesforce/ui-security
@AllanOricil what is your priority? For us to prioritize internally.
@AllanOricil what is your priority? For us to prioritize internally.
Hi @manuel-jasso it is not high priority. Im still developing the possible product and I haven't decided if I will make it available in the salesforce store or host it externally. I was just doing a POC inside Salesforce and found that problem. But it would be good if you could keep me updated about when your team is planning to fix it.
Thank you for your help.
@manuel-jasso could you also verify if the Webgl API is fully supported by salesforce? I'm studying about migrating my lib from canvas to webgl to get better performance.
@AllanOricil In regards to WebGL, we support the following interfaces, but it doesn't seem to be all of them (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API#Reference), let us know if you need to use one of the missing ones.
WebGLBuffer
WebGLContextEvent
WebGLFramebuffer
WebGLProgram
WebGLRenderbuffer
WebGLRenderingContext
WebGLShader
WebGLShaderPrecisionFormat
WebGLTexture
WebGLUniformLocation
@AllanOricil In regards to WebGL, we support the following interfaces, but it doesn't seem to be all of them (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API#Reference), let us know if you need to use one of the missing ones.
WebGLBuffer WebGLContextEvent WebGLFramebuffer WebGLProgram WebGLRenderbuffer WebGLRenderingContext WebGLShader WebGLShaderPrecisionFormat WebGLTexture WebGLUniformLocation
I made some good performance improvements yesterday with Canvas. I might stay with it for now. Tell me when I can test again my app inside Salesforce. Thanks @manuel-jasso
@AllanOricil Hey Allan! The property has been added and will be available for 230. Let me know if you have other questions. Thank you.
@AllanOricil Hey Allan! The property has been added and will be available for 230. Let me know if you have other questions. Thank you.
Cool. Thank you @arcadeteddy and @manuel-jasso for adding this. When will 230 be available?
@AllanOricil Our 230 release is "Spring 21" (i.e. Feb/2021). This is our normal release process, but if this is a high priority, let us know.
@AllanOricil Our 230 release is "Spring 21" (i.e. Feb/2021). This is our normal release process, but if this is a high priority, let us know.
Thanks @manuel-jasso
Could you help me to find somebody from Salesforce that would be able to help me to get an ISV Partner org? I tried to register by myselft but it requires a "company" email and I don't have one available.