Merge branch 'upstream' into make-widgets-cross-framework

This commit is contained in:
Evan Almloff committed 2023-04-06 14:07:01 -05:00
commit 8b5f2cb02f
22 files changed
+380 -122

No files matched your search

+1
View File
@@ -35,6 +35,7 @@ fn sort_bfs(paths: &[&'static [u8]]) -> Vec<(usize, &'static [u8])> {
}
#[test]
#[cfg(debug_assertions)]
fn sorting() {
let r: [(usize, &[u8]); 5] = [
(0, &[0, 1]),
+25 -12
View File
@@ -148,6 +148,13 @@ impl<'b> VirtualDom {
// Make sure the roots get transferred over while we're here
right_template.root_ids.transfer(&left_template.root_ids);
// Update the node refs
for i in 0..right_template.root_ids.len() {
if let Some(root_id) = right_template.root_ids.get(i) {
self.update_template(root_id, right_template);
}
}
}
fn diff_dynamic_node(
@@ -628,10 +635,12 @@ impl<'b> VirtualDom {
}
let id = self.find_last_element(&new[last]);
self.mutations.push(Mutation::InsertAfter {
id,
m: nodes_created,
});
if nodes_created > 0 {
self.mutations.push(Mutation::InsertAfter {
id,
m: nodes_created,
})
}
nodes_created = 0;
}
@@ -652,10 +661,12 @@ impl<'b> VirtualDom {
}
let id = self.find_first_element(&new[last]);
self.mutations.push(Mutation::InsertBefore {
id,
m: nodes_created,
});
if nodes_created > 0 {
self.mutations.push(Mutation::InsertBefore {
id,
m: nodes_created,
});
}
nodes_created = 0;
}
@@ -676,10 +687,12 @@ impl<'b> VirtualDom {
}
let id = self.find_first_element(&new[first_lis]);
self.mutations.push(Mutation::InsertBefore {
id,
m: nodes_created,
});
if nodes_created > 0 {
self.mutations.push(Mutation::InsertBefore {
id,
m: nodes_created,
});
}
}
}
+5 -5
View File
@@ -68,7 +68,7 @@ pub enum Mutation<'a> {
/// The ID of the element being mounted to
id: ElementId,
/// The number of nodes on the stack
/// The number of nodes on the stack to append to the target element
m: usize,
},
@@ -155,7 +155,7 @@ pub enum Mutation<'a> {
/// The ID of the node we're going to replace with
id: ElementId,
/// The number of nodes on the stack to use to replace
/// The number of nodes on the stack to replace the target element with
m: usize,
},
@@ -167,7 +167,7 @@ pub enum Mutation<'a> {
/// `[0,1,2]` represents 1st child's 2nd child's 3rd child.
path: &'static [u8],
/// The number of nodes on the stack to use to replace
/// The number of nodes on the stack to replace the target element with
m: usize,
},
@@ -176,7 +176,7 @@ pub enum Mutation<'a> {
/// The ID of the node to insert after.
id: ElementId,
/// The ids of the nodes to insert after the target node.
/// The number of nodes on the stack to insert after the target node.
m: usize,
},
@@ -185,7 +185,7 @@ pub enum Mutation<'a> {
/// The ID of the node to insert before.
id: ElementId,
/// The ids of the nodes to insert before the target node.
/// The number of nodes on the stack to insert before the target node.
m: usize,
},