Truly independent web browser
LibWeb: Derive a box's layout facts as it is attached
Aliaksandr Kalenikab279bdb5814
diff --git a/Libraries/LibWeb/Rust/src/layout/formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/formatting_context.rsindex 39f6b4ee1bd..7521c8b50cf 100644--- a/Libraries/LibWeb/Rust/src/layout/formatting_context.rs+++ b/Libraries/LibWeb/Rust/src/layout/formatting_context.rs@@ -3662,15 +3662,11 @@ fn prepare_layout_stage(state: &mut super::ArenaHandle, kind: LayoutStageKind, rlet (arena, scratch) = state.arena_mut_and_layout_scratch();match kind {LayoutStageKind::Root { .. } => {- // NB: The tree builder derives the facts of rebuilt subtrees. Unclassified invalidations- // require deriving them for the entire tree instead.+ // NB: Boxes take their facts as they are attached. Unclassified invalidations require deriving+ // them for the entire tree instead.if arena.pending_updates_escape_partial_relayout {arena.derive_facts_in_subtree(root);arena.clear_partial_relayout_escape();- arena.pending_attached_subtree_roots.clear();- } else {- // NB: Top-layer updates can attach boxes without running the tree builder.- arena.derive_facts_after_tree_update(&[]);}arena.mark_flex_and_grid_items_of_nodes_marked_for_layout();}diff --git a/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs b/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rsindex c1ca51f02b0..8e8a3279a7e 100644--- a/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs+++ b/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs@@ -1145,10 +1145,11 @@ pub(crate) struct LayoutNodeArena {pub(crate) partial_relayout_boundary_roots: super::partial_relayout::PartialRelayoutBoundaryRoots,nodes_with_layout_update_flags: Vec<NodeSlotId>,layout_update_flag_node_indices: HashMap<NodeSlotId, usize>,- pub(super) pending_attached_subtree_roots: Vec<NodeSlotId>,/// Boxes whose child lists gained children since the last layout tree build, held back from/// layout invalidation until the build shows what the new children are.pub(crate) deferred_child_list_insertion_parents: Vec<(NodeSlotId, NodeSlotId)>,+ pub(super) deferred_child_list_insertion_parent_slots: HashSet<NodeSlotId>,+ pub(super) children_inserted_under_deferred_parents: Vec<(NodeSlotId, NodeSlotId)>,/// Layout inputs for new absolutely positioned boxes that the build confined to themselves./// They stand in for the committed inputs such a box does not have yet.pub(crate) confined_abspos_layout_inputs: HashMap<NodeSlotId, AbsposLayoutInputs>,@@ -1263,8 +1264,9 @@ impl LayoutNodeArena {partial_relayout_boundary_roots: Default::default(),nodes_with_layout_update_flags: Vec::new(),layout_update_flag_node_indices: HashMap::default(),- pending_attached_subtree_roots: Vec::new(),deferred_child_list_insertion_parents: Vec::new(),+ deferred_child_list_insertion_parent_slots: HashSet::default(),+ children_inserted_under_deferred_parents: Vec::new(),confined_abspos_layout_inputs: HashMap::default(),position_options_in_use: (HashMap::default()),last_successful_position_options: (HashMap::default()),@@ -4025,10 +4027,10 @@ impl LayoutNodeArena {if !self.slot_is_live(node) {continue;}- self.mark_flex_or_grid_item(node);+ self.derive_flex_or_grid_item_flags(node);let mut child = self.data(node).first_child.get();while !child.is_invalid() {- self.mark_flex_or_grid_item(child);+ self.derive_flex_or_grid_item_flags(child);child = self.data(child).next_sibling.get();}}@@ -4760,37 +4762,6 @@ impl LayoutNodeArena {}}- /// Returns every attached subtree root the derivation visited.- pub(crate) fn derive_facts_after_tree_update(&mut self, rebuilt_roots: &[NodeSlotId]) -> HashSet<NodeSlotId> {- // NB: Anonymous wrappers, generated content, and table fixup can attach nodes- // outside the builder's reported rebuild roots. Include every attached subtree.- let mut pending = std::mem::take(&mut self.pending_attached_subtree_roots);- let roots: HashSet<_> = pending- .drain(..)- .chain(rebuilt_roots.iter().copied())- .filter(|&root| self.slot_is_live(root))- .collect();- self.pending_attached_subtree_roots = pending;- for &root in &roots {- let mut ancestor = self.data(root).parent.get();- if ancestor.is_invalid() && self.data(root).kind.get() != NodeKind::Viewport {- continue;- }- while !ancestor.is_invalid() && !roots.contains(&ancestor) {- ancestor = self.data(ancestor).parent.get();- }- if ancestor.is_invalid() {- self.derive_facts_in_subtree(root);- // NB: Whether an anonymous box is a flex or grid item depends on its children.- let parent = self.data(root).parent.get();- if !parent.is_invalid() {- self.mark_flex_or_grid_item(parent);- }- }- }- roots- }-/// Derives what the nodes in the inclusive subtree of `root` take from their ancestors: whether they/// establish containing blocks, and their ancestor facts, which the pre-order walk finds already derived/// for the parent. Out-of-flow boxes in the subtree also mark the ancestors they escape.@@ -4800,48 +4771,86 @@ impl LayoutNodeArena {self.derive_containing_block_establishment_flags(node);self.mark_nodes_escaped_by_attached_out_of_flow_box(node);self.derive_ancestor_facts_for_node(node);- self.mark_flex_or_grid_item(node);+ self.derive_flex_or_grid_item_flags(node);cursor = self.next_node_in_layout_subtree_in_pre_order(root, node);}}- /// Marks `node` as a flex or grid item once its parent lays it out as one, as its parent's run would: an in-flow- /// box that is not an anonymous run of collapsible whitespace. The mark is never taken back.- pub(crate) fn mark_flex_or_grid_item(&mut self, node: NodeSlotId) {+ fn derive_facts_of_attached_node(&mut self, node: NodeSlotId) {+ self.derive_containing_block_establishment_flags(node);+ let brings_children = !self.data(node).first_child.get().is_invalid();+ if self.derive_ancestor_facts_for_node(node) && brings_children {+ self.refresh_ancestor_facts_of_anonymous_children(node);+ }+ self.mark_nodes_escaped_by_out_of_flow_boxes_attached_with(node);+ self.derive_flex_or_grid_item_flags(node);+ let parent = self.data(node).parent.get();+ if super::node_facts::has_flag(self.data(parent), NodeFlag::Anonymous) {+ self.derive_flex_or_grid_item_flags(parent);+ }+ }++ fn mark_nodes_escaped_by_out_of_flow_boxes_attached_with(&mut self, root: NodeSlotId) {+ self.mark_nodes_escaped_by_attached_out_of_flow_box(root);+ let mut boxes_with_escaping_descendants: smallvec::SmallVec<[NodeSlotId; 8]> = smallvec::smallvec![root];+ while let Some(node) = boxes_with_escaping_descendants.pop() {+ let mut child = self.data(node).first_child.get();+ while !child.is_invalid() {+ self.mark_nodes_escaped_by_attached_out_of_flow_box(child);+ if super::node_facts::has_flag(self.data(child), NodeFlag::AbsposDescendantEscapes) {+ boxes_with_escaping_descendants.push(child);+ }+ child = self.data(child).next_sibling.get();+ }+ }+ }++ /// Marks `node` as a flex or grid item exactly when its parent lays it out as one, as its parent's run would: an+ /// in-flow box that is not an anonymous run of collapsible whitespace.+ pub(crate) fn derive_flex_or_grid_item_flags(&mut self, node: NodeSlotId) {let data = self.data(node);let parent = data.parent.get();if parent.is_invalid() || !super::node_facts::kind_is_box(data.kind.get()) {return;}let parent_data = self.data(parent);- let parents_formatting_context = super::formatting_context::formatting_context_type_created_by_node_data(- parent_data,- super::node_facts::node_style_view(parent_data),- super::node_facts::has_ancestor_fact(parent_data, AncestorFact::ParentIsFlexOrGridContainer),- || {- let grandparent = parent_data.parent.get();- (!grandparent.is_invalid())- .then(|| super::node_facts::node_style_view(self.data(grandparent)))- .flatten()- .map(|style| style.writing_mode())- },- );- let flag = match parents_formatting_context {- Some(super::formatting_context::FormattingContextType::Flex) => NodeFlag::IsFlexItem,- Some(super::formatting_context::FormattingContextType::Grid) => NodeFlag::IsGridItem,- _ => return,+ let parent_style = super::node_facts::node_style_view(parent_data);+ let parents_formatting_context = if super::node_facts::node_is_flex_or_grid_container(parent_style) {+ super::formatting_context::formatting_context_type_created_by_node_data(+ parent_data,+ parent_style,+ super::node_facts::has_ancestor_fact(parent_data, AncestorFact::ParentIsFlexOrGridContainer),+ || {+ let grandparent = parent_data.parent.get();+ (!grandparent.is_invalid())+ .then(|| super::node_facts::node_style_view(self.data(grandparent)))+ .flatten()+ .map(|style| style.writing_mode())+ },+ )+ } else {+ None};- if super::node_facts::has_flag(data, flag)- || super::node_facts::node_style_view(data).is_some_and(|style| style.is_absolutely_positioned())- || self.may_be_anonymous_run_of_collapsible_whitespace(node)- {- return;+ let item_flag = match parents_formatting_context {+ Some(super::formatting_context::FormattingContextType::Flex) => Some(NodeFlag::IsFlexItem),+ Some(super::formatting_context::FormattingContextType::Grid) => Some(NodeFlag::IsGridItem),+ _ => None,+ }+ .filter(|_| {+ !super::node_facts::node_style_view(data).is_some_and(|style| style.is_absolutely_positioned())+ && !self.may_be_anonymous_run_of_collapsible_whitespace(node)+ });+ for flag in [NodeFlag::IsFlexItem, NodeFlag::IsGridItem] {+ let is_item = item_flag == Some(flag);+ if super::node_facts::has_flag(self.data(node), flag) != is_item {+ self.set_node_flag(node, flag, is_item);+ }}- self.set_node_flag(node, flag, true);}/// Whether `node` is an anonymous box holding only text that is ASCII whitespace, which flex and grid containers- /// do not lay out as an item. A child whose text is not synced yet counts too: the sync marks its parent again.+ /// do not lay out as an item. A child whose text is not synced yet counts too: publishing its text marks its parent+ /// again.fn may_be_anonymous_run_of_collapsible_whitespace(&self, node: NodeSlotId) -> bool {let data = self.data(node);if !super::node_facts::has_flag(data, NodeFlag::Anonymous) || data.generated_for.get() != 0 {@@ -5369,6 +5378,10 @@ impl LayoutNodeArena {}state.content = Some(content);drop(state);+ let parent = self.data(id).parent.get();+ if !parent.is_invalid() && super::node_facts::has_flag(self.data(parent), NodeFlag::Anonymous) {+ self.derive_flex_or_grid_item_flags(parent);+ }self.memo_invalidations.note_text_replaced(id.slot_index());self.searchable_text = None;// Publication can happen through a C++ text read before the enrolled@@ -5855,13 +5868,16 @@ impl LayoutNodeArena {self.assign_pre_order_labels_to_inserted_subtree(parent, child);self.note_layout_subtree_attached(child);- self.pending_attached_subtree_roots.push(child);+ if self.deferred_child_list_insertion_parent_slots.contains(&parent) {+ self.children_inserted_under_deferred_parents.push((parent, child));+ }// NB: Resolving the deferred insertion marks the parent for layout, which resets its intrinsic sizes.self.invalidate_self_and_ancestors(parent,AncestorInvalidation::StructuralChange,AncestorIntrinsicSizes::Kept,);+ self.derive_facts_of_attached_node(child);}pub(crate) fn remove_child(&mut self, parent: NodeSlotId, child: NodeSlotId) {@@ -6440,8 +6456,6 @@ pub(crate) fn sync_enrolled_content_for_layout(arena: &mut LayoutNodeArena) {continue;}super::rendered_text::ensure_text_content(arena, node);- // NB: Whether an anonymous box is a flex or grid item depends on whether its text is all whitespace.- arena.mark_flex_or_grid_item(arena.data(node).parent.get());}arena.sync_enrolled_replaced_content_facts();}diff --git a/Libraries/LibWeb/Rust/src/layout/partial_relayout.rs b/Libraries/LibWeb/Rust/src/layout/partial_relayout.rsindex b98634fccd5..b862547ba39 100644--- a/Libraries/LibWeb/Rust/src/layout/partial_relayout.rs+++ b/Libraries/LibWeb/Rust/src/layout/partial_relayout.rs@@ -473,21 +473,20 @@ impl LayoutNodeArena {pub(crate) fn defer_child_list_insertion_layout_update(&mut self, parent: NodeSlotId) {let grandparent = self.data(parent).parent.get();self.deferred_child_list_insertion_parents.push((parent, grandparent));+ self.deferred_child_list_insertion_parent_slots.insert(parent);}- /// Invalidate what the children attached by a layout tree build reach. `attached_roots` are the- /// roots of every subtree the build attached.+ /// Invalidate what the children attached by a layout tree build reach. `inserted_children` are+ /// the children the build attached to the deferred parents, each with the parent it was attached to.////// A child that is absolutely positioned against the box it was inserted into, with both axes/// placed by insets, changes neither that box nor anything around it: its containing block/// is the box's committed padding box, and it is laid out on its own from there. Only the/// cached runs above it have to forget their children. Any other insertion invalidates the/// box as the mutation did before the build.- pub(crate) fn resolve_deferred_child_list_insertions(- &mut self,- attached_roots: &crate::css::style::fast_hash::FastSet<NodeSlotId>,- ) {+ pub(crate) fn resolve_deferred_child_list_insertions(&mut self, inserted_children: &[(NodeSlotId, NodeSlotId)]) {self.confined_abspos_layout_inputs.clear();+ self.deferred_child_list_insertion_parent_slots.clear();let mut parents = std::mem::take(&mut self.deferred_child_list_insertion_parents);parents.sort_unstable_by_key(|(parent, _)| parent.index);parents.dedup_by_key(|(parent, _)| *parent);@@ -504,11 +503,15 @@ impl LayoutNodeArena {}continue;}- let inserted: Vec<NodeSlotId> = attached_roots+ let mut inserted: Vec<NodeSlotId> = inserted_children.iter()- .copied()- .filter(|&root| self.slot_is_live(root) && self.data(root).parent.get() == parent)+ .filter(|&&(inserted_parent, child)| {+ inserted_parent == parent && self.slot_is_live(child) && self.data(child).parent.get() == parent+ })+ .map(|&(_, child)| child).collect();+ inserted.sort_unstable_by_key(|child| child.index);+ inserted.dedup();let confined_inputs: Option<Vec<(NodeSlotId, AbsposLayoutInputs)>> = (!inserted.is_empty()&& !self.node_needs_layout_update(parent)).then(|| {diff --git a/Libraries/LibWeb/Rust/src/layout/tree_builder.rs b/Libraries/LibWeb/Rust/src/layout/tree_builder.rsindex 88fe5921439..e1162c9c5f7 100644--- a/Libraries/LibWeb/Rust/src/layout/tree_builder.rs+++ b/Libraries/LibWeb/Rust/src/layout/tree_builder.rs@@ -1582,13 +1582,14 @@ impl TreeBuildJob {let built_scroll_containers = host.arena_mut().take_built_scroll_containers();let arena = host.arena_mut();+ let children_inserted_under_deferred_parents =+ std::mem::take(&mut arena.children_inserted_under_deferred_parents);if rebuilt_subtrees_were_updated_individually {- let attached_roots = arena.derive_facts_after_tree_update(&state.rebuilt_subtree_roots);- arena.resolve_deferred_child_list_insertions(&attached_roots);+ arena.resolve_deferred_child_list_insertions(&children_inserted_under_deferred_parents);} else {- // NB: The full layout entry must derive the facts of this tree.+ // NB: A tree that was not rebuilt subtree by subtree is beyond what a partial relayout plan covers.arena.record_partial_relayout_escape();- arena.resolve_deferred_child_list_insertions(&Default::default());+ arena.resolve_deferred_child_list_insertions(&[]);}// Table fixup can free a rebuilt root after it was recorded, such as whitespace at the edge of adiff --git a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-2.txt b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-2.txtindex a0a698230f4..a44167a5406 100644--- a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-2.txt+++ b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-2.txt@@ -1645,13 +1645,13 @@ PASS: float left -> right on table-header-group in inline list-item | incrementaPRESERVED: float inline-start -> left on table-header-group in -webkit-box | fixture ancestorPRESERVED: float inline-start -> left on table-header-group in -webkit-box | distant siblingPRESERVED: float inline-start -> left on table-header-group in -webkit-box | distant sibling descendant-RECREATED: float inline-start -> left on table-header-group in -webkit-box | DOM parent-RECREATED: float inline-start -> left on table-header-group in -webkit-box | preceding sibling-RECREATED: float inline-start -> left on table-header-group in -webkit-box | preceding sibling descendant+PRESERVED: float inline-start -> left on table-header-group in -webkit-box | DOM parent+PRESERVED: float inline-start -> left on table-header-group in -webkit-box | preceding sibling+PRESERVED: float inline-start -> left on table-header-group in -webkit-box | preceding sibling descendantRECREATED: float inline-start -> left on table-header-group in -webkit-box | targetRECREATED: float inline-start -> left on table-header-group in -webkit-box | target descendant-RECREATED: float inline-start -> left on table-header-group in -webkit-box | following sibling-RECREATED: float inline-start -> left on table-header-group in -webkit-box | following sibling descendant+PRESERVED: float inline-start -> left on table-header-group in -webkit-box | following sibling+PRESERVED: float inline-start -> left on table-header-group in -webkit-box | following sibling descendantSTATS: float inline-start -> left on table-header-group in -webkit-box | rebuilt subtree roots=1, escaped=falsePASS: float inline-start -> left on table-header-group in -webkit-box | incremental tree matches full rebuildPRESERVED: clear none -> right on table-header-group in table-column | fixture ancestor@@ -1717,25 +1717,25 @@ PASS: position sticky -> relative on table-footer-group in contents | incrementaPRESERVED: float left -> right on table-footer-group in flex | fixture ancestorPRESERVED: float left -> right on table-footer-group in flex | distant siblingPRESERVED: float left -> right on table-footer-group in flex | distant sibling descendant-RECREATED: float left -> right on table-footer-group in flex | DOM parent-RECREATED: float left -> right on table-footer-group in flex | preceding sibling-RECREATED: float left -> right on table-footer-group in flex | preceding sibling descendant+PRESERVED: float left -> right on table-footer-group in flex | DOM parent+PRESERVED: float left -> right on table-footer-group in flex | preceding sibling+PRESERVED: float left -> right on table-footer-group in flex | preceding sibling descendantRECREATED: float left -> right on table-footer-group in flex | targetRECREATED: float left -> right on table-footer-group in flex | target descendant-RECREATED: float left -> right on table-footer-group in flex | following sibling-RECREATED: float left -> right on table-footer-group in flex | following sibling descendant+PRESERVED: float left -> right on table-footer-group in flex | following sibling+PRESERVED: float left -> right on table-footer-group in flex | following sibling descendantSTATS: float left -> right on table-footer-group in flex | rebuilt subtree roots=1, escaped=falsePASS: float left -> right on table-footer-group in flex | incremental tree matches full rebuild-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | fixture ancestor-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | distant sibling-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | distant sibling descendant-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | DOM parent-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | preceding sibling-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | preceding sibling descendant+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | fixture ancestor+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | distant sibling+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | distant sibling descendant+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | DOM parent+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | preceding sibling+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | preceding sibling descendantRECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | targetRECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | target descendant-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | following sibling-RECREATED: float inline-start -> left on table-footer-group in -webkit-inline-box | following sibling descendant+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | following sibling+PRESERVED: float inline-start -> left on table-footer-group in -webkit-inline-box | following sibling descendantSTATS: float inline-start -> left on table-footer-group in -webkit-inline-box | rebuilt subtree roots=1, escaped=falsePASS: float inline-start -> left on table-footer-group in -webkit-inline-box | incremental tree matches full rebuildPRESERVED: clear none -> right on table-footer-group in table-caption | fixture ancestordiff --git a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-3.txt b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-3.txtindex 35f7cb3825a..be506657dcd 100644--- a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-3.txt+++ b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-3.txt@@ -1561,13 +1561,13 @@ PASS: float left -> inline-start on table-row-group in inline list-item | incremPRESERVED: float inline-start -> right on table-row-group in -webkit-box | fixture ancestorPRESERVED: float inline-start -> right on table-row-group in -webkit-box | distant siblingPRESERVED: float inline-start -> right on table-row-group in -webkit-box | distant sibling descendant-RECREATED: float inline-start -> right on table-row-group in -webkit-box | DOM parent-RECREATED: float inline-start -> right on table-row-group in -webkit-box | preceding sibling-RECREATED: float inline-start -> right on table-row-group in -webkit-box | preceding sibling descendant+PRESERVED: float inline-start -> right on table-row-group in -webkit-box | DOM parent+PRESERVED: float inline-start -> right on table-row-group in -webkit-box | preceding sibling+PRESERVED: float inline-start -> right on table-row-group in -webkit-box | preceding sibling descendantRECREATED: float inline-start -> right on table-row-group in -webkit-box | targetRECREATED: float inline-start -> right on table-row-group in -webkit-box | target descendant-RECREATED: float inline-start -> right on table-row-group in -webkit-box | following sibling-RECREATED: float inline-start -> right on table-row-group in -webkit-box | following sibling descendant+PRESERVED: float inline-start -> right on table-row-group in -webkit-box | following sibling+PRESERVED: float inline-start -> right on table-row-group in -webkit-box | following sibling descendantSTATS: float inline-start -> right on table-row-group in -webkit-box | rebuilt subtree roots=1, escaped=falsePASS: float inline-start -> right on table-row-group in -webkit-box | incremental tree matches full rebuildPRESERVED: clear none -> both on table-row-group in table-column | fixture ancestor@@ -1633,25 +1633,25 @@ PASS: position sticky -> absolute on table-header-group in contents | incrementaPRESERVED: float left -> inline-start on table-header-group in flex | fixture ancestorPRESERVED: float left -> inline-start on table-header-group in flex | distant siblingPRESERVED: float left -> inline-start on table-header-group in flex | distant sibling descendant-RECREATED: float left -> inline-start on table-header-group in flex | DOM parent-RECREATED: float left -> inline-start on table-header-group in flex | preceding sibling-RECREATED: float left -> inline-start on table-header-group in flex | preceding sibling descendant+PRESERVED: float left -> inline-start on table-header-group in flex | DOM parent+PRESERVED: float left -> inline-start on table-header-group in flex | preceding sibling+PRESERVED: float left -> inline-start on table-header-group in flex | preceding sibling descendantRECREATED: float left -> inline-start on table-header-group in flex | targetRECREATED: float left -> inline-start on table-header-group in flex | target descendant-RECREATED: float left -> inline-start on table-header-group in flex | following sibling-RECREATED: float left -> inline-start on table-header-group in flex | following sibling descendant+PRESERVED: float left -> inline-start on table-header-group in flex | following sibling+PRESERVED: float left -> inline-start on table-header-group in flex | following sibling descendantSTATS: float left -> inline-start on table-header-group in flex | rebuilt subtree roots=1, escaped=falsePASS: float left -> inline-start on table-header-group in flex | incremental tree matches full rebuild-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | fixture ancestor-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | distant sibling-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | distant sibling descendant-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | DOM parent-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | preceding sibling-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | preceding sibling descendant+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | fixture ancestor+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | distant sibling+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | distant sibling descendant+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | DOM parent+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | preceding sibling+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | preceding sibling descendantRECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | targetRECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | target descendant-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | following sibling-RECREATED: float inline-start -> right on table-header-group in -webkit-inline-box | following sibling descendant+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | following sibling+PRESERVED: float inline-start -> right on table-header-group in -webkit-inline-box | following sibling descendantSTATS: float inline-start -> right on table-header-group in -webkit-inline-box | rebuilt subtree roots=1, escaped=falsePASS: float inline-start -> right on table-header-group in -webkit-inline-box | incremental tree matches full rebuildPRESERVED: clear none -> both on table-header-group in table-caption | fixture ancestor@@ -1714,16 +1714,16 @@ RECREATED: position sticky -> absolute on table-footer-group in block | followinRECREATED: position sticky -> absolute on table-footer-group in block | following sibling descendantSTATS: position sticky -> absolute on table-footer-group in block | rebuilt subtree roots=1, escaped=falsePASS: position sticky -> absolute on table-footer-group in block | incremental tree matches full rebuild-RECREATED: float left -> inline-start on table-footer-group in inline-flex | fixture ancestor-RECREATED: float left -> inline-start on table-footer-group in inline-flex | distant sibling-RECREATED: float left -> inline-start on table-footer-group in inline-flex | distant sibling descendant-RECREATED: float left -> inline-start on table-footer-group in inline-flex | DOM parent-RECREATED: float left -> inline-start on table-footer-group in inline-flex | preceding sibling-RECREATED: float left -> inline-start on table-footer-group in inline-flex | preceding sibling descendant+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | fixture ancestor+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | distant sibling+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | distant sibling descendant+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | DOM parent+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | preceding sibling+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | preceding sibling descendantRECREATED: float left -> inline-start on table-footer-group in inline-flex | targetRECREATED: float left -> inline-start on table-footer-group in inline-flex | target descendant-RECREATED: float left -> inline-start on table-footer-group in inline-flex | following sibling-RECREATED: float left -> inline-start on table-footer-group in inline-flex | following sibling descendant+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | following sibling+PRESERVED: float left -> inline-start on table-footer-group in inline-flex | following sibling descendantSTATS: float left -> inline-start on table-footer-group in inline-flex | rebuilt subtree roots=1, escaped=falsePASS: float left -> inline-start on table-footer-group in inline-flex | incremental tree matches full rebuildRECREATED: float inline-start -> right on table-footer-group in table-row-group | fixture ancestordiff --git a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-4.txt b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-4.txtindex bda49c78892..bd4455a7703 100644--- a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-4.txt+++ b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-4.txt@@ -1549,25 +1549,25 @@ PASS: position sticky -> fixed on table-row-group in contents | incremental treePRESERVED: float left -> inline-end on table-row-group in flex | fixture ancestorPRESERVED: float left -> inline-end on table-row-group in flex | distant siblingPRESERVED: float left -> inline-end on table-row-group in flex | distant sibling descendant-RECREATED: float left -> inline-end on table-row-group in flex | DOM parent-RECREATED: float left -> inline-end on table-row-group in flex | preceding sibling-RECREATED: float left -> inline-end on table-row-group in flex | preceding sibling descendant+PRESERVED: float left -> inline-end on table-row-group in flex | DOM parent+PRESERVED: float left -> inline-end on table-row-group in flex | preceding sibling+PRESERVED: float left -> inline-end on table-row-group in flex | preceding sibling descendantRECREATED: float left -> inline-end on table-row-group in flex | targetRECREATED: float left -> inline-end on table-row-group in flex | target descendant-RECREATED: float left -> inline-end on table-row-group in flex | following sibling-RECREATED: float left -> inline-end on table-row-group in flex | following sibling descendant+PRESERVED: float left -> inline-end on table-row-group in flex | following sibling+PRESERVED: float left -> inline-end on table-row-group in flex | following sibling descendantSTATS: float left -> inline-end on table-row-group in flex | rebuilt subtree roots=1, escaped=falsePASS: float left -> inline-end on table-row-group in flex | incremental tree matches full rebuild-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | fixture ancestor-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | distant sibling-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | distant sibling descendant-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | DOM parent-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | preceding sibling-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | preceding sibling descendant+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | fixture ancestor+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | distant sibling+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | distant sibling descendant+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | DOM parent+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | preceding sibling+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | preceding sibling descendantRECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | targetRECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | target descendant-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | following sibling-RECREATED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | following sibling descendant+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | following sibling+PRESERVED: float inline-start -> inline-end on table-row-group in -webkit-inline-box | following sibling descendantSTATS: float inline-start -> inline-end on table-row-group in -webkit-inline-box | rebuilt subtree roots=1, escaped=falsePASS: float inline-start -> inline-end on table-row-group in -webkit-inline-box | incremental tree matches full rebuildPRESERVED: clear left -> none on table-row-group in table-caption | fixture ancestor@@ -1630,16 +1630,16 @@ RECREATED: position sticky -> fixed on table-header-group in block | following sRECREATED: position sticky -> fixed on table-header-group in block | following sibling descendantSTATS: position sticky -> fixed on table-header-group in block | rebuilt subtree roots=1, escaped=falsePASS: position sticky -> fixed on table-header-group in block | incremental tree matches full rebuild-RECREATED: float left -> inline-end on table-header-group in inline-flex | fixture ancestor-RECREATED: float left -> inline-end on table-header-group in inline-flex | distant sibling-RECREATED: float left -> inline-end on table-header-group in inline-flex | distant sibling descendant-RECREATED: float left -> inline-end on table-header-group in inline-flex | DOM parent-RECREATED: float left -> inline-end on table-header-group in inline-flex | preceding sibling-RECREATED: float left -> inline-end on table-header-group in inline-flex | preceding sibling descendant+PRESERVED: float left -> inline-end on table-header-group in inline-flex | fixture ancestor+PRESERVED: float left -> inline-end on table-header-group in inline-flex | distant sibling+PRESERVED: float left -> inline-end on table-header-group in inline-flex | distant sibling descendant+PRESERVED: float left -> inline-end on table-header-group in inline-flex | DOM parent+PRESERVED: float left -> inline-end on table-header-group in inline-flex | preceding sibling+PRESERVED: float left -> inline-end on table-header-group in inline-flex | preceding sibling descendantRECREATED: float left -> inline-end on table-header-group in inline-flex | targetRECREATED: float left -> inline-end on table-header-group in inline-flex | target descendant-RECREATED: float left -> inline-end on table-header-group in inline-flex | following sibling-RECREATED: float left -> inline-end on table-header-group in inline-flex | following sibling descendant+PRESERVED: float left -> inline-end on table-header-group in inline-flex | following sibling+PRESERVED: float left -> inline-end on table-header-group in inline-flex | following sibling descendantSTATS: float left -> inline-end on table-header-group in inline-flex | rebuilt subtree roots=1, escaped=falsePASS: float left -> inline-end on table-header-group in inline-flex | incremental tree matches full rebuildRECREATED: float inline-start -> inline-end on table-header-group in table-row-group | fixture ancestor@@ -2137,13 +2137,13 @@ PASS: position sticky -> fixed on table-caption in inline list-item | incrementaPRESERVED: float left -> inline-end on table-caption in -webkit-box | fixture ancestorPRESERVED: float left -> inline-end on table-caption in -webkit-box | distant siblingPRESERVED: float left -> inline-end on table-caption in -webkit-box | distant sibling descendant-RECREATED: float left -> inline-end on table-caption in -webkit-box | DOM parent-RECREATED: float left -> inline-end on table-caption in -webkit-box | preceding sibling-RECREATED: float left -> inline-end on table-caption in -webkit-box | preceding sibling descendant+PRESERVED: float left -> inline-end on table-caption in -webkit-box | DOM parent+PRESERVED: float left -> inline-end on table-caption in -webkit-box | preceding sibling+PRESERVED: float left -> inline-end on table-caption in -webkit-box | preceding sibling descendantRECREATED: float left -> inline-end on table-caption in -webkit-box | targetRECREATED: float left -> inline-end on table-caption in -webkit-box | target descendant-RECREATED: float left -> inline-end on table-caption in -webkit-box | following sibling-RECREATED: float left -> inline-end on table-caption in -webkit-box | following sibling descendant+PRESERVED: float left -> inline-end on table-caption in -webkit-box | following sibling+PRESERVED: float left -> inline-end on table-caption in -webkit-box | following sibling descendantSTATS: float left -> inline-end on table-caption in -webkit-box | rebuilt subtree roots=1, escaped=falsePASS: float left -> inline-end on table-caption in -webkit-box | incremental tree matches full rebuildPRESERVED: float inline-start -> inline-end on table-caption in table-column | fixture ancestordiff --git a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-6.txt b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-6.txtindex 527d984e812..19b37e299a8 100644--- a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-6.txt+++ b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-6.txt@@ -1969,13 +1969,13 @@ PASS: float none -> right on table-column-group in inline list-item | incrementaPRESERVED: float right -> left on table-column-group in -webkit-box | fixture ancestorPRESERVED: float right -> left on table-column-group in -webkit-box | distant siblingPRESERVED: float right -> left on table-column-group in -webkit-box | distant sibling descendant-RECREATED: float right -> left on table-column-group in -webkit-box | DOM parent-RECREATED: float right -> left on table-column-group in -webkit-box | preceding sibling-RECREATED: float right -> left on table-column-group in -webkit-box | preceding sibling descendant+PRESERVED: float right -> left on table-column-group in -webkit-box | DOM parent+PRESERVED: float right -> left on table-column-group in -webkit-box | preceding sibling+PRESERVED: float right -> left on table-column-group in -webkit-box | preceding sibling descendantRECREATED: float right -> left on table-column-group in -webkit-box | targetRECREATED: float right -> left on table-column-group in -webkit-box | target descendant-RECREATED: float right -> left on table-column-group in -webkit-box | following sibling-RECREATED: float right -> left on table-column-group in -webkit-box | following sibling descendant+PRESERVED: float right -> left on table-column-group in -webkit-box | following sibling+PRESERVED: float right -> left on table-column-group in -webkit-box | following sibling descendantSTATS: float right -> left on table-column-group in -webkit-box | rebuilt subtree roots=1, escaped=falsePASS: float right -> left on table-column-group in -webkit-box | incremental tree matches full rebuildPRESERVED: float inline-end -> left on table-column-group in table-column | fixture ancestordiff --git a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-7.txt b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-7.txtindex c3288acfb2f..334acacfc6a 100644--- a/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-7.txt+++ b/Tests/LibWeb/Text/expected/layout-tree-update/style-invalidation-scope-position-float-7.txt@@ -1966,16 +1966,16 @@ RECREATED: float none -> inline-start on table-column-group in flex | followingRECREATED: float none -> inline-start on table-column-group in flex | following sibling descendantSTATS: float none -> inline-start on table-column-group in flex | rebuilt subtree roots=1, escaped=falsePASS: float none -> inline-start on table-column-group in flex | incremental tree matches full rebuild-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | fixture ancestor-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | distant sibling-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | distant sibling descendant-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | DOM parent-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | preceding sibling-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | preceding sibling descendant+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | fixture ancestor+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | distant sibling+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | distant sibling descendant+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | DOM parent+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | preceding sibling+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | preceding sibling descendantRECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | targetRECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | target descendant-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | following sibling-RECREATED: float right -> inline-start on table-column-group in -webkit-inline-box | following sibling descendant+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | following sibling+PRESERVED: float right -> inline-start on table-column-group in -webkit-inline-box | following sibling descendantSTATS: float right -> inline-start on table-column-group in -webkit-inline-box | rebuilt subtree roots=1, escaped=falsePASS: float right -> inline-start on table-column-group in -webkit-inline-box | incremental tree matches full rebuildRECREATED: float inline-end -> right on table-column-group in table-caption | fixture ancestor