Show HN: Dropflow, a CSS layout engine for node or <canvas>
Overall reaction & scope
- Many consider Dropflow an impressive feat: essentially a standalone CSS layout engine that can target Node or
<canvas>. - Seen as filling a gap between “no engine” and “full browser” for server-side rendering, graphics, and custom UIs.
- Some see it as “reinventing a browser inside a browser”; others argue there is room for focused, lighter engines.
Implementation complexity & specs
- Implementing CSS layout, especially text, is described as very hard:
- Complexities include glyph shaping, RTL text, line breaking, and underlines.
- Knowledge is considered obscure; much was reverse‑engineered from existing engines and specs.
- CSS2 is praised as a solid, coherent foundation; CSS3 builds on it.
- Line wrapping in browsers is described as a greedy algorithm at breakpoints; float precision vs integer math is a practical concern.
Features, gaps, and related engines
- Dropflow currently focuses on CSS2‑style block/inline layout, not flexbox or grid.
- Some see lack of flexbox as a major limitation; others note that many document-like layouts don’t need it.
- Plans mentioned: pagination /
@page, tables, images, better PDF examples. - Other engines and tools referenced for comparison: Yoga (flexbox only), Taffy (flex+grid), litehtml, WebKit.js, Sciter, Satori, dom‑to‑image, html2canvas, PDF libraries, and commercial HTML‑to‑PDF engines.
Use cases
- Server-side HTML/CSS → image or PDF generation without running a full browser.
- Backends generating Open Graph images, charts, or node‑canvas graphics.
- Potential foundation for rich text editors or in‑canvas / WebGL UI, avoiding
contenteditable. - Possible role in desktop-style or native-like UI frameworks.
Performance and rendering model
- Interest in using CSS layout to render into canvas for high‑volume UIs (e.g., large data grids, WebGL textures).
- Debate over whether DOM with modern techniques (
contain, virtualization) can match canvas performance for large tables; experiences differ.
Accessibility, security, and “black-box web”
- Strong concern that canvas‑based apps could resemble old Flash/Java black boxes:
- Harder to inspect, copy text, block ads, or use keyboard navigation.
- Poor screen‑reader and general accessibility unless reimplemented manually.
- Others note browsers would need explicit canvas accessibility APIs before this could dominate.
- Native “CSS-in-canvas” is seen as having potential security issues (e.g., visited-link leakage, cross-origin data).