Created attachment 8764715 [details] worker_attribute_test.html With the pref gfx.offscreencanvas.enabled = true in Nightly, run the attached html page. That will print the following in console: in main thread: canvas.id: mycustomid inside worker: canvas.id: undefined Is this expected behavior that the id field dies, or should it be possible to pass custom properties as part of an OffscreenCanvas object when transferring it to a Worker?
:pchang, can you answer for forward the question?
Morris, any idea for this?
Flags: needinfo?(howareyou322) → needinfo?(mtseng)
Currently in our implementation, we don't transfer custom properties since custom properties may not transferable.
Priority: -- → P3
In the spec, the shallow serialization algorithms used for transferring platform objects don't serialize custom properties. For each type of platform object that is transferable, the spec defines the necessary transfer algorithms. The "transfer steps" and transfer-receiving steps" for OffscreenCanvas are defined here: https://html.spec.whatwg.org/multipage/canvas.html#offscreencanvas Those steps do not transfer custom properties.
Thanks for confirming Justin, much appreciated!
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.