WICG / canvas-formatted-text

Other
82 stars 17 forks source link

[IDEA] Support inline-block 'spacers' in the data model #41

Open travisleithead opened 2 years ago

travisleithead commented 2 years ago

In the Houdini layout API, the metrics infra will already need to handle inline-block content in the flow of inline text. Thus a representation of this kind of content will be needed for alignment of the output of format with what is already possible in HTML.

With that, it makes sense to provide inline-block 'spacers' as input to format so that similar in-flow content can be laid out, and later found-and-replaced with actual content, once the metrics are queried. I wouldn't expect the spacers to render anything (they would just reserve space in the flow and participate in wrapping as a whole).

Note: fragmentation of the spacer would need to be considered.

travisleithead commented 2 years ago

46 will wholly support this scenario; I don't believe we'll need a separate feature for inline-block spacers. :)

travisleithead commented 2 years ago

46 did not end up addressing this--it was decided not to add too much complexity to that PR, so this inline-block proposal still remains to be added to the spec.