Lurker News
For the last 5 years I've been working on a layout engine that targets CSS2 and some more modern properties.

Live demo: https://chearon.github.io/dropflow/
It matches browsers in all cases I can find where they agree, and it's fast. It supports `position`, `inline-block`, `z-index`, and complex properties like `float` and `vertical-align`. It doesn't support high-level layout like flexbox or grid yet, but you can get intrinsics to easily divide space yourself and paint multiple layout trees. It has a great text layout implementation, and supporting non-Latin scripts is a top priority.
I've wanted this to exist as far back as 2013, and the desire kept coming up: for a way to get detailed intrinsics, for high quality rich text layout to canvas and SVG, and for server-side rich text. We currently use it in CellEngine for our new canvas-based spreadsheet library to layout text in hundreds of thousands of cells, and will be using it soon to render PDFs with thousands of pages in a few seconds.

Comments (137) 39 threads

Earlier comments
YorickPeterse#
How suitable would this be for a text editor of sorts, and what latency would one expect? Using the demo it's difficult to gauge the latency by just eyeballing it.
justhw#
This looks great. I've been using html2canvas but it doesn't support the 'filter' property yet. This will be an awesome alternative.
joelanman#
this wouldn't be accessible would it? For example to screen readers, so just wondering what the use case is over accessible tech
jasonjmcghee1 reply#
Are you planning to add support for the missing standard tags like img and table (both very useful for pdf rendering)?
chearon#
Yes, definitely. In the meantime, you can still use this to get the intrinsic sizes of cells to create rows and columns, and you can use an empty inline-block and paint the image where it's laid out. I'll put something in the examples/ directory soon.

Load more comments