Re: [css-houdini-drafts] [css-typed-om] CSSFontFace value (#899)

So, to clarify, the proposal is:

1. Add a new TypedOM type for `font`.
2. Change the [`CanvasText` `font` property](https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-font) to accept this type object as an alternative to a string.
3. Implement the `CanvasText` interface in paint worklets, but throw an error if the `font` property is set to anything other than this special font object.

(1) seems like it's something that will probably happen anyway. It's a little complicated because `font` is a shorthand that also has single-keyword values that override all the longhands. But I'm sure @TabAtkins has a long-term vague plan for how to make it work.

Once (1) happens, (2) makes sense, as part of a general approach to get Canvas APIs to accept TypedOM values as alternatives to strings that are going to get parsed as CSS values.

(3) is the question. Are there other reasons that text in worklets interferes with isolation & optimization? Does it make sense to restrict it to one TypedOM value that is passed in? What about constructing a `CSSFontValue` (or whatever it is called) in the worklet: which part would error out?

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/899#issuecomment-499908542 using your GitHub account

Received on Friday, 7 June 2019 14:33:33 UTC