Limitations
htmlbag deliberately does not implement parts of HTML/CSS that would require fundamentally different layout machinery. This page lists what’s missing and where the line is.
Side floats with text wrap
CSS float: left|right — floats that sit alongside body text with
text wrapping around them — is not supported. It requires a paragraph
builder that handles variable line widths over a vertical range
(TeX’s \parshape). htmlbag’s paragraph builder runs at fixed width
per paragraph; lifting that constraint is a separate project.
Multi-column layout
CSS column-count / column-width are not supported. The page
builder operates on one column.
Running headers and footers from body content
CSS running() / element() (GCPM) are supported: an element
with position: running(name) is captured out of the flow and a page
margin box places it with content: element(name). See
CSS support. The related string-set property (copying just a
text string instead of an element) is not implemented; use a running
element instead.
Page master alternation
The pseudo-class page selectors @page :first, :right and :left
are supported: size, margin / margin-{top,right,bottom,left},
background-color and background-image resolve per page and cascade
over the generic @page rule. See CSS support. @page :blank
is not implemented.
One caveat remains on the content width. A run of body text is line
broken once, at the content width of the first page of its break group.
If a later page’s @page rule gives a different width (different left or
right margin), the already broken lines are sliced by height onto the new
page but not reflowed to the new width. Different vertical geometry
(a taller margin-top on :first, a different margin-bottom later)
works; a different width does not reflow the running text. Absolutely
positioned blocks and internal table widths are likewise measured at the
starting width.
Inline images with text wrap
<img style="float: left"> rendering with text wrapping around the
image is not supported (same root reason as side floats).
Static-typing-mode XPath
Internal — only relevant if you embed htmlbag’s XPath usage. The
underlying goxpath engine implements XPath 1.0 / 2.0 basic
semantics; XPath 2.0 strict static-typing mode (XPST0005 errors for
empty-by-construction expressions) is not enforced.
What this means in practice
A single-column document with figures, tables, lists, footnotes, multiple top/bottom floats per page, and a unified page master is fully covered. A multi-column document with running chapter titles, side-anchored figures with wrapped text, and left/right page asymmetry needs work that goes beyond the insert system.