Expand description
The core DOM abstraction in Blitz
This crate implements a flexible headless DOM (BaseDocument), which is designed to emebedded in and “driven” by external code. Most users will want
to use a wrapper:
HtmlDocumentfrom the blitz-html crate. Allows you to parse HTML (or XHTML) into a BlitzBaseDocument, and can be combined with a markdown-to-html converter like comrak or pulldown-cmark) to render/process markdown.DioxusDocumentfrom the dioxus-native crate. Combines aBaseDocumentwith a DioxusVirtualDomto enable dynamic rendering and event handling.
It includes: A DOM tree respresentation, CSS parsing and resolution, layout and event handling. Additional functionality is available in separate crates, including html parsing (blitz-html), networking (blitz-net), rendering (blitz-paint) and windowing (blitz-shell).
Most of the functionality in this crates is provided through the struct.
blitz-dom has a native Rust API that is designed for higher-level abstractions to be built on top (although it can also be used directly).
The goal behind this crate is that any implementor can interact with the DOM and render it out using any renderer they want.
Re-exports§
pub use crate::node::Widget;pub use node::Attribute;pub use node::DocumentData;pub use node::ElementData;pub use node::Node;pub use node::NodeData;pub use node::SelectData;pub use node::TextNodeData;pub use paint_damage::PaintDamage;pub use range::LiveRange;pub use range::RangeBoundary;pub use range::RangeBounds;pub use range::RangeContent;pub use util::Point;pub use util::decode_font_bytes;pub use accesskit;pub use kurbo;
Modules§
- accessibility
- The role an element has, and the AccessKit tree built out of those roles.
- font_
fallback - Embedder-supplied family fallback and helpers for registering compiled-in faces.
- net
- node
- The nodes themsleves, and their data.
- paint_
damage - What changed on screen since the previous painted frame.
- platform
- Engine-backed CSSOM operations used by script bindings. CSSOM operations that use the same parser and computed values as rendering.
- range
- Live DOM ranges. Boundary offsets are UTF-16 code units for CharacterData and child indices for other nodes. The mutation hooks also cover detached trees and documents sharing this arena.
- release
- stash_
policy - util
Macros§
- local_
name - Takes a local name as a string and returns its key in the string cache.
- namespace_
prefix - Takes a namespace prefix string and returns its key in a string cache.
- namespace_
url - Takes a namespace url string and returns its key in a string cache.
- ns
- Maps the input of
namespace_prefix!to the output ofnamespace_url!. - qual_
name - Creates an markup5ever::QualName. Given a local name and an optional namespace
Structs§
- Base
Document - Document
Config - Options used when constructing a
BaseDocument - Document
Mutator - Dummy
Html Parser Provider - Event
Driver - Font
Context - A font database/cache (wrapper around a Fontique
CollectionandSourceCache). - Form
Submission Scope - Scope a native form policy to the embedder’s document thread, including any nested document events dispatched on that thread.
- Lookup
Form Submission - A native GET submission prepared for one submitter in the live document.
- Lookup
Form Submission Denied - Media
Type - https://drafts.csswg.org/mediaqueries/#media-types
- Namespace
Static Set - NodeId
- A versioned identifier for a node in a Blitz DOM tree.
- Node
Tree - The versioned map in which the nodes of the DOM tree are stored, backed by
a
slotmap::SlotMap. - Noop
Event Handler - Plain
Document - PreClick
Activation - What the pre-click activation steps changed, so a cancelled click can put
it back. Produced by
BaseDocument::run_pre_click_activation. - Prefix
Static Set - Qual
Name - A fully qualified name (with a namespace), used to depict names of tags and attributes.
- Restyle
Hint - The kind of restyle we need to do for a given element.
Enums§
- Animation
Pacing - How urgently a document needs another animation frame.
- DocGuard
- DocGuard
Mut - DomMutation
- One change, in the shape a
MutationRecordneeds. - Style
Threading - Strategy for Stylo’s style traversal during
resolve.
Constants§
Traits§
- Document
- Abstraction over wrappers around
BaseDocumentto allow for them all to be driven byblitz-shell - Event
Handler - Html
Parser Provider
Functions§
- build_
font_ context - Create an independent Parley font context with the embedded bullet font.
- build_
single_ font_ ctx - Convenience builder for the one-font case: produces a
FontContextwith system-font discovery disabled and the supplied font registered as the fallback for every generic family. The standard setup for WASM, where browsers don’t expose system fonts. WOFF/WOFF2 inputs are decoded automatically. - dom_
node_ id - Convert a
taffy::NodeIdproduced bytaffy_node_idback into a BlitzNodeId. - resolve_
2d_ transform - taffy_
node_ id - Convert a Blitz
NodeIdinto ataffy::NodeId(which wraps au64).