From 06e8785938908e4fd7327eaf89d0b7cb316c0993 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 4 Apr 2022 12:19:21 -0500 Subject: [PATCH] add PopRoot --- packages/native-core/src/real_dom.rs | 3 +++ packages/native-core/tests/change_nodes.rs | 4 ++-- packages/native-core/tests/initial_build.rs | 4 ++-- packages/native-core/tests/state.rs | 8 ++++---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/native-core/src/real_dom.rs b/packages/native-core/src/real_dom.rs index 5f914cd56..e7eecdbc4 100644 --- a/packages/native-core/src/real_dom.rs +++ b/packages/native-core/src/real_dom.rs @@ -176,6 +176,9 @@ impl RealDom { RemoveAttribute { root, .. } => { nodes_updated.push(root as usize); } + PopRoot {} => { + self.node_stack.pop(); + } } } } diff --git a/packages/native-core/tests/change_nodes.rs b/packages/native-core/tests/change_nodes.rs index 387481462..ed606dca0 100644 --- a/packages/native-core/tests/change_nodes.rs +++ b/packages/native-core/tests/change_nodes.rs @@ -6,7 +6,7 @@ use dioxus_native_core::real_dom::RealDom; use std::cell::Cell; #[test] -fn tree_remove_node() { +fn remove_node() { #[allow(non_snake_case)] fn Base(cx: Scope) -> Element { rsx!(cx, div {}) @@ -80,7 +80,7 @@ fn tree_remove_node() { } #[test] -fn tree_add_node() { +fn add_node() { #[allow(non_snake_case)] fn Base(cx: Scope) -> Element { rsx!(cx, div {}) diff --git a/packages/native-core/tests/initial_build.rs b/packages/native-core/tests/initial_build.rs index d17ea05d4..08152beef 100644 --- a/packages/native-core/tests/initial_build.rs +++ b/packages/native-core/tests/initial_build.rs @@ -7,7 +7,7 @@ use dioxus_html as dioxus_elements; use dioxus_native_core::real_dom::RealDom; #[test] -fn tree_initial_build_simple() { +fn initial_build_simple() { use std::cell::Cell; #[allow(non_snake_case)] @@ -40,7 +40,7 @@ fn tree_initial_build_simple() { } #[test] -fn tree_initial_build_with_children() { +fn initial_build_with_children() { #[allow(non_snake_case)] fn Base(cx: Scope) -> Element { rsx!(cx, div {}) diff --git a/packages/native-core/tests/state.rs b/packages/native-core/tests/state.rs index a31110f18..17b13ef75 100644 --- a/packages/native-core/tests/state.rs +++ b/packages/native-core/tests/state.rs @@ -59,7 +59,7 @@ impl PushedDownState for PushedDownStateTester { } #[test] -fn tree_state_initial() { +fn state_initial() { #[allow(non_snake_case)] fn Base(cx: Scope) -> Element { rsx!(cx, div { @@ -114,7 +114,7 @@ fn tree_state_initial() { } #[test] -fn tree_state_reduce_initally_called_minimally() { +fn state_reduce_initally_called_minimally() { #[derive(Debug, Clone, PartialEq, Default)] struct CallCounter(u32); impl BubbledUpState for CallCounter { @@ -190,7 +190,7 @@ fn tree_state_reduce_initally_called_minimally() { } #[test] -fn tree_state_reduce_down_called_minimally_on_update() { +fn state_reduce_down_called_minimally_on_update() { #[allow(non_snake_case)] fn Base(cx: Scope) -> Element { rsx!(cx, div { @@ -255,7 +255,7 @@ fn tree_state_reduce_down_called_minimally_on_update() { } #[test] -fn tree_state_reduce_up_called_minimally_on_update() { +fn state_reduce_up_called_minimally_on_update() { #[allow(non_snake_case)] fn Base(cx: Scope) -> Element { rsx!(cx, div {