pub struct SegmentMeta {
pub depth: usize,
pub noindent: bool,
pub font: Option<String>,
pub namespaces: Vec<(String, String)>,
pub parent: Option<String>,
pub ancestors: Vec<String>,
pub anchor: Option<String>,
}Expand description
Per-segment facts recorded at spill time and consumed when the segment is re-materialized in pass 2.
Fields§
§depth: usizeSpine depth of the spilled subtree’s insertion point (the depth the serializer must resume at for indentation to match the eager output).
noindent: boolThe spill parent’s noindent_children — the noindent value the eager
serializer would have passed when recursing into these children
(schema-driven: whether the parent can contain #PCDATA). Pass-2
re-serialization must use the same value or indentation diverges.
font: Option<String>The font finalize_rec declares for the spill parent’s children (Document::finalize_context_font), as its
node_fonts key: per-fragment finalize resolves fonts as the whole-document walk would have.
namespaces: Vec<(String, String)>Namespace declarations ((prefix, uri)) the wrapper must carry so the
segment parses stand-alone. In the eager DOM these live on the document
root (hoisted during build); a spilled subtree’s own serialization does
not repeat them.
parent: Option<String>The qname of the spilled run’s PARENT element (the spine node the
segment splices back under). Pass-2 finalize consults the parent for
schema decisions — e.g. collapsing an attribute-less ltx:text font
wrapper requires can_contain(parent, grandchild) — and the parse
wrapper (ltx:_lxfragment) is not in the model, so the recorded real
parent substitutes for it (witness: tests/digestion/dollar.tex kept an
empty <text> around an inline-block that eager collapsed).
ancestors: Vec<String>Every xml:id on the spilled run’s ANCESTOR chain at the spill point.
A label:/id:-scoped rewrite whose scope node is one of these
ancestors covers the WHOLE fragment (the fragment sits inside the
scope subtree), but the node itself lives in another fragment — the
selection would come up empty (witness: tests/math/simplemath.tex,
where label:sec:restricted stamps role=FUNCTION inside a section
whose shell spills separately from its paragraphs).
anchor: Option<String>The nearest ancestor xml:id below the root: the element eager finalize mints the run’s id-less top nodes
under (S1.p1.1 under S1.p1), its counters carried through pass 2 (Document::fragment_anchor_id).