wip: structure coming together and tests

This commit is contained in:
Jonathan Kelley committed 2021-08-23 12:11:45 -04:00
1 parent 16bfc6d248
commit 2d541eca64
13 files changed
+251 -141

No files matched your search

+9 -6
View File
@@ -31,16 +31,19 @@ impl<'a> Mutations<'a> {
self.edits.push(PopRoot {});
}
pub(crate) fn replace_with(&mut self, m: u32) {
self.edits.push(ReplaceWith { m });
pub(crate) fn replace_with(&mut self, root: ElementId, m: u32) {
let root = root.as_u64();
self.edits.push(ReplaceWith { m, root });
}
pub(crate) fn insert_after(&mut self, n: u32) {
self.edits.push(InsertAfter { n });
pub(crate) fn insert_after(&mut self, root: ElementId, n: u32) {
let root = root.as_u64();
self.edits.push(InsertAfter { n, root });
}
pub(crate) fn insert_before(&mut self, n: u32) {
self.edits.push(InsertBefore { n });
pub(crate) fn insert_before(&mut self, root: ElementId, n: u32) {
let root = root.as_u64();
self.edits.push(InsertBefore { n, root });
}
// Remove Nodesfrom the dom