You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(html): let a host put a floor under the margin a view keeps
`HtmlConfig::min_content_margin` states, per side, the least distance the
generated content keeps from the view's border. Every view already insets
its content by some amount it names itself — 3mm for a reflowed text
document, 16px for the page column and the source views, 8px for a font
specimen, nothing for an image or a file listing — and no single number
could stand in for all of them, so the config is a floor rather than a
value: an unset side leaves the view exactly where it was, a set one only
ever raises it.
The arithmetic is css's. Each inset becomes `max(own, var(--odr-min-margin-*,
0px))`, so the view's own measure stays in the stylesheet and no unit has to
be converted to state it. `write_content_margin_style` declares the variables
per view and writes nothing at all when no side is set, which is what keeps
the shipped stylesheets independent of the config — they are shared under one
name when the config links rather than embeds them.
One place still needs the number: the gutter around the page column is part
of the width the view is fitted to, so `page_column_gutter_pixels` reads the
config and a side css can read but `css_pixels` cannot convert keeps the
built-in gutter — the margin still applies, only the fit cannot count it. A
unit css could not read at all is dropped rather than written into the style
element it would otherwise close.
A sheet and the media view are not inset: the one meets the edge by design,
the other is full-bleed.
Bound in python, jni, wasm (`minContentMargin`, css lengths as strings) and
apple, where `ODRMeasure` and `ODRDirectionalMeasure` gain the initialisers a
caller needs to state one.
Rendering with the default config is unchanged: every reference document is
byte-identical, and the stylesheets that did change render pixel-identically
under `compare-html`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UoWywNazPio5vphzB59U5g
0 commit comments