Should I be able to piggyback custom properties on OffscreenCanvas objects transferred to a Worker?

RESOLVED INVALID

Status

()

P3
normal
RESOLVED INVALID
2 years ago
a year ago

People

(Reporter: jujjyl, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(firefox50 affected)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
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?
Flags: needinfo?(howareyou322)
Whiteboard: [gfx-noted]

Comment 2

2 years ago
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.
Flags: needinfo?(mtseng)
(Reporter)

Updated

a year ago
Blocks: 1390089
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.
(Reporter)

Comment 5

a year ago
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.