Expand description
Profile-neutral DOM trait.
LayoutDom is the ID-first surface that serval-layout (and other
read-only DOM walkers — reader-mode, serialization, querySelector helpers)
consume. It does not commit to a backing store: serval-static-dom’s
StaticDocument and a future scripted-DOM provider both implement it.
Design rationale and prior art: see
docs/2026-05-16_layout_dom_api_design.md.
Structs§
- Attribute
View - Borrowed view of one attribute on an element.
- Qual
Name - A fully qualified name (with a namespace), used to depict names of tags and attributes.
Enums§
- Descent
- Per-node descent decision returned from
NodeVisitor::enter. - DomMutation
- A recorded structural DOM mutation — render-state-free (no dirty bits, no style).
Idis the implementor’sLayoutDom::NodeId. - Node
Kind - Plain node kind. Use the typed accessors on
LayoutDom(element_name,attribute,text, etc.) to read kind-specific data. - Quirks
Mode - A document’s quirks mode, for compatibility with old browsers. See quirks mode on wikipedia for more information.
Traits§
- Layout
Dom - Profile-neutral DOM. Implementors expose opaque
NodeIds and a small set of lookup primitives; traversal happens through the defaultwalkimpl over aNodeVisitor, or through caller-driven cursors built on the lookup primitives. - Layout
DomMut - Mutation extension for scripted DOMs (plan Part 3 / the layout_dom_api design’s
open question #1). Read-only consumers (reader-mode, serialization, static
layout) implement only
LayoutDom;serval-scripted-domimplements both. - Node
Visitor - Visitor over a
LayoutDom. Methods returnControlFlowso the visitor can bail early with a typedStopvalue. Usetype Stop = ()for plain “stop or not”; usecore::convert::Infallibleto assert the walk never terminates early; use a typed error type to carry per-node-failure data out of the walk.
Functions§
- walk_
subtree - Walk
root’s subtree withvisitor, descending viaLayoutDom::dom_children. ReturnsControlFlow::Break(stop)if any visitor method bailed; otherwiseControlFlow::Continue(()).