Crate augdom[−][src]
Expand description
augdom
provides an “augmented DOM” implementation that can run almost
anywhere Rust can. By default the webdom
feature is enabled and this crate
is a wrapper around web-sys
for creating and manipulating HTML elements.
See the crate::Dom trait for the provided behavior.
The rsdom
feature enables a DOM emulation layer written in pure Rust which
can be used for testing or to render HTML strings.
Known Limitations
As of today the <web_sys::Element as Dom>::*_attribute
methods will panic
if called on a text node. This cost seems appropriate today because this is
a dependency for other crates which enforce this requirement themselves.
web_sys
enforces this restriction statically.
Re-exports
pub use web_sys as sys;
Modules
Event types.
An implementation of augdom
’s APIs on top of an in-memory emulation of the
web’s DOM.
Quoting from DOM Testing Library’s motivations, as this crate’s test utilities are similar in design:
An implementation of augdom
’s APIs on top of the actual web using the
web-sys
crate and wasm-bindgen
.
Enums
The current document.
Wraps streams of mutation events from a given DOM backend.
Wraps individual mutation records from a given DOM backend.
A Node
in the augmented DOM.
Traits
A value which implements a subset of the web’s document object model.
A trait for checked and unchecked casting between JS types.
Functions
Create a new virtual element as part of a throwaway document. Useful for testing.
Returns the current document. Panics if called outside a valid context.
Wrap the provided root
function in a virtual document and ensures that all
nodes created within root
will create virtual nodes.