Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-typed-om] structuredClone for typed-om objects #1101

Open
DevSDK opened this issue Jul 9, 2023 · 0 comments · May be fixed by #1102
Open

[css-typed-om] structuredClone for typed-om objects #1101

DevSDK opened this issue Jul 9, 2023 · 0 comments · May be fixed by #1102

Comments

@DevSDK
Copy link
Contributor

DevSDK commented Jul 9, 2023

"structuredClone can’t deal with CSSUnitValue objects" issue is filed on crbug [1].

Currently, the css-typed-om spec[2] does not mark the [Serializable] attribute for typed-om objects.
Consequently, these objects are not contained in the platform objects that can be serializable according to the HTML spec [3].

So the browsers comply with that spec that throws an exception.
However, the following codes look very natural:

Given this, browsers appropriately throw an exception to comply with the spec.
However, consider the following code:

structuredClone(CSS.px(2))

This looks quite intuitive and straightforward.

If there is no extra context that I missed, could we consider supporting it?

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=1444708&q=is%3Astarred&can=2
[2] https://www.w3.org/TR/css-typed-om-1/#cssunitvalue
[3] https://html.spec.whatwg.org/multipage/structured-data.html#serializable-objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant