Skip to content

Commit 2a46943

Browse files
committed
Reset IS_TABLE_ROOT flag when reconstructing node
1 parent 99c64b7 commit 2a46943

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/blitz-dom/src/layout/construct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ pub(crate) fn collect_layout_children(
5959
layout_children: &mut Vec<usize>,
6060
anonymous_block_id: &mut Option<usize>,
6161
) {
62-
// Reset inline layout
62+
// Reset construction flags
6363
// TODO: make incremental and only remove this if the element is no longer an inline root
6464
doc.nodes[container_node_id]
6565
.flags
66-
.remove(NodeFlags::IS_INLINE_ROOT);
66+
.reset_construction_flags();
6767
if let Some(element_data) = doc.nodes[container_node_id].element_data_mut() {
6868
element_data.take_inline_layout();
6969
}

packages/blitz-dom/src/node.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ impl NodeFlags {
6262
pub fn is_table_root(&self) -> bool {
6363
self.contains(Self::IS_TABLE_ROOT)
6464
}
65+
66+
#[inline(always)]
67+
pub fn reset_construction_flags(&mut self) {
68+
self.remove(Self::IS_INLINE_ROOT);
69+
self.remove(Self::IS_TABLE_ROOT);
70+
}
6571
}
6672

6773
pub struct Node {

0 commit comments

Comments
 (0)