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-2] Need an array-buffer custom property type. #136

shans opened this Issue Mar 11, 2016 · 1 comment


None yet
2 participants
Copy link

shans commented Mar 11, 2016

No description provided.


This comment has been minimized.

Copy link

tabatkins commented Mar 14, 2016

To elaborate: previously we thought we might add a "worklet cache" that was some global dict of structured-clonable values, and worklets could list keys from the cache that they depend on and get updated on change, just like they can with custom properties. It was intended that you use this for things like images, fonts, etc.

In general, this doesn't offer anything that just using a custom property does - just set the custom prop on the root element, give it the value you want, and make your worklet depend on that prop. Custom props are better in some ways, too, as they're not required to be global - you can change the value being passed in for different subtrees if necessary.

The cache did have the advantage that it fairly naturally supported various types of binary data, like images. But we're adding image and font objects to the Typed OM, and they're allowed in the custom property grammar, so you can just pipe those through that way. One big unfilled hole is arbitrary binary data, like a big list of vertexes you want to use in a PaintWorklet. The cache object could just take an ArrayBuffer, but you can't put that into a custom prop right now.

So, we need to introduce some Typed OM value that wraps an array buffer. This is intended to be set and read via the Typed OM, so it doesn't necessarily need a serialization, but it might be nice to provide such - I suggest an arraybuffer() function that takes the type of the buffer, and a base-64-encoded string for the data.

@shans shans changed the title Need an array-buffer custom property type. [css-typed-om-2] Need an array-buffer custom property type. Apr 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment