pub struct NodeFlags(/* private fields */);Expand description
Packed node metadata. 4 bytes per node.
Layout (matching Chrome’s design):
Bits 0-3: NodeType (4 bits, 16 possible values)
Bit 4: is_container (can have children)
Bit 5: is_connected (attached to a document tree)
Bit 6: needs_style_recalc
Bit 7: child_needs_style_recalc
Bit 8: needs_layout
Bit 9: child_needs_layout
Bit 10: needs_paint
Bit 11: child_needs_paint
Bit 12: is_focusable
Bit 13: is_focused
Bit 14: tree_structure_changed
Bits 15-31: reserved for future useImplementations§
Source§impl NodeFlags
impl NodeFlags
Sourcepub fn is_element(self) -> bool
pub fn is_element(self) -> bool
Is this an element node? (single AND + CMP)
Sourcepub fn is_document(self) -> bool
pub fn is_document(self) -> bool
Is this the document node?
Sourcepub fn is_container(self) -> bool
pub fn is_container(self) -> bool
Can this node have children? (Element, Document, DocumentFragment)
Sourcepub fn is_connected(self) -> bool
pub fn is_connected(self) -> bool
Is this node connected to a document tree?
pub fn is_focusable(self) -> bool
pub fn is_focused(self) -> bool
pub fn set_focused(&mut self, focused: bool)
pub fn set_connected(&mut self, connected: bool)
pub fn needs_style_recalc(self) -> bool
pub fn child_needs_style_recalc(self) -> bool
pub fn needs_layout(self) -> bool
pub fn child_needs_layout(self) -> bool
pub fn needs_paint(self) -> bool
pub fn child_needs_paint(self) -> bool
Sourcepub fn mark_style_dirty(&mut self)
pub fn mark_style_dirty(&mut self)
Mark this node as needing style recalculation. Cascades to layout + paint.
Sourcepub fn mark_layout_dirty(&mut self)
pub fn mark_layout_dirty(&mut self)
Mark this node as needing layout. Cascades to paint.
Sourcepub fn mark_paint_dirty(&mut self)
pub fn mark_paint_dirty(&mut self)
Mark this node as needing repaint only.
Sourcepub fn mark_tree_dirty(&mut self)
pub fn mark_tree_dirty(&mut self)
Mark tree structure changed.
Sourcepub fn mark_child_style_dirty(&mut self)
pub fn mark_child_style_dirty(&mut self)
Mark that a child needs style recalculation.
Sourcepub fn mark_child_layout_dirty(&mut self)
pub fn mark_child_layout_dirty(&mut self)
Mark that a child needs layout.
Sourcepub fn mark_child_paint_dirty(&mut self)
pub fn mark_child_paint_dirty(&mut self)
Mark that a child needs paint.
Sourcepub fn clear_all_dirty(&mut self)
pub fn clear_all_dirty(&mut self)
Clear all dirty flags after a full pipeline pass.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeFlags
impl RefUnwindSafe for NodeFlags
impl Send for NodeFlags
impl Sync for NodeFlags
impl Unpin for NodeFlags
impl UnsafeUnpin for NodeFlags
impl UnwindSafe for NodeFlags
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert