Skip to content

Commit

Permalink
Implement stylo dirty_descendents methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Dec 4, 2024
1 parent 0fd609f commit 66498fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/blitz-dom/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub struct Node {
pub is_hovered: bool,
pub has_snapshot: bool,
pub snapshot_handled: AtomicBool,
pub has_dirty_descendents: AtomicBool,
pub display_outer: DisplayOuter,
pub cache: Cache,
pub unrounded_layout: Layout,
Expand Down Expand Up @@ -119,6 +120,7 @@ impl Node {
is_hovered: false,
has_snapshot: false,
snapshot_handled: AtomicBool::new(false),
has_dirty_descendents: AtomicBool::new(false),
display_outer: DisplayOuter::Block,
cache: Cache::new(),
unrounded_layout: Layout::new(),
Expand Down
13 changes: 8 additions & 5 deletions packages/blitz-dom/src/stylo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,14 @@ impl<'a> TElement for BlitzNode<'a> {
}

fn has_dirty_descendants(&self) -> bool {
true
self.has_dirty_descendents.load(Ordering::SeqCst)
}
unsafe fn set_dirty_descendants(&self) {
self.has_dirty_descendents.store(true, Ordering::SeqCst)
}

unsafe fn unset_dirty_descendants(&self) {
self.has_dirty_descendents.store(false, Ordering::SeqCst)
}

fn has_snapshot(&self) -> bool {
Expand All @@ -714,10 +721,6 @@ impl<'a> TElement for BlitzNode<'a> {
self.snapshot_handled.store(true, Ordering::SeqCst);
}

unsafe fn set_dirty_descendants(&self) {}

unsafe fn unset_dirty_descendants(&self) {}

fn store_children_to_process(&self, _n: isize) {
unimplemented!()
}
Expand Down

0 comments on commit 66498fd

Please sign in to comment.