[csswg-drafts] Discussion request: CSS usage in WICG's Formatted Text proposal (#6629)

travisleithead has just created a new issue for https://github.com/w3c/csswg-drafts:

== Discussion request: CSS usage in WICG's Formatted Text proposal ==
Hi CSS WG!

An incubation experiment ([canvas formatted text](https://github.com/WICG/canvas-formatted-text/)) is underway in WICG in which the thesis summary is: can we leverage the power of the CSS layout engine *for text line formatting* **outside of the DOM** to provide both 1) richer **text formatting** options for HTML Canvas rendering and 2) detailed line metrics? The solution aspires to integrate into other existing efforts like Houdini Layout API's treatment for inline boxes). A lot more background can be found in the [incubation's explainer](https://github.com/wicg/canvas-formatted-text#readme). Note, the CSS WG discussed an early version of this proposal [last July](https://github.com/w3c/css-houdini-drafts/issues/990#issuecomment-667190629) in https://github.com/w3c/css-houdini-drafts/issues/990, topic: "String based inline layout API".

A primitive JavaScript [data model](https://github.com/WICG/canvas-formatted-text/blob/main/explainer-datamodel.md) for holding text includes a mechanism similar to DOM Nodes for supplying CSS properties/values through a `StylePropertyMap`.

At this point in the incubation effort, we would like to validate and discuss the chosen approach to CSS usage with the CSS WG. 

Some questions we are thinking about:
* The proposed data model isn't specifically tied to HTML canvas. It doesn't necessarily need to follow typical Canvas conventions. We like leveraging the familiar CSS properties versus introducing a parallel set of new JS APIs that do basically the same thing.
* Only [a subset of CSS would be supported](https://github.com/WICG/canvas-formatted-text/blob/main/explainer-datamodel.md#supported-css-on-formattedtext-and-text-runs) (properties applicable to inline/text layout). Is there precedent for such a subset? What precedent might this be establishing for the future?
* We assumed `StylePropertyMap` is the preferred entry point for modern CSS-OM/ Typed OM. Should legacy `.style` object access be included?

Whether CSS syntax is ultimately used as the styling input mechanism or not, the specification of line formatting behavior is expected to conform to existing CSS norms, and refer to algorithms and definitions in CSS language specifications.

Thanks!

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6629 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 17 September 2021 00:52:03 UTC