With the fix for Bug 214765, in which expando properties are being preserved correctly for objects latched into the WebGL context, the similar layout test: webgl/2.0.0/conformance/context/user-defined-properties-on-context.html is still failing. In order to fix it, HTMLCanvasElements will have to keep the JavaScript wrapper for their context alive.
Also check the following layout test: webgl/2.0.0/resources/webgl_test_files/conformance/context/context-lost-restored.html which looks for expando properties on extensions, and which theoretically should already be passing.
Created attachment 406762 [details] Patch
ysuzuki@: could you please review this? I'm not sure this is completely correct. My first attempt put the HTMLCanvasElement::renderingContext() into the opaque root set, and that didn't work - JSHTMLCanvasElement::visitAdditionalChildren seemed to be called after the rendering context's isReachableFromOpaqueRoots.
Created attachment 406763 [details] Patch
Comment on attachment 406763 [details] Patch I understand how we are taking advantage of the test that’s already present for WebGL 2. But for the project, it would be better if we had test coverage for all three context types.
Comment on attachment 406763 [details] Patch r=me
Thanks darin@ and ysuzuki@ for your reviews. I'll add 2d and webgpu context expando tests. Note that HTMLCanvasElement.getContext("gpu") doesn't exist in the WebGPU spec any more, so I'll add a FIXME in that test about updating it once the implementation matches the spec.
Created attachment 406805 [details] Patch
Comment on attachment 406805 [details] Patch Added new tests in the latest patch. CQ'ing.
Committed r265833: <https://trac.webkit.org/changeset/265833> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406805 [details].
<rdar://problem/67352972>