#[repr(C)]pub struct StyledDom {
pub root: NodeHierarchyItemId,
pub node_hierarchy: NodeHierarchyItemVec,
pub node_data: NodeDataVec,
pub styled_nodes: StyledNodeVec,
pub cascade_info: CascadeInfoVec,
pub nodes_with_window_callbacks: NodeIdVec,
pub nodes_with_not_callbacks: NodeIdVec,
pub nodes_with_datasets: NodeIdVec,
pub tag_ids_to_node_ids: TagIdToNodeIdMappingVec,
pub non_leaf_nodes: ParentWithNodeDepthVec,
pub css_property_cache: CssPropertyCachePtr,
}Fields§
§root: NodeHierarchyItemId§node_hierarchy: NodeHierarchyItemVec§node_data: NodeDataVec§styled_nodes: StyledNodeVec§cascade_info: CascadeInfoVec§nodes_with_window_callbacks: NodeIdVec§nodes_with_not_callbacks: NodeIdVec§nodes_with_datasets: NodeIdVec§tag_ids_to_node_ids: TagIdToNodeIdMappingVec§non_leaf_nodes: ParentWithNodeDepthVec§css_property_cache: CssPropertyCachePtrImplementations§
Source§impl StyledDom
impl StyledDom
pub fn new(dom: &mut Dom, css: CssApiWrapper) -> Self
Sourcepub fn append_child(&mut self, other: Self)
pub fn append_child(&mut self, other: Self)
Appends another StyledDom as a child to the self.root
without re-styling the DOM itself
Sourcepub fn inject_scroll_bars(&mut self)
pub fn inject_scroll_bars(&mut self)
Inject scroll bar DIVs with relevant event handlers into the DOM
This function essentially takes a DOM and inserts a wrapper DIV on every parent. First, all scrollbars are set to “display:none;” with a special library-internal marker that indicates that this DIV is a scrollbar. Then later on in the layout code, the items are set to “display: flex / block” as necessary, because this way scrollbars aren’t treated as “special” objects (the event handling for scrollbars are just regular callback handlers).
Inject a menu bar into the root component
Sourcepub fn with_child(&mut self, other: Self) -> Self
pub fn with_child(&mut self, other: Self) -> Self
Same as append_child(), but as a builder method
pub fn restyle(&mut self, css: CssApiWrapper)
Sourcepub fn insert_default_system_callbacks(&mut self, config: DefaultCallbacksCfg)
pub fn insert_default_system_callbacks(&mut self, config: DefaultCallbacksCfg)
Inserts default On::Scroll and On::Tab handle for scroll-able and tabindex-able nodes.
pub fn node_count(&self) -> usize
pub fn get_css_property_cache<'a>(&'a self) -> &'a CssPropertyCache
pub fn get_css_property_cache_mut<'a>(&'a mut self) -> &'a mut CssPropertyCache
pub fn get_styled_node_state(&self, node_id: &NodeId) -> StyledNodeState
Sourcepub fn scan_for_font_keys(
&self,
resources: &RendererResources,
) -> FastHashMap<ImmediateFontId, FastBTreeSet<Au>>
pub fn scan_for_font_keys( &self, resources: &RendererResources, ) -> FastHashMap<ImmediateFontId, FastBTreeSet<Au>>
Scans the display list for all font IDs + their font size
Sourcepub fn scan_for_image_keys(
&self,
css_image_cache: &ImageCache,
) -> FastBTreeSet<ImageRef>
pub fn scan_for_image_keys( &self, css_image_cache: &ImageCache, ) -> FastBTreeSet<ImageRef>
Scans the display list for all image keys
pub fn restyle_nodes_hover( &mut self, nodes: &[NodeId], new_hover_state: bool, ) -> BTreeMap<NodeId, Vec<ChangedCssProperty>>
pub fn restyle_nodes_active( &mut self, nodes: &[NodeId], new_active_state: bool, ) -> BTreeMap<NodeId, Vec<ChangedCssProperty>>
pub fn restyle_nodes_focus( &mut self, nodes: &[NodeId], new_focus_state: bool, ) -> BTreeMap<NodeId, Vec<ChangedCssProperty>>
pub fn restyle_user_property( &mut self, node_id: &NodeId, new_properties: &[CssProperty], ) -> BTreeMap<NodeId, Vec<ChangedCssProperty>>
Sourcepub fn scan_for_iframe_callbacks(&self) -> Vec<NodeId>
pub fn scan_for_iframe_callbacks(&self) -> Vec<NodeId>
Scans the StyledDom for iframe callbacks
Sourcepub fn get_html_string(
&self,
custom_head: &str,
custom_body: &str,
test_mode: bool,
) -> String
pub fn get_html_string( &self, custom_head: &str, custom_body: &str, test_mode: bool, ) -> String
Returns a HTML-formatted version of the DOM for easier debugging, i.e.
Dom::div().with_id("hello")
.with_child(Dom::div().with_id("test"))will return:
<div id="hello">
<div id="test" />
</div>Sourcepub fn get_subtree(&self, parent: NodeId) -> Vec<NodeId>
pub fn get_subtree(&self, parent: NodeId) -> Vec<NodeId>
Returns the node ID of all sub-children of a node
pub fn get_subtree_parents(&self, parent: NodeId) -> Vec<NodeId>
pub fn get_rects_in_rendering_order(&self) -> ContentGroup
pub fn swap_with_default(&mut self) -> Self
Trait Implementations§
impl StructuralPartialEq for StyledDom
Auto Trait Implementations§
impl Freeze for StyledDom
impl RefUnwindSafe for StyledDom
impl Send for StyledDom
impl Sync for StyledDom
impl Unpin for StyledDom
impl UnwindSafe for StyledDom
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more