Truly independent web browser
LibWeb: Stamp rows with paint generations instead of pushing damage
Aliaksandr Kalenik83a1abbd167b
diff --git a/Libraries/LibWeb/Painting/BoxViews.h b/Libraries/LibWeb/Painting/BoxViews.hindex eb7efb68e6a..8113c491d05 100644--- a/Libraries/LibWeb/Painting/BoxViews.h+++ b/Libraries/LibWeb/Painting/BoxViews.h@@ -115,8 +115,8 @@ WEB_API InvalidateDisplayList display_list_invalidation_of(Layout::RustFFI::FfiBWEB_API void set_needs_repaint(Layout::Node const&, InvalidateDisplayList = InvalidateDisplayList::PaintCommandsAndHitTestList);WEB_API void set_needs_repaint_in_subtree(Layout::Node const&);-// Records the document's display list again without damaging any row, for a change that pushes the damage of the rows it-// changes itself.+// Records the document's display list again without stamping any row, for a change that stamps the rows it changes+// itself.WEB_API void request_document_repaint(DOM::Document const&, InvalidateDisplayList);WEB_API void repaint_after_style_change(Layout::Node const&, CSS::RequiredInvalidationAfterStyleChange const&);diff --git a/Libraries/LibWeb/Rust/src/layout/commit.rs b/Libraries/LibWeb/Rust/src/layout/commit.rsindex 86e135cab9f..e64010742bc 100644--- a/Libraries/LibWeb/Rust/src/layout/commit.rs+++ b/Libraries/LibWeb/Rust/src/layout/commit.rs@@ -10,7 +10,7 @@ use crate::layout::node_data::DomPaintFact;use crate::painting::node_painting;use crate::painting::paint_read::PaintRead;use crate::painting::paintable_rows::PaintableRowReset;-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::RowPaintChange;use crate::painting::visual_context::dirty::VisualContextBoxDirtyKind;/// What a commit message tells the document.@@ -672,7 +672,8 @@ impl<'tree> Commit<'_, 'tree> {if row_existed_before_this_commit&& line_root_changes_repaint_inline_box(self.arena(), node, enclosing_line_root_changes){- self.arena_mut().push_paint_damage(node, PaintDamage::ALL_PRODUCERS);+ self.arena_mut()+ .note_paint_change(node, RowPaintChange::EVERYTHING_IT_PAINTS);}if row_existed_before_this_commit && enclosing_line_root_changes.fragment_changed {self.arena_mut()@@ -733,17 +734,17 @@ impl<'tree> Commit<'_, 'tree> {.line_data.as_ref().is_none_or(|content| content.fragments.is_empty());- let mut damage = PaintDamage::NONE;+ let mut paint_change = RowPaintChange::NONE;if change.changes_what_the_box_itself_shows()|| (change.fragment_identity_changed && has_descendant_dependent_paint(self.arena(), node))|| empty_editable_children_changed{- damage |= PaintDamage::ALL_PRODUCERS;+ paint_change |= RowPaintChange::EVERYTHING_IT_PAINTS;}// Inserted, removed or reordered children change which scopes this row's plans list,// independently of where the children were placed.if change.child_sequence_changed || change.inline_item_order_changed {- damage |= PaintDamage::ORDER;+ paint_change |= RowPaintChange::ORDER;}// Keep fragment identity as the conservative signal for overflow and visual contexts.// The fragment stays the same when only the link's margins or parent-decided facts change, but margin-box clip@@ -758,16 +759,16 @@ impl<'tree> Commit<'_, 'tree> {// the fragment's temporary offset would dirty identical inlines on every relayout; their// line content and box properties suffice.if line_root_changes_repaint_inline_box(self.arena(), node, enclosing_line_root_changes) {- damage |= PaintDamage::ALL_PRODUCERS;+ paint_change |= RowPaintChange::EVERYTHING_IT_PAINTS;}if enclosing_line_root_changes.inline_item_order_changed {- damage |= PaintDamage::ORDER;+ paint_change |= RowPaintChange::ORDER;}fragment_content_changed |= enclosing_line_root_changes.fragment_changed;} else if offset_changed {- damage |= PaintDamage::MOVED;+ paint_change |= RowPaintChange::PLACE;}- self.arena_mut().push_paint_damage(node, damage);+ self.arena_mut().note_paint_change(node, paint_change);if offset_changed {self.arena_mut().note_visual_context_box_dirty(node, VisualContextBoxDirtyKind::MovedWithDescendants);@@ -896,7 +897,7 @@ impl<'tree> Commit<'_, 'tree> {return;}self.arena_mut()- .push_paint_damage(slot, PaintDamage::ALL_PRODUCERS | PaintDamage::MOVED);+ .note_paint_change(slot, RowPaintChange::EVERYTHING_IT_PAINTS | RowPaintChange::PLACE);self.arena_mut().note_visual_context_box_dirty(slot,if moved {@@ -935,7 +936,7 @@ impl<'tree> Commit<'_, 'tree> {});self.arena_mut().committed_side_data_mut(slot).inline_content = Some(line_data.clone());if item_order_changed {- self.arena_mut().push_paint_damage(slot, PaintDamage::ORDER);+ self.arena_mut().note_paint_change(slot, RowPaintChange::ORDER);}if has_pieces {self.arena_mut().note_line_root_needs_fragment_ownership(slot);@@ -985,7 +986,7 @@ impl<'tree> Commit<'_, 'tree> {paintable_rows.request_ink_overflow_recalculation(old_containing_block);paintable_rows.request_ink_overflow_recalculation(containing_block);paintable_rows.note_visual_context_box_dirty(node, VisualContextBoxDirtyKind::ContainingBlockChanged);- paintable_rows.push_paint_damage(node, PaintDamage::MOVED);+ paintable_rows.note_paint_change(node, RowPaintChange::PLACE);}}diff --git a/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs b/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rsindex 3728a6762dc..fc281fb6281 100644--- a/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs+++ b/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs@@ -31,6 +31,7 @@ use crate::layout::node_data::{use crate::layout::node_facts::ReplacedContentFacts;use crate::layout::tree_mutation::HostCalls;use crate::painting::paint_read::{GeometryRead, PaintRead};+use crate::painting::record::change_ticks::RowPaintChange;use crate::render_state::DocumentHost;use crate::stage::MainThread;use std::ffi::c_void;@@ -2790,7 +2791,7 @@ impl LayoutNodeArena {self.mark_row_for_relayout_after_style_change(style_node, slot);}self.note_style_visual_context_moves(slot, row.record_damage);- self.push_paint_damage_for_repaint(slot, crate::painting::record::damage::PaintDamage::ALL_PRODUCERS);+ self.note_paint_change_for_repaint(slot, RowPaintChange::EVERYTHING_IT_PAINTS);}/// Notes the visual contexts a style move with `damage`, an `FfiStyleInvalidationField` word, moves for `slot`'s@@ -4708,11 +4709,8 @@ impl LayoutNodeArena {};if changed {self.paint_fact_writes += 1;- use crate::painting::record::damage::PaintDamage;- self.push_paint_damage_for_repaint(- id,- PaintDamage::DRAW_BACKGROUND | PaintDamage::DRAW_BORDER | PaintDamage::SCOPE_PREAMBLE,- );+ use crate::painting::record::change_ticks::RowPaintChange;+ self.note_paint_change_for_repaint(id, RowPaintChange::DRAWING);}changed}@@ -4751,7 +4749,7 @@ impl LayoutNodeArena {if !shows {return;}- let damage = facts.damage_when_changed();+ let paint_change = facts.paint_change_when_changed();let rows: Vec<NodeSlotId> = self.rows_sharing_dom_node_with(id).collect();for row in rows {if self.replaced_paint_facts.get(&row) == Some(&facts) {@@ -4759,7 +4757,7 @@ impl LayoutNodeArena {}Arc::make_mut(&mut self.replaced_paint_facts).insert(row, facts.clone());self.paint_fact_writes += 1;- self.push_paint_damage_for_repaint(row, damage);+ self.note_paint_change_for_repaint(row, paint_change);}}@@ -4818,8 +4816,8 @@ impl LayoutNodeArena {}self.write_shape(row).set_dom_paint_facts(facts);any_changed = true;- use crate::painting::record::damage::PaintDamage;- self.push_paint_damage_for_repaint(row, PaintDamage::ALL_HIT | PaintDamage::SCROLL_METADATA);+ use crate::painting::record::change_ticks::RowPaintChange;+ self.note_paint_change_for_repaint(row, RowPaintChange::HIT_TESTING | RowPaintChange::SCROLL_METADATA);}any_changed}@@ -4933,7 +4931,7 @@ impl LayoutNodeArena {// Retaining compositor-animated content decides whether a non-invertible transform// still records its stacking context.if flag == NodeFlag::HasAnimatedOpacityOrTransform && updated != previous {- self.push_paint_damage(id, crate::painting::record::damage::PaintDamage::ELIGIBILITY);+ self.note_paint_change(id, RowPaintChange::ORDER);}}@@ -6371,7 +6369,7 @@ impl LayoutNodeArena {pub(crate) fn remove_child(&mut self, parent: NodeSlotId, child: NodeSlotId) {if self.paintable_row_count() > 0 {- self.push_enclosing_paint_order_damage(child);+ self.note_enclosing_paint_order_change(child);}self.unlink_child(parent, child);self.invalidate_self_and_ancestors(@@ -6712,10 +6710,7 @@ pub unsafe extern "C" fn render_state_set_node_style(/// observers the row holds are dropped, and the image provider it owns is told.pub(crate) fn prepare_row_for_detach(host_calls: HostCalls<'_>, arena: &mut LayoutNodeArena, row: NodeSlotId) {arena.pin_style_record_for_detachment(row);- arena.push_paint_damage(- row,- crate::painting::record::damage::PaintDamage::ALL_DRAW | crate::painting::record::damage::PaintDamage::ALL_HIT,- );+ arena.note_paint_change(row, RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING);host_calls.row_detached(row, arena.data(row).kind.get());}diff --git a/Libraries/LibWeb/Rust/src/layout/partial_relayout.rs b/Libraries/LibWeb/Rust/src/layout/partial_relayout.rsindex 81b5ee26ab5..1cd8c5d6184 100644--- a/Libraries/LibWeb/Rust/src/layout/partial_relayout.rs+++ b/Libraries/LibWeb/Rust/src/layout/partial_relayout.rs@@ -673,18 +673,18 @@ impl LayoutNodeArena {/// children: the cached runs that describe the old list, and the paint that depends on it.fn note_contained_child_list_change(&mut self, parent: NodeSlotId) {use crate::layout::node_data::DomPaintFact;- use crate::painting::record::damage::PaintDamage;+ use crate::painting::record::change_ticks::RowPaintChange;self.invalidate_fragments_of_self_and_ancestors_for_change_that_sizes_no_box(parent);// A committed row plans its children's paint, and an empty editable box is a caret target// only while it has nothing to paint in it.- let mut damage = PaintDamage::ORDER;+ let mut paint_change = RowPaintChange::ORDER;if crate::painting::node_painting::has_lines(self, parent)&& self.node_has_dom_paint_fact(parent, DomPaintFact::EditableOrEditingHost){- damage |= PaintDamage::ALL_PRODUCERS;+ paint_change |= RowPaintChange::EVERYTHING_IT_PAINTS;}- self.push_paint_damage(parent, damage);+ self.note_paint_change(parent, paint_change);}/// Marks for layout every box whose style renders in one of the font cascades of `font_lists`, which loads filleddiff --git a/Libraries/LibWeb/Rust/src/layout/tree_builder/list_unit.rs b/Libraries/LibWeb/Rust/src/layout/tree_builder/list_unit.rsindex 6fabd87533c..dbdd7b1136a 100644--- a/Libraries/LibWeb/Rust/src/layout/tree_builder/list_unit.rs+++ b/Libraries/LibWeb/Rust/src/layout/tree_builder/list_unit.rs@@ -1843,7 +1843,7 @@ fn drop_list_rows(host: &mut TreeBuilderHost<'_>, dropped: &[OldRow]) -> Vec<Repif !dropped.is_empty() {let arena = host.arena_mut();if arena.paintable_row_count() > 0 {- arena.push_enclosing_paint_order_damage(dropped[0].slot);+ arena.note_enclosing_paint_order_change(dropped[0].slot);}for row in dropped {let data = arena.data(row.slot);diff --git a/Libraries/LibWeb/Rust/src/layout/tree_update_marks.rs b/Libraries/LibWeb/Rust/src/layout/tree_update_marks.rsindex 953c77eefbf..82a35d243b5 100644--- a/Libraries/LibWeb/Rust/src/layout/tree_update_marks.rs+++ b/Libraries/LibWeb/Rust/src/layout/tree_update_marks.rs@@ -16,7 +16,7 @@ use crate::css::computed_value_views::ComputedValuesView;use crate::css::style::bridge::element_adjustment_fact;use crate::css::style::tree::StyleNodeID;use crate::painting::paint_read::{GeometryRead, PaintRead};-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::RowPaintChange;use crate::render_state::DocumentHost;/// Which narrower rebuild the marks a node has collected so far still permit, as@@ -757,7 +757,7 @@ impl FfiBoxMarks {if let Some(inline_box) =crate::painting::fragment_ownership::nearest_self_painting_inline_box(&arena.paintable_rows(), row){- arena.push_paint_damage(inline_box, PaintDamage::ALL_DRAW | PaintDamage::ALL_HIT);+ arena.note_paint_change(inline_box, RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING);}}}@@ -776,7 +776,7 @@ fn size_is_independent_of_image(style: ComputedValuesView<'_>) -> bool {fn repaint_subtree(arena: &mut LayoutNodeArena, row: NodeSlotId) {if arena.paintable_row_is_populated(row) {- arena.push_paint_damage_to_paint_subtree(row, PaintDamage::ALL_PRODUCERS);+ arena.note_paint_change_in_paint_subtree(row, RowPaintChange::EVERYTHING_IT_PAINTS);}}@@ -785,16 +785,19 @@ pub(crate) fn repaint(arena: &mut LayoutNodeArena, row: NodeSlotId, includes_hitif !arena.paintable_row_is_populated(row) {return;}- let damage = if includes_hit_testing {- PaintDamage::ALL_PRODUCERS+ let paint_change = if includes_hit_testing {+ RowPaintChange::EVERYTHING_IT_PAINTS} else {- PaintDamage::ALL_DRAW+ RowPaintChange::DRAWING};- arena.push_paint_damage_for_repaint(row, damage);+ arena.note_paint_change_for_repaint(row, paint_change);if arena.node_flags(row) & NodeFlag::IsBody as u32 != 0 {let source = super::viewport_propagation::root_background_source(arena);if source.use_body_background_properties && arena.paintable_row_is_populated(source.root_layout_node) {- arena.push_paint_damage(source.root_layout_node, PaintDamage::ALL_DRAW | PaintDamage::ALL_HIT);+ arena.note_paint_change(+ source.root_layout_node,+ RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING,+ );}}}diff --git a/Libraries/LibWeb/Rust/src/layout/viewport_propagation.rs b/Libraries/LibWeb/Rust/src/layout/viewport_propagation.rsindex 1ed47f3b183..9611cc1fc0a 100644--- a/Libraries/LibWeb/Rust/src/layout/viewport_propagation.rs+++ b/Libraries/LibWeb/Rust/src/layout/viewport_propagation.rs@@ -17,6 +17,7 @@ use crate::css::style::bridge::{element_adjustment_fact, element_construction_fause crate::css::style::tree::StyleNodeID;use crate::layout::LayoutNodeArena;use crate::layout::node_data::NodeSlotId;+use crate::painting::record::change_ticks::RowPaintChange;/// What the propagation reads of the document element and its first HTML body child element.#[derive(Clone, Copy)]@@ -343,7 +344,7 @@ pub(crate) fn propagate_root_styles_to_viewport(// The viewport's scroll node records what the viewport does at its boundary, and a new style for the// viewport box does not get it recorded again by itself.if changed {- arena.push_paint_damage(viewport, crate::painting::record::damage::PaintDamage::SCROLL_METADATA);+ arena.note_paint_change(viewport, RowPaintChange::SCROLL_METADATA);}};diff --git a/Libraries/LibWeb/Rust/src/painting/fragment_ownership.rs b/Libraries/LibWeb/Rust/src/painting/fragment_ownership.rsindex ec8e5c2ac46..e6b8a47de52 100644--- a/Libraries/LibWeb/Rust/src/painting/fragment_ownership.rs+++ b/Libraries/LibWeb/Rust/src/painting/fragment_ownership.rs@@ -220,7 +220,7 @@ fn take_previous_fragment_ownership(}fn assign_for_block(layout_arena: &mut impl PaintableRowsWrite, block: NodeSlotId) {- use crate::painting::record::damage::PaintDamage;+ use crate::painting::record::change_ticks::RowPaintChange;let owners_with_filters = compute_fragment_ownership_for_block(&*layout_arena, block);// Start every piece's box from a clean slate. A box whose filter changes paints a// different selection of the block's fragments.@@ -241,9 +241,9 @@ fn assign_for_block(layout_arena: &mut impl PaintableRowsWrite, block: NodeSlotI.iter().any(|(previous_owner, previous)| *previous_owner == owner && **previous == filter);if !unchanged {- layout_arena.push_paint_damage(+ layout_arena.note_paint_change(owner,- PaintDamage::DRAW_FOREGROUND | PaintDamage::HIT_FOREGROUND | PaintDamage::ORDER,+ RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING | RowPaintChange::ORDER,);}layout_arena.committed_side_data_mut(owner).fragment_ownership = Some(std::sync::Arc::new(filter));@@ -254,9 +254,9 @@ fn assign_for_block(layout_arena: &mut impl PaintableRowsWrite, block: NodeSlotI.fragment_ownership.is_none(){- layout_arena.push_paint_damage(+ layout_arena.note_paint_change(previous_owner,- PaintDamage::DRAW_FOREGROUND | PaintDamage::HIT_FOREGROUND | PaintDamage::ORDER,+ RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING | RowPaintChange::ORDER,);}}diff --git a/Libraries/LibWeb/Rust/src/painting/ink_overflow.rs b/Libraries/LibWeb/Rust/src/painting/ink_overflow.rsindex 831f04df3d7..e52c74feee7 100644--- a/Libraries/LibWeb/Rust/src/painting/ink_overflow.rs+++ b/Libraries/LibWeb/Rust/src/painting/ink_overflow.rs@@ -842,7 +842,7 @@ mod tests {moved_child.offset.x = CssPixels::from_integer(-400);arena.set_committed_fragment_link(child, moved_child, None);arena.clear_absolute_rect_memo();- arena.push_paint_damage(child, crate::painting::record::damage::PaintDamage::MOVED);+ arena.note_paint_change(child, crate::painting::record::change_ticks::RowPaintChange::PLACE);arena.settle_ink_overflow();assert_eq!(arena.stored_ink_overflow(root).rect, rect(-400, 0, 500, 320));assert_ne!(arena.ink_overflow_stamp(), stamp);diff --git a/Libraries/LibWeb/Rust/src/painting/paint_changes.rs b/Libraries/LibWeb/Rust/src/painting/paint_changes.rsindex f2375843eb7..67bff5811cb 100644--- a/Libraries/LibWeb/Rust/src/painting/paint_changes.rs+++ b/Libraries/LibWeb/Rust/src/painting/paint_changes.rs@@ -19,7 +19,7 @@ use super::paintable_data::{FfiCustomHighlightReplacedEntry, FfiCustomHighlightTextEntry, FfiSearchTextRange, FfiSelectionEntry,FfiSpellingError, PaintableFlag,};-use super::record::damage::PaintDamage;+use super::record::change_ticks::RowPaintChange;use super::replaced_paint_facts::{ImagePaintFacts, ReplacedPaintFacts, VideoPaintFacts};use super::selection::HighlightStyleRecords;use super::visual_context::dirty::VisualContextBoxDirtyKind;@@ -220,7 +220,7 @@ impl PaintChange {return;}rows.paintable_data_mut(node).set_flag(flag, hidden);- rows.push_paint_damage(node, PaintDamage::HIT_OVERLAY);+ rows.note_paint_change(node, RowPaintChange::HIT_TESTING);}Self::SetLayerImagePaintFacts { node, entries } => {arena.set_layer_image_paint_facts(node, entries);diff --git a/Libraries/LibWeb/Rust/src/painting/paint_passes.rs b/Libraries/LibWeb/Rust/src/painting/paint_passes.rsindex 025eafc250e..87112dcc1b1 100644--- a/Libraries/LibWeb/Rust/src/painting/paint_passes.rs+++ b/Libraries/LibWeb/Rust/src/painting/paint_passes.rs@@ -656,7 +656,7 @@ pub(crate) fn update_accumulated_visual_contexts(if viewport_overflow_changed {// The wheel targets of every hit-test item end at the viewport where it scrolls, which no box capture of the// last recording knows: none of its scroll metadata stands.- arena.push_scroll_metadata_damage_everywhere();+ arena.note_everything_paints_anew();}if state.last_tree_inputs.is_some_and(|last| {last.device_pixels_per_css_pixel != inputs.device_pixels_per_css_pixel || viewport_overflow_changed@@ -753,8 +753,7 @@ fn fresh_visual_context_tree_build(unreachable!("a fresh tree walk has a tree and a viewport record")}};- // Everything records again; pushing that first keeps the per-row pushes below free.- arena.push_all_paint_damage();+ arena.note_everything_paints_anew();super::ffi::apply_walk_assignments(arena, &mut outcome);arena.rebuild_all_stacking_context_entries_from_records(viewport);arena.take_line_roots_needing_fragment_ownership();@@ -853,7 +852,7 @@ pub(crate) fn publish_resolved_svg_paint_resources(arena: &mut LayoutNodeArena,resolved: Vec<ResolvedSvgPaintResource>,) -> bool {- use crate::painting::record::damage::PaintDamage;+ use crate::painting::record::change_ticks::RowPaintChange;let mut any_changed = false;for resolved in resolved {match resolved {@@ -864,7 +863,7 @@ pub(crate) fn publish_resolved_svg_paint_resources(.publish_paint_server(slot, kind, published){any_changed = true;- arena.push_paint_damage(slot, PaintDamage::SVG | PaintDamage::SCOPE_PREAMBLE);+ arena.note_paint_change(slot, RowPaintChange::DRAWING);}}ResolvedSvgPaintResource::Filter { slot, kind, published } => {@@ -877,7 +876,7 @@ pub(crate) fn publish_resolved_svg_paint_resources(slot,crate::painting::visual_context::dirty::VisualContextBoxDirtyKind::StyleValueChange,);- arena.push_paint_damage(slot, PaintDamage::SVG | PaintDamage::SCOPE_PREAMBLE);+ arena.note_paint_change(slot, RowPaintChange::DRAWING);}}}diff --git a/Libraries/LibWeb/Rust/src/painting/paint_read.rs b/Libraries/LibWeb/Rust/src/painting/paint_read.rsindex 62c332d4372..cfe2df13457 100644--- a/Libraries/LibWeb/Rust/src/painting/paint_read.rs+++ b/Libraries/LibWeb/Rust/src/painting/paint_read.rs@@ -26,7 +26,7 @@ use crate::painting::layer_image_paint_facts::{LayerImagePaintFacts, layer_imageuse crate::painting::paint_order_plan::PaintOrderInputs;use crate::painting::paintable_data::{CommittedSideData, PaintableData};use crate::painting::published_frame::{PublishedFrame, PublishedRows};-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::PaintChangeStamps;use crate::painting::record::recorder_state::AbsoluteRectMemo;use crate::painting::replaced_paint_facts::ReplacedPaintFacts;use crate::painting::stacking_context::entries::StackingContextEntries;@@ -589,8 +589,8 @@ impl<'a> PaintSource<'a> {self.rows}- pub(crate) fn paint_damage_of_row(&self, row: NodeSlotId) -> PaintDamage {- self.frame().damage().of_row(row)+ pub(crate) fn paint_change_stamps(&self, row: NodeSlotId) -> PaintChangeStamps {+ self.rows.paint_change_stamps(row)}}diff --git a/Libraries/LibWeb/Rust/src/painting/paint_state.rs b/Libraries/LibWeb/Rust/src/painting/paint_state.rsindex cfd3d72eecd..d6d212e5b7f 100644--- a/Libraries/LibWeb/Rust/src/painting/paint_state.rs+++ b/Libraries/LibWeb/Rust/src/painting/paint_state.rs@@ -96,7 +96,7 @@ impl PaintState {}impl crate::layout::LayoutNodeArena {- /// Makes `source` the root background source, and pushes the damage of the boxes the move changes which paints+ /// Makes `source` the root background source, and stamps the boxes the move changes which paints/// the root's background. Answers whether the source moved.pub(crate) fn update_root_background_source(&mut self,@@ -108,22 +108,22 @@ impl crate::layout::LayoutNodeArena {if previous == source {return false;}- use crate::painting::record::damage::PaintDamage;- // Propagation changes which box paints the body's background. Push both the old+ use crate::painting::record::change_ticks::RowPaintChange;+ // Propagation changes which box paints the body's background. Stamp both the old// and new owners, including inline pieces painted by their containing block.for source in [previous, source] {for slot in [source.root_layout_node, source.body_layout_node] {- self.push_paint_damage_for_repaint(slot, PaintDamage::DRAW_BACKGROUND);+ self.note_paint_change_for_repaint(slot, RowPaintChange::DRAWING);}// The viewport's scrollbars take their colors from the propagated background.if let Some(viewport) = self.node_parent_if_live(source.root_layout_node) {- self.push_paint_damage(viewport, PaintDamage::DRAW_OVERLAY | PaintDamage::SCROLL_METADATA);+ self.note_paint_change(viewport, RowPaintChange::DRAWING | RowPaintChange::SCROLL_METADATA);}}true}- /// Lends the visual context state to `update`, which can read the rows and push paint damage beside it.+ /// Lends the visual context state to `update`, which can read the rows and stamp paint changes beside it.pub(crate) fn with_visual_context_state_lent<T>(&mut self,update: impl FnOnce(&mut Self, &mut crate::painting::visual_context::VisualContextState) -> T,diff --git a/Libraries/LibWeb/Rust/src/painting/paintable_rows.rs b/Libraries/LibWeb/Rust/src/painting/paintable_rows.rsindex 7a14c5fb511..5fe39da29b5 100644--- a/Libraries/LibWeb/Rust/src/painting/paintable_rows.rs+++ b/Libraries/LibWeb/Rust/src/painting/paintable_rows.rs@@ -12,7 +12,7 @@ use crate::painting::node_painting;use crate::painting::paint_read::{GeometryRead, PaintRead};use crate::painting::paintable_data::*;use crate::painting::published_frame::PublishedRows;-use crate::painting::record::damage::{DamageSet, PaintDamage, RowPaintState};+use crate::painting::record::change_ticks::{PaintChangeStamps, PaintGenerations, RowPaintChange};use crate::painting::stacking_context::entries::{StackingContextEntryColumn, drop_table};use crate::painting::visual_context::dirty::{RemovedBoxBlocks, VisualContextBoxDirtyKind, VisualContextUpdateScope};use crate::painting::visual_context::{@@ -254,8 +254,8 @@ pub(crate) struct PaintableRowStore {/// In chunks a fork of the arena shares until either side writes one, so forking does not copy every row's.side_data: CowVec<PaintableSideData, PAINTABLE_SLOTS_PER_CHUNK>,committed_side_data: CowColumn<CommittedSideData, PAINTABLE_SLOTS_PER_CHUNK>,- pub(crate) row_paint_states: crate::fork_vec::ForkVec<RowPaintState>,- pub(crate) damage: DamageSet,+ pub(crate) paint_change_stamps: CowColumn<PaintChangeStamps, PAINTABLE_SLOTS_PER_CHUNK>,+ pub(crate) paint_generations: PaintGenerations,// NB: Boxed, as most rows have no record, and a row holds no more than a pointer for one.visual_context_records: CowColumn<Option<Box<PaintableVisualContextRecord>>, PAINTABLE_SLOTS_PER_CHUNK>,/// The visual context node handles of each row that has a record. They are kept here only, in@@ -429,7 +429,7 @@ wherecontinue;}if node_painting::has_lines(&*self, current) || node_painting::is_fragmented_inline(&*self, current) {- self.arena.push_paint_damage(current, PaintDamage::DRAW_FOREGROUND);+ self.arena.note_paint_change(current, RowPaintChange::DRAWING);}if let Some(first_child) = crate::painting::paint_order::first_paint_child(&*self, current) {stack.push(first_child);@@ -456,7 +456,7 @@ where/// Starts committing a row anew. The commit writes its geometry and inline content over what it committed last, so/// that a row it commits as it was copies no chunk a published generation shares.pub(crate) fn begin_paintable_row_recommit(&mut self, id: NodeSlotId) {- // The row's damage is deliberately kept; the commit diff pushes what actually changed.+ // The row's stamps are deliberately kept; the commit diff stamps what actually changed.let filter = self.arena.committed_side_data_mut(id).fragment_ownership.take();if filter.is_some() {self.arena@@ -641,14 +641,14 @@ impl LayoutNodeArena {// A row whose ordering decisions changed is placed differently by its ancestors' plans and// may plan its own descendants differently.pub(crate) fn note_paint_order_changed(&mut self, row: NodeSlotId) {- self.push_paint_damage(row, PaintDamage::ORDER);- self.push_enclosing_paint_order_damage(row);+ self.note_paint_change(row, RowPaintChange::ORDER);+ self.note_enclosing_paint_order_change(row);}// The entry tables decide how a stacking context composes its hoisted content, so a table// change reorders the context's own painting even when no row changed its own decisions.pub(crate) fn note_stacking_context_composition_changed(&mut self, context_root: NodeSlotId) {- self.push_paint_damage(context_root, PaintDamage::CONTEXT_ORDER);+ self.note_paint_change(context_root, RowPaintChange::ORDER);}pub(crate) fn paintable_rows(&self) -> PaintableRowsRef<'_> {@@ -670,6 +670,7 @@ impl LayoutNodeArena {ink_overflow: store.ink_overflow.publish(),ink_overflow_stamp: store.ink_overflow_stamp,hit_test_items_stamp: store.hit_test_items_stamp,+ paint_change_stamps: store.paint_change_stamps.publish(),nodes,paint_facts,rows: store.rows.publish(),@@ -746,9 +747,9 @@ impl LayoutNodeArena {store.committed_side_data.grow_to(index + 1);store.visual_context_node_handles.grow_to(index + 1);store.stacking_context_entries.grow_to(index + 1);+ store.paint_change_stamps.grow_to(index + 1);while store.side_data.len() <= index {store.side_data.push(PaintableSideData::default());- store.row_paint_states.push(RowPaintState::default());}store.population_writes += 1;@@ -764,7 +765,10 @@ impl LayoutNodeArena {..Default::default()};store.committed_side_data.set(index, CommittedSideData::default());- store.row_paint_states[index].clear();+ store.paint_change_stamps.set(+ index,+ PaintChangeStamps::of_a_row_new_to_the_document(store.paint_generations.generation_writes_stamp_with()),+ );store.visual_context_records.set(index, None);set_visual_context_node_handles(&mut store.visual_context_node_handles, index, None);drop_table(&mut store.stacking_context_entries, index);@@ -782,7 +786,7 @@ impl LayoutNodeArena {self.note_hit_test_items_changed();if row_is_still_linked {// A cleared row is still linked, so the ancestor whose plans listed it is known now.- self.push_enclosing_paint_order_damage(id);+ self.note_enclosing_paint_order_change(id);}if let Some((record, node_handles)) = self.take_paintable_visual_context_record(id) {self.withdraw_stacking_context_state_of_reset_row(id, Some(record.stacking_context));@@ -811,7 +815,7 @@ impl LayoutNodeArena {store.rows.set(index, PaintableData::default());store.side_data[index] = PaintableSideData::default();store.committed_side_data.set(index, CommittedSideData::default());- store.row_paint_states[index].clear();+ store.paint_change_stamps.set(index, PaintChangeStamps::default());store.visual_context_records.set(index, None);set_visual_context_node_handles(&mut store.visual_context_node_handles, index, None);drop_table(&mut store.stacking_context_entries, index);@@ -1104,7 +1108,7 @@ impl LayoutNodeArena {if !self.paintable_row_is_populated(containing_block) {return;}- self.push_paint_damage(containing_block, PaintDamage::ALL_PRODUCERS);+ self.note_paint_change(containing_block, RowPaintChange::EVERYTHING_IT_PAINTS);let mut side = self.committed_side_data_mut(containing_block);let Some(content) = side.inline_content.as_mut() else {return;diff --git a/Libraries/LibWeb/Rust/src/painting/published_frame.rs b/Libraries/LibWeb/Rust/src/painting/published_frame.rsindex 9da5af1a56f..f2641225c41 100644--- a/Libraries/LibWeb/Rust/src/painting/published_frame.rs+++ b/Libraries/LibWeb/Rust/src/painting/published_frame.rs@@ -8,7 +8,7 @@//!//! A [`PublishedFrame`] is what one recording reads: [`PublishedRows`], one generation of a//! document's layout tree shape, paintable rows and paint facts and of the columns read beside them,-//! with the paint damage and the paint state the recording reads. It is immutable: every column in+//! with the paint generation and the paint state the recording reads. It is immutable: every column in//! it is a [`ColumnSnapshot`] or an `Arc` the document shares with it, so the document writes its//! live columns (copying a chunk a frame still shares) while it is read.@@ -25,7 +25,7 @@ use crate::painting::layer_image_paint_facts::LayerImagePaintFactsTable;use crate::painting::paint_state::{CustomHighlightPseudoStyles, PaintState, SelectionPseudoStyles};use crate::painting::paintable_data::{CommittedSideData, PaintableData};use crate::painting::paintable_rows::{CommittedFragmentLinkSlot, PAINTABLE_SLOTS_PER_CHUNK};-use crate::painting::record::damage::FrameDamage;+use crate::painting::record::change_ticks::{PaintChangeStamps, PaintGeneration};use crate::painting::replaced_paint_facts::ReplacedPaintFactsTable;use crate::painting::selection::{CustomHighlights, HighlightPseudoElement, SearchTextHighlights, SelectionRange, SpellingErrorHighlights,@@ -55,6 +55,7 @@ pub(crate) struct PublishedRows {pub(super) ink_overflow: ColumnSnapshot<crate::painting::ink_overflow::InkOverflow, PAINTABLE_SLOTS_PER_CHUNK>,pub(crate) ink_overflow_stamp: u64,pub(crate) hit_test_items_stamp: u64,+ pub(super) paint_change_stamps: ColumnSnapshot<PaintChangeStamps, PAINTABLE_SLOTS_PER_CHUNK>,pub(super) nodes: ColumnSnapshot<PaintNode, PUBLISHED_ROWS_PER_CHUNK>,pub(super) paint_facts: PublishedPaintFacts,pub(super) rows: ColumnSnapshot<PaintableData, PAINTABLE_SLOTS_PER_CHUNK>,@@ -133,6 +134,16 @@ impl PublishedRows {)}+ pub(crate) fn paint_change_stamps(&self, id: NodeSlotId) -> PaintChangeStamps {+ if !self.paintable_row_is_populated(id) {+ return PaintChangeStamps::default();+ }+ self.paint_change_stamps+ .get(id.slot_index() as usize)+ .copied()+ .unwrap_or_default()+ }+pub(crate) fn committed_side_data(&self, id: NodeSlotId) -> &CommittedSideData {debug_assert!(self.paintable_row_is_populated(id));self.side_data@@ -231,13 +242,14 @@ impl PublishedPaintState {}}-/// What a document published for one recording to read: its rows, its paint damage and the paint-/// state the recording reads, with a lease on the style records its rows name. [`LayoutNodeArena::freeze_frame`] is+/// What a document published for one recording to read: its rows, the paint generation it was published as of and the+/// paint state the recording reads, with a lease on the style records its rows name. [`LayoutNodeArena::freeze_frame`] is/// its only constructor and it has no `Clone`: a recording takes a frame and drops it before it returns, and nothing/// keeps one past the next write to the arena.pub(crate) struct PublishedFrame {pub(super) rows: PublishedRows,- damage: FrameDamage,+ paint_generation: PaintGeneration,+ everything_changed_at: PaintGeneration,paint_state: PublishedPaintState,_style_records: StyleRecordLease,}@@ -258,7 +270,8 @@ impl LayoutNodeArena {let rows = self.publish_rows();PublishedFrame {rows,- damage: self.paint_damage_for_frame(),+ paint_generation: self.take_paint_generation(),+ everything_changed_at: self.everything_changed_at(),paint_state: PublishedPaintState::new(self.paint_state()),_style_records: self.with_style_store(|engine| engine.lease_style_records()),}@@ -271,9 +284,13 @@ impl PublishedFrame {&self.paint_state}- /// The paint damage the frame was published with.- pub(crate) fn damage(&self) -> &FrameDamage {- &self.damage+ /// The generation the frame was published as of.+ pub(crate) fn paint_generation(&self) -> PaintGeneration {+ self.paint_generation+ }++ pub(crate) fn everything_paints_anew_since(&self, as_of: PaintGeneration) -> bool {+ self.everything_changed_at > as_of}/// The SVG paint resources the frame was published with.@@ -415,7 +432,7 @@ mod tests {arena.with_committed_fragment_link(node, |link| link.map(|link| link.placement.insets.top)));assert!(*source.committed_side_data(node) == *arena.committed_side_data(node));- assert_eq!(source.paint_damage_of_row(node), arena.paint_damage_of_row(node));+ assert_eq!(source.paint_change_stamps(node), arena.paint_change_stamps(node));assert!(source.stacking_context_entries(node).is_none() == arena.stacking_context_entries(node).is_none());}}diff --git a/Libraries/LibWeb/Rust/src/painting/record/assemble.rs b/Libraries/LibWeb/Rust/src/painting/record/assemble.rsindex 7205df1e234..8d8ce73de17 100644--- a/Libraries/LibWeb/Rust/src/painting/record/assemble.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/assemble.rs@@ -4,11 +4,11 @@* SPDX-License-Identifier: BSD-2-Clause*/-//! Assembles a frame from the scopes the published recording walked and the pushed damage. A walked scope whose-//! owner has no damage below it and has not moved is reused whole. Otherwise its plan is walked: each run of items-//! reuses the chunk the published recording recorded it into, or is recorded again into a chunk of its own, from its-//! first item to its last, when damage reaches it or an ancestor moved it. Nothing is validated on the way: when-//! assembly starts, the damage set is complete by construction.+//! Assembles a frame from the scopes the published recording walked and what changed since. A walked scope whose+//! owner and paint subtree were stamped with no generation newer than the published recording, and which has not+//! moved, is reused whole. Otherwise its plan is walked: each run of items reuses the chunk the published recording+//! recorded it into, or is recorded again into a chunk of its own, from its first item to its last, when something it+//! reads changed or an ancestor moved it.use super::PaintPhase;use super::order_tree::{@@ -17,10 +17,8 @@ use super::order_tree::{};use crate::css::style::fast_hash::FastMap;use crate::layout::node_data::NodeSlotId;-use crate::painting::paint_order_plan::{- PaintOrderItem, PaintProducer, PaintScope, PaintScopeKind, StackingContextPaintPhase,-};-use crate::painting::record::damage::PaintDamage;+use crate::painting::paint_order_plan::{PaintOrderItem, PaintProducer, PaintScope};+use crate::painting::record::change_ticks::RowChanges;use smallvec::SmallVec;use std::sync::Arc;@@ -120,11 +118,11 @@ pub(crate) trait AssemblyHost {/// nothing was.fn take_run_chunk(&mut self) -> Option<Arc<RecordedChunk>>;- /// The damage pushed for a row since the published recording, with the hint that something below it was- /// damaged.- fn damage_of_row(&mut self, row: NodeSlotId) -> PaintDamage;+ /// What changed of a row since the published recording: what its own producers read, its place in paint order,+ /// or something in its paint subtree.+ fn changes_of_row(&mut self, row: NodeSlotId) -> RowChanges;- /// Where a row's boxes are. A row an ancestor moved records again though nothing was pushed for it.+ /// Where a row's boxes are. A row an ancestor moved records again though nothing stamped it.fn placement_of_row(&mut self, row: NodeSlotId) -> RowPlacement;fn producer_reads_descendants(&mut self, owner: NodeSlotId, kind: ProducerKind) -> bool;@@ -138,22 +136,15 @@ enum SegmentKey {Walked(PaintScope),}-/// Whether the published recording can be returned as it is: nothing was pushed, and nothing in it is recorded every-/// frame or read a window focus that changed.-pub(crate) fn frame_is_unchanged(published_root: &RecordedScope, has_damage: bool, window_focus_changed: bool) -> bool {+/// Whether the published recording can be returned as it is: nothing changed since, and nothing in it is recorded+/// every frame or read a window focus that changed.+pub(crate) fn frame_is_unchanged(+ published_root: &RecordedScope,+ anything_changed: bool,+ window_focus_changed: bool,+) -> bool {let facts = published_root.facts;- !has_damage && !facts.live && !(window_focus_changed && facts.reads_window_focus)-}--// The damage of a scope's owner that cannot change what the scope records. The scope of a box's backgrounds and-// borders holds none of the foreground, outline and overlay producers of the box, and none of its SVG content.-fn owner_damage_that_misses(kind: PaintScopeKind) -> PaintDamage {- match kind {- PaintScopeKind::Descendants(StackingContextPaintPhase::BackgroundAndBorders) => {- PaintDamage::DRAW_FOREGROUND | PaintDamage::DRAW_OUTLINE | PaintDamage::DRAW_OVERLAY | PaintDamage::SVG- }- _ => PaintDamage::NONE,- }+ !anything_changed && !facts.live && !(window_focus_changed && facts.reads_window_focus)}pub(crate) struct Assembler<'a, H: AssemblyHost> {@@ -188,16 +179,13 @@ impl<'a, H: AssemblyHost> Assembler<'a, H> {}fn scope_is_clean(&mut self, scope: PaintScope, recorded_placement: RowPlacement) -> bool {- self.host- .damage_of_row(scope.owner)- .without(owner_damage_that_misses(scope.kind))- .is_empty()- && self.host.placement_of_row(scope.owner) == recorded_placement+ !self.host.changes_of_row(scope.owner).any() && self.host.placement_of_row(scope.owner) == recorded_placement}- fn producer_is_damaged(&mut self, owner: NodeSlotId, kind: ProducerKind, damage: PaintDamage) -> bool {- damage.intersects(kind.damage() | PaintDamage::MOVED)- || (damage.contains(PaintDamage::DESCENDANT_READERS) && self.host.producer_reads_descendants(owner, kind))+ fn producer_records_again(&mut self, owner: NodeSlotId, kind: ProducerKind, owner_changes: RowChanges) -> bool {+ owner_changes.inputs+ || (owner_changes.scroll_metadata && kind == ProducerKind::ScrollMetadata)+ || (owner_changes.below && self.host.producer_reads_descendants(owner, kind))}fn plan_and_cut(&mut self, scope: PaintScope) -> SegmentedPlan {@@ -244,23 +232,17 @@ impl<'a, H: AssemblyHost> Assembler<'a, H> {}}- /// Walks the plan of `scope`, which damage reaches or the published recording did not walk.+ /// Walks the plan of `scope`, which changed or the published recording did not walk.fn walk_scope(&mut self, scope: PaintScope, published: Option<&Arc<RecordedScope>>) -> Arc<RecordedScope> {- let owner_damage = self.host.damage_of_row(scope.owner);+ let owner_changes = self.host.changes_of_row(scope.owner);let owner_placement = self.host.placement_of_row(scope.owner);- let order_damage = match scope.kind {- PaintScopeKind::PaintedAsStackingContext => {- PaintDamage::ORDER | PaintDamage::CONTEXT_ORDER | PaintDamage::ELIGIBILITY- }- PaintScopeKind::Descendants(_) => PaintDamage::ORDER,- };let owner_moved = published.is_some_and(|published| published.owner_placement != owner_placement);let published_plan = published- .filter(|_| !owner_damage.intersects(order_damage))+ .filter(|_| !owner_changes.order).map(|published| &published.plan);let items_were_kept = published_plan.is_some();- // Nothing was pushed for the owner or anything below it, and nothing moved it: every item is where it was.- let cuts_were_kept = items_were_kept && owner_damage.is_empty() && !owner_moved;+ // Nothing changed of the owner or anything below it, and nothing moved it: every item is where it was.+ let cuts_were_kept = items_were_kept && !owner_changes.any() && !owner_moved;let plan = match published_plan {Some(published_plan) if cuts_were_kept => Arc::clone(published_plan),Some(published_plan) => Arc::new(self.cut(scope, published_plan.active, Arc::clone(&published_plan.items))),@@ -291,7 +273,7 @@ impl<'a, H: AssemblyHost> Assembler<'a, H> {scope,plan.items_of(run),published_segment,- owner_damage,+ owner_changes,owner_moved,)),Segment::Walked(item) => {@@ -326,7 +308,7 @@ impl<'a, H: AssemblyHost> Assembler<'a, H> {scope: PaintScope,items: &[PaintOrderItem],published: Option<&RecordedSegment>,- owner_damage: PaintDamage,+ owner_changes: RowChanges,owner_moved: bool,) -> RecordedRun {let published = published.and_then(|segment| match segment {@@ -339,7 +321,7 @@ impl<'a, H: AssemblyHost> Assembler<'a, H> {&& !owner_moved&& !self.records_again(run.facts)&& run.chunk.as_ref().is_none_or(|chunk| chunk.finished().is_some())- && self.run_is_clean(scope, items, run, owner_damage)+ && self.run_is_clean(scope, items, run, owner_changes){for item in items {match *item {@@ -384,13 +366,13 @@ impl<'a, H: AssemblyHost> Assembler<'a, H> {scope: PaintScope,items: &[PaintOrderItem],published: &RecordedRun,- owner_damage: PaintDamage,+ owner_changes: RowChanges,) -> bool {let mut child_scope_placements = published.child_scope_placements.iter();items.iter().all(|item| match *item {PaintOrderItem::Producer(producer) => !producer_kinds(producer).into_iter()- .any(|kind| self.producer_is_damaged(scope.owner, kind, owner_damage)),+ .any(|kind| self.producer_records_again(scope.owner, kind, owner_changes)),PaintOrderItem::Scope(child) => {let recorded_placement = child_scope_placements.next()@@ -485,6 +467,7 @@ mod tests {use crate::painting::display_list::builder::RecordedDisplayList;use crate::painting::display_list::recorder::DisplayListRecorder;use crate::painting::force_dark::ForceDarkRole;+ use crate::painting::paint_order_plan::{PaintScopeKind, StackingContextPaintPhase};use libgfx_rust::{Color, IntRect};use std::collections::{HashMap, HashSet};@@ -558,7 +541,7 @@ mod tests {struct TestHost {plans: HashMap<PaintScope, ScopePlan>,contents: HashMap<(NodeSlotId, ProducerKind), Content>,- damage: HashMap<NodeSlotId, PaintDamage>,+ changes: HashMap<NodeSlotId, RowChanges>,origins: HashMap<NodeSlotId, i64>,walked: HashSet<PaintScope>,grid_rows: HashMap<NodeSlotId, i32>,@@ -574,7 +557,7 @@ mod tests {Self {plans: HashMap::new(),contents: HashMap::new(),- damage: HashMap::new(),+ changes: HashMap::new(),origins: HashMap::new(),walked: HashSet::new(),grid_rows: HashMap::new(),@@ -602,8 +585,15 @@ mod tests {self.contents.insert((owner, kind), content);}- fn push(&mut self, owner: NodeSlotId, damage: PaintDamage) {- *self.damage.entry(owner).or_default() |= damage;+ fn change(&mut self, owner: NodeSlotId, paint_ancestors: &[NodeSlotId]) {+ self.changes.entry(owner).or_default().inputs = true;+ for ancestor in paint_ancestors {+ self.changes.entry(*ancestor).or_default().below = true;+ }+ }++ fn change_order(&mut self, owner: NodeSlotId) {+ self.changes.entry(owner).or_default().order = true;}fn recorded_rows(&self) -> Vec<u32> {@@ -675,8 +665,8 @@ mod tests {(!chunk.records.is_empty()).then(|| RecordedChunk::new(chunk, false))}- fn damage_of_row(&mut self, row: NodeSlotId) -> PaintDamage {- self.damage.get(&row).copied().unwrap_or_default()+ fn changes_of_row(&mut self, row: NodeSlotId) -> RowChanges {+ self.changes.get(&row).copied().unwrap_or_default()}fn placement_of_row(&mut self, row: NodeSlotId) -> RowPlacement {@@ -728,10 +718,10 @@ mod tests {record_frame_with_focus_change(host, false)}- // Publishes `frame`: the next frame copies from it, and the damage it painted is consumed.+ // Publishes `frame`: the next frame reuses from it, and asks what changed since.fn publish(host: &mut TestHost, frame: Frame) {host.source = Some(frame);- host.damage.clear();+ host.changes.clear();}fn assert_matches_from_scratch(host: &mut TestHost, assembled: &Frame) {@@ -816,7 +806,7 @@ mod tests {}#[test]- fn damage_records_the_run_it_reaches_and_the_runs_beside_it_are_copied() {+ fn a_change_records_the_runs_that_hold_the_row_and_the_runs_beside_them_are_reused() {let mut host = cards_host();let first = record_frame(&mut host);publish(&mut host, first);@@ -824,23 +814,23 @@ mod tests {.get_mut(&(row(3), ProducerKind::DrawForeground)).unwrap().version = 2;- host.push(row(3), PaintDamage::DRAW_FOREGROUND);- host.push(row(0), PaintDamage::DESCENDANT_READERS);+ host.change(row(3), &[row(0)]);let frame = record_frame(&mut host);- // Only the foregrounds of the second grid row record again: foreground damage misses the run of the- // card's background.- assert_eq!(host.recorded_rows(), vec![3, 4]);+ // The backgrounds and then the foregrounds of the second grid row record again: the card's stamp says that+ // it changed, not which of its producers did.+ assert_eq!(host.recorded_rows(), vec![3, 4, 3, 4]);assert_eq!(host.action_of(context(row(0))), Some(ScopeAction::Assembled));- assert!(host.copied_scopes().contains(&backgrounds(row(3))));+ assert!(!host.copied_scopes().contains(&backgrounds(row(3))));+ assert!(host.copied_scopes().contains(&backgrounds(row(5))));assert!(host.copied_scopes().contains(&foreground(row(2))));assert!(!host.copied_scopes().contains(&foreground(row(4))));assert_matches_from_scratch(&mut host, &frame);}#[test]- fn a_walked_child_is_copied_whole_until_damage_reaches_below_it() {+ fn a_walked_child_is_reused_whole_until_something_below_it_changes() {let mut host = cards_host();host.walked.insert(foreground(row(4)));host.plan(@@ -853,10 +843,9 @@ mod tests {let first = record_frame(&mut host);publish(&mut host, first);- // Damage beside the walked child leaves it copied as one piece, with the node the published recording+ // A change beside the walked child leaves it reused as one piece, with the node the published recording// kept for it.- host.push(row(1), PaintDamage::DRAW_FOREGROUND);- host.push(row(0), PaintDamage::DESCENDANT_READERS);+ host.change(row(1), &[row(0)]);let second = record_frame(&mut host);assert!(host.copied_scopes().contains(&foreground(row(4))));assert_eq!(host.action_of(foreground(row(4))), None);@@ -878,15 +867,14 @@ mod tests {assert_matches_from_scratch(&mut host, &second);publish(&mut host, second);- // Damage below it has it walked, and the run the damage reaches recorded. The hint that something below the- // card was damaged does not say in which of its scopes, so the run with the card's backgrounds records too.+ // A change below it has it walked, and the run that holds the changed row recorded. The stamp that something+ // below the card changed does not say in which of its scopes, so the run with the card's backgrounds records+ // too.host.contents.get_mut(&(row(7), ProducerKind::DrawForeground)).unwrap().version = 2;- host.push(row(7), PaintDamage::DRAW_FOREGROUND);- host.push(row(4), PaintDamage::DESCENDANT_READERS);- host.push(row(0), PaintDamage::DESCENDANT_READERS);+ host.change(row(7), &[row(4), row(0)]);let third = record_frame(&mut host);assert_eq!(host.action_of(foreground(row(4))), Some(ScopeAction::Assembled));assert_eq!(host.recorded_rows(), vec![3, 4, 7]);@@ -894,7 +882,7 @@ mod tests {}#[test]- fn a_child_scope_an_ancestor_moved_records_again_though_nothing_was_pushed_for_it() {+ fn a_child_scope_an_ancestor_moved_records_again_though_nothing_stamped_it() {let mut host = cards_host();let first = record_frame(&mut host);publish(&mut host, first);@@ -918,7 +906,7 @@ mod tests {host.grid_rows.insert(row(7), 3);host.plan(foreground(row(7)), true, &[phase(PaintPhase::Foreground)]);host.produce(row(7), ProducerKind::DrawForeground, content(1));- host.push(row(0), PaintDamage::ORDER);+ host.change_order(row(0));let frame = record_frame(&mut host);@@ -959,7 +947,7 @@ mod tests {publish(&mut host, first);let items = host.plans[&context(row(0))].items.to_vec();host.plan(context(row(0)), false, &items);- host.push(row(0), PaintDamage::ELIGIBILITY);+ host.change_order(row(0));let frame = record_frame(&mut host);diff --git a/Libraries/LibWeb/Rust/src/painting/record/change_ticks.rs b/Libraries/LibWeb/Rust/src/painting/record/change_ticks.rsnew file mode 100644index 00000000000..05f7a370840--- /dev/null+++ b/Libraries/LibWeb/Rust/src/painting/record/change_ticks.rs@@ -0,0 +1,532 @@+/*+ * Copyright (c) 2026-present, the Ladybird developers.+ *+ * SPDX-License-Identifier: BSD-2-Clause+ */++//! When each row's paint output last had reason to change.+//!+//! A write to what a row paints stamps the row with the document's current paint generation, and stamps each paint+//! ancestor with it as something that changed below, up to the first one already stamped so in that generation. A+//! reader takes a generation as it reads the rows, and asks later whether a stamp is newer: a recording reuses what one+//! recorded as of an older generation where nothing it read was stamped since. Nothing is consumed or cleared, so each+//! reader keeps its own "as of", and a write stamped that changed nothing costs a recording that comes out the same.++use crate::layout::LayoutNodeArena;+use crate::layout::node_data::NodeSlotId;+use crate::painting::node_painting;+use crate::painting::paint_order;+use crate::painting::paint_read::GeometryRead;++pub(crate) type PaintGeneration = u64;++/// What a write changed of a row, which says what learns of it besides the recordings: what the row draws, what it+/// tells the compositor about scrolling, what it can be hit by, its place in paint order and how it places what it+/// holds, or where its boxes are.+#[derive(Clone, Copy, Default, PartialEq, Eq)]+pub(crate) struct RowPaintChange(u8);++impl RowPaintChange {+ pub(crate) const NONE: Self = Self(0);+ pub(crate) const DRAWING: Self = Self(1 << 0);+ pub(crate) const SCROLL_METADATA: Self = Self(1 << 1);+ pub(crate) const HIT_TESTING: Self = Self(1 << 2);+ pub(crate) const ORDER: Self = Self(1 << 3);+ pub(crate) const PLACE: Self = Self(1 << 4);+ pub(crate) const EVERYTHING_IT_PAINTS: Self = Self(Self::DRAWING.0 | Self::SCROLL_METADATA.0 | Self::HIT_TESTING.0);++ pub(crate) const fn is_empty(self) -> bool {+ self.0 == 0+ }++ pub(crate) const fn intersects(self, other: Self) -> bool {+ self.0 & other.0 != 0+ }+}++impl std::ops::BitOr for RowPaintChange {+ type Output = Self;++ fn bitor(self, other: Self) -> Self {+ Self(self.0 | other.0)+ }+}++impl std::ops::BitOrAssign for RowPaintChange {+ fn bitor_assign(&mut self, other: Self) {+ self.0 |= other.0;+ }+}++impl std::fmt::Debug for RowPaintChange {+ fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+ const NAMES: [(RowPaintChange, &str); 5] = [+ (RowPaintChange::DRAWING, "drawing"),+ (RowPaintChange::SCROLL_METADATA, "scroll-metadata"),+ (RowPaintChange::HIT_TESTING, "hit-testing"),+ (RowPaintChange::ORDER, "order"),+ (RowPaintChange::PLACE, "place"),+ ];+ let mut list = formatter.debug_set();+ for (change, name) in NAMES {+ if self.intersects(change) {+ list.entry(&format_args!("{name}"));+ }+ }+ list.finish()+ }+}++#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]+pub(crate) struct PaintChangeStamps {+ /// What the row's own producers read: its style, its geometry, its paint facts and where it is.+ pub(crate) inputs_changed_at: PaintGeneration,+ /// What the row tells the compositor about scrolling, which only its scroll metadata producer reads.+ pub(crate) scroll_metadata_changed_at: PaintGeneration,+ /// Its place in paint order, and how it places what it holds.+ pub(crate) order_changed_at: PaintGeneration,+ /// Anything in its paint subtree.+ pub(crate) changed_below_at: PaintGeneration,+}++#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]+pub(crate) struct RowChanges {+ pub(crate) inputs: bool,+ pub(crate) scroll_metadata: bool,+ pub(crate) order: bool,+ pub(crate) below: bool,+}++impl RowChanges {+ pub(crate) const NONE: Self = Self {+ inputs: false,+ scroll_metadata: false,+ order: false,+ below: false,+ };++ pub(crate) fn any(self) -> bool {+ self.inputs || self.scroll_metadata || self.order || self.below+ }+}++impl PaintChangeStamps {+ pub(crate) fn of_a_row_new_to_the_document(generation_writes_stamp_with: PaintGeneration) -> Self {+ Self {+ inputs_changed_at: generation_writes_stamp_with,+ scroll_metadata_changed_at: generation_writes_stamp_with,+ order_changed_at: generation_writes_stamp_with,+ changed_below_at: 0,+ }+ }++ pub(crate) fn changes_since(&self, as_of: PaintGeneration) -> RowChanges {+ RowChanges {+ inputs: self.inputs_changed_at > as_of,+ scroll_metadata: self.scroll_metadata_changed_at > as_of,+ order: self.order_changed_at > as_of,+ below: self.changed_below_at > as_of,+ }+ }++ fn newest(&self) -> PaintGeneration {+ self.inputs_changed_at+ .max(self.scroll_metadata_changed_at)+ .max(self.order_changed_at)+ .max(self.changed_below_at)+ }++ pub(crate) fn row_or_anything_below_it_changed_since(&self, as_of: PaintGeneration) -> bool {+ self.newest() > as_of+ }+}++#[derive(Clone)]+pub(crate) struct PaintGenerations {+ generation_writes_stamp_with: PaintGeneration,+ everything_changed_at: PaintGeneration,+}++impl Default for PaintGenerations {+ fn default() -> Self {+ Self {+ generation_writes_stamp_with: 1,+ everything_changed_at: 1,+ }+ }+}++impl PaintGenerations {+ pub(crate) fn generation_writes_stamp_with(&self) -> PaintGeneration {+ self.generation_writes_stamp_with+ }+}++impl LayoutNodeArena {+ pub(crate) fn take_paint_generation(&mut self) -> PaintGeneration {+ let generations = &mut self.paintable_rows.paint_generations;+ let taken = generations.generation_writes_stamp_with;+ generations.generation_writes_stamp_with = taken.checked_add(1).expect("paint generations do not run out");+ taken+ }++ pub(crate) fn paint_change_stamps(&self, row: NodeSlotId) -> PaintChangeStamps {+ if !self.paintable_row_is_populated(row) {+ return PaintChangeStamps::default();+ }+ self.paintable_rows+ .paint_change_stamps+ .get(row.slot_index() as usize)+ .copied()+ .unwrap_or_default()+ }++ pub(crate) fn everything_paints_anew_since(&self, as_of: PaintGeneration) -> bool {+ self.paintable_rows.paint_generations.everything_changed_at > as_of+ }++ pub(crate) fn everything_changed_at(&self) -> PaintGeneration {+ self.paintable_rows.paint_generations.everything_changed_at+ }++ fn stamp(&mut self, row: NodeSlotId, stamp: impl FnOnce(&mut PaintChangeStamps, PaintGeneration)) {+ let current = self.paintable_rows.paint_generations.generation_writes_stamp_with;+ let index = row.slot_index() as usize;+ let mut stamps = self.paint_change_stamps(row);+ stamp(&mut stamps, current);+ self.paintable_rows+ .paint_change_stamps+ .set(index, stamps)+ .expect("a populated row has stamps");+ }++ pub(crate) fn note_paint_change(&mut self, row: NodeSlotId, change: RowPaintChange) {+ if change.is_empty() || !self.paintable_row_is_populated(row) {+ return;+ }+ if change.intersects(RowPaintChange::HIT_TESTING | RowPaintChange::PLACE | RowPaintChange::ORDER) {+ self.note_hit_test_items_changed();+ }+ if change.intersects(RowPaintChange::DRAWING | RowPaintChange::PLACE | RowPaintChange::ORDER) {+ self.request_ink_overflow_recalculation(row);+ self.request_inline_ink_overflow_recalculation(row);+ if change.intersects(RowPaintChange::PLACE) {+ self.request_containing_block_ink_overflow_recalculation(row);+ }+ }+ let changes_inputs = change.intersects(RowPaintChange::DRAWING | RowPaintChange::PLACE);+ let changes_scroll_metadata = change.intersects(RowPaintChange::SCROLL_METADATA);+ let changes_order = change.intersects(RowPaintChange::ORDER);+ if !changes_inputs && !changes_scroll_metadata && !changes_order {+ return;+ }+ self.stamp(row, |stamps, current| {+ if changes_inputs {+ stamps.inputs_changed_at = current;+ }+ if changes_scroll_metadata {+ stamps.scroll_metadata_changed_at = current;+ }+ if changes_order {+ stamps.order_changed_at = current;+ }+ });+ self.stamp_paint_ancestors_as_changed_below(row);+ }++ // Producers that read what is below them, such as an SVG root or a snap container's scroll metadata, learn of a+ // change below them from this stamp. The walk stops at the first ancestor stamped so in this generation.+ fn stamp_paint_ancestors_as_changed_below(&mut self, row: NodeSlotId) {+ let current = self.paintable_rows.paint_generations.generation_writes_stamp_with;+ let mut current_row = row;+ while let Some(ancestor) = self.paint_ancestor_for_change_stamps(current_row) {+ if self.paint_change_stamps(ancestor).changed_below_at == current {+ break;+ }+ self.stamp(ancestor, |stamps, current| stamps.changed_below_at = current);+ current_row = ancestor;+ }+ }++ // Resource subtrees (masks, clips, patterns) are not painted where they sit in the layout tree but by the element+ // referencing them; the stamp continues from the nearest painted layout ancestor so a change inside the resource+ // reaches the content painted around it.+ fn paint_ancestor_for_change_stamps(&self, row: NodeSlotId) -> Option<NodeSlotId> {+ let rows = self.paintable_rows();+ if let Some(parent) = paint_order::paint_parent(&rows, row) {+ return Some(parent);+ }+ if !self+ .node_kind_if_live(row)+ .is_some_and(crate::layout::node_facts::kind_is_svg_resource_box)+ {+ return None;+ }+ let mut ancestor = self.node_parent_if_live(row);+ while let Some(node) = ancestor {+ if rows.paintable_row_is_populated(node) {+ return Some(node);+ }+ ancestor = self.node_parent_if_live(node);+ }+ None+ }++ pub(crate) fn note_paint_change_in_paint_subtree(&mut self, root: NodeSlotId, change: RowPaintChange) {+ let mut subtree = Vec::new();+ paint_order::for_each_in_paint_subtree(&self.paintable_rows(), root, |row| subtree.push(row));+ for row in subtree {+ self.note_paint_change(row, change);+ }+ }++ /// The fan-out of a style repaint: the row, the anonymous boxes it generated, and for an inline the ancestors up to+ /// the line root that paints its pieces.+ pub(crate) fn note_paint_change_for_repaint(&mut self, row: NodeSlotId, change: RowPaintChange) {+ let mut repainted_rows = smallvec::SmallVec::<[NodeSlotId; 4]>::new();+ self.paintable_rows()+ .for_each_row_repainted_with(row, |repainted| repainted_rows.push(repainted));+ for repainted in repainted_rows {+ self.note_paint_change(repainted, change);+ }+ }++ /// The row's producers and scopes are listed by the plans of its nearest paint ancestor; resolved now, while the+ /// links are intact, for rows about to appear, disappear or move. The ancestor's content changed below it as well.+ pub(crate) fn note_enclosing_paint_order_change(&mut self, node: NodeSlotId) {+ if let Some(owner) = self.enclosing_paint_order_owner(node) {+ // A line's plan also places content nested inside ordinary inline boxes. Changes there must reach the+ // block or self-painting inline that owns it.+ let rows = self.paintable_rows();+ let line_owner = node_painting::is_fragmented_inline(&rows, owner)+ .then(|| {+ crate::painting::fragment_ownership::nearest_self_painting_inline_box(&rows, node)+ .unwrap_or(rows.paintable_data(owner).containing_block)+ })+ .filter(|line_owner| !line_owner.is_invalid());+ self.note_paint_change(owner, RowPaintChange::ORDER);+ if self.paintable_row_is_populated(owner) {+ self.stamp(owner, |stamps, current| stamps.changed_below_at = current);+ }+ if let Some(line_owner) = line_owner {+ self.note_paint_change(line_owner, RowPaintChange::ORDER);+ }+ }+ }++ fn enclosing_paint_order_owner(&self, node: NodeSlotId) -> Option<NodeSlotId> {+ let rows = self.paintable_rows();+ if rows.paintable_row_is_populated(node) {+ return paint_order::paint_parent(&rows, node);+ }+ let mut ancestor = self.node_parent_if_live(node);+ while let Some(current) = ancestor {+ if rows.paintable_row_is_populated(current) {+ return Some(current);+ }+ ancestor = self.node_parent_if_live(current);+ }+ None+ }++ pub(crate) fn note_hit_test_items_changed(&mut self) {+ self.paintable_rows.hit_test_items_stamp = crate::cow_column::new_edit_token();+ }++ pub(crate) fn note_everything_paints_anew(&mut self) {+ self.note_hit_test_items_changed();+ let generations = &mut self.paintable_rows.paint_generations;+ generations.everything_changed_at = generations.generation_writes_stamp_with;+ }+}++#[cfg(test)]+mod tests {+ use super::*;+ use crate::layout::node_data::NodeKind;++ fn populated_child(arena: &mut LayoutNodeArena, parent: NodeSlotId) -> NodeSlotId {+ let row = arena.allocate_for_test().slot;+ arena.write_shape(row).set_kind(NodeKind::Box);+ if !parent.is_invalid() {+ arena.insert_child(parent, row, NodeSlotId::INVALID);+ }+ arena.populate_paintable_row(row);+ row+ }++ #[test]+ fn a_write_is_newer_than_every_generation_a_reader_took_before_it() {+ let mut arena = LayoutNodeArena::new();+ let root = populated_child(&mut arena, NodeSlotId::INVALID);+ let child = populated_child(&mut arena, root);+ let unrelated = populated_child(&mut arena, root);+ let as_of = arena.take_paint_generation();++ arena.note_paint_change(child, RowPaintChange::DRAWING);++ assert_eq!(+ arena.paint_change_stamps(child).changes_since(as_of),+ RowChanges {+ inputs: true,+ ..RowChanges::NONE+ }+ );+ assert_eq!(+ arena.paint_change_stamps(root).changes_since(as_of),+ RowChanges {+ below: true,+ ..RowChanges::NONE+ }+ );+ assert!(+ !arena+ .paint_change_stamps(unrelated)+ .row_or_anything_below_it_changed_since(as_of)+ );+ // A reader that took its generation after the write finds nothing newer.+ let later = arena.take_paint_generation();+ assert!(+ !arena+ .paint_change_stamps(child)+ .row_or_anything_below_it_changed_since(later)+ );+ assert!(+ !arena+ .paint_change_stamps(root)+ .row_or_anything_below_it_changed_since(later)+ );+ }++ #[test]+ fn readers_keep_their_own_generation() {+ let mut arena = LayoutNodeArena::new();+ let root = populated_child(&mut arena, NodeSlotId::INVALID);+ let first = arena.take_paint_generation();+ arena.note_paint_change(root, RowPaintChange::ORDER);+ let second = arena.take_paint_generation();+ assert!(arena.paint_change_stamps(root).changes_since(first).order);+ assert!(!arena.paint_change_stamps(root).changes_since(second).order);+ assert!(!arena.paint_change_stamps(root).changes_since(first).inputs);+ }++ #[test]+ fn what_changes_only_what_can_be_hit_stamps_nothing_a_recording_reads() {+ let mut arena = LayoutNodeArena::new();+ let root = populated_child(&mut arena, NodeSlotId::INVALID);+ let as_of = arena.take_paint_generation();+ let hit_test_items_stamp = arena.paintable_rows.hit_test_items_stamp;+ arena.note_paint_change(root, RowPaintChange::HIT_TESTING);+ assert!(+ !arena+ .paint_change_stamps(root)+ .row_or_anything_below_it_changed_since(as_of)+ );+ assert_ne!(arena.paintable_rows.hit_test_items_stamp, hit_test_items_stamp);+ }++ #[test]+ fn what_changes_only_scroll_metadata_leaves_what_the_row_draws_as_it_was() {+ let mut arena = LayoutNodeArena::new();+ let root = populated_child(&mut arena, NodeSlotId::INVALID);+ let scroller = populated_child(&mut arena, root);+ let as_of = arena.take_paint_generation();++ arena.note_paint_change(scroller, RowPaintChange::SCROLL_METADATA);++ assert_eq!(+ arena.paint_change_stamps(scroller).changes_since(as_of),+ RowChanges {+ scroll_metadata: true,+ ..RowChanges::NONE+ }+ );+ assert!(arena.paint_change_stamps(root).changes_since(as_of).below);+ }++ #[test]+ fn a_change_below_a_row_new_to_the_document_reaches_the_rows_above_it() {+ let mut arena = LayoutNodeArena::new();+ let root = populated_child(&mut arena, NodeSlotId::INVALID);+ let as_of = arena.take_paint_generation();+ let new_row = populated_child(&mut arena, root);+ let below_new_row = populated_child(&mut arena, new_row);++ arena.note_paint_change(below_new_row, RowPaintChange::DRAWING);++ assert!(arena.paint_change_stamps(new_row).changes_since(as_of).inputs);+ assert!(arena.paint_change_stamps(root).changes_since(as_of).below);+ }++ #[test]+ fn order_changes_resolve_to_the_nearest_paint_ancestor_and_keep_siblings_clean() {+ let mut arena = LayoutNodeArena::new();+ let root = populated_child(&mut arena, NodeSlotId::INVALID);+ let owner = populated_child(&mut arena, root);+ let sibling = populated_child(&mut arena, root);+ let unpopulated = arena.allocate_for_test().slot;+ arena.write_shape(unpopulated).set_kind(NodeKind::InlineNode);+ arena.insert_child(owner, unpopulated, NodeSlotId::INVALID);+ let child = populated_child(&mut arena, unpopulated);+ let as_of = arena.take_paint_generation();++ arena.note_paint_order_changed(child);++ assert!(arena.paint_change_stamps(child).changes_since(as_of).order);+ assert!(arena.paint_change_stamps(owner).changes_since(as_of).order);+ assert!(arena.paint_change_stamps(root).changes_since(as_of).below);+ assert!(!arena.paint_change_stamps(root).changes_since(as_of).order);+ assert!(+ !arena+ .paint_change_stamps(sibling)+ .row_or_anything_below_it_changed_since(as_of)+ );+ }++ #[test]+ fn resource_subtrees_stamp_the_nearest_painted_layout_ancestor() {+ let mut arena = LayoutNodeArena::new();+ let root = populated_child(&mut arena, NodeSlotId::INVALID);+ let svg_root = populated_child(&mut arena, root);+ let mask = populated_child(&mut arena, svg_root);+ arena.write_shape(mask).set_kind(NodeKind::SVGMaskBox);+ let mask_content = populated_child(&mut arena, mask);+ let as_of = arena.take_paint_generation();++ arena.note_paint_change(mask_content, RowPaintChange::DRAWING);++ for ancestor in [mask, svg_root, root] {+ assert!(arena.paint_change_stamps(ancestor).changes_since(as_of).below);+ }+ }++ #[test]+ fn everything_paints_anew_for_readers_of_earlier_generations_only() {+ let mut arena = LayoutNodeArena::new();+ populated_child(&mut arena, NodeSlotId::INVALID);+ let before = arena.take_paint_generation();+ arena.note_everything_paints_anew();+ let after = arena.take_paint_generation();+ assert!(arena.everything_paints_anew_since(before));+ assert!(!arena.everything_paints_anew_since(after));+ }++ #[test]+ fn repaint_fan_out_reaches_anonymous_boxes_and_the_line_root_of_an_inline() {+ let mut arena = LayoutNodeArena::new();+ let line_root = populated_child(&mut arena, NodeSlotId::INVALID);+ arena.write_shape(line_root).set_kind(NodeKind::BlockContainer);+ let inline = populated_child(&mut arena, line_root);+ arena.write_shape(inline).set_kind(NodeKind::InlineNode);+ let anonymous = populated_child(&mut arena, inline);+ arena.write_shape(anonymous).set_kind(NodeKind::BlockContainer);+ arena.set_node_flag(anonymous, crate::layout::node_data::NodeFlag::Anonymous, true);+ let as_of = arena.take_paint_generation();++ arena.note_paint_change_for_repaint(inline, RowPaintChange::DRAWING);++ for row in [inline, anonymous, line_root] {+ assert!(arena.paint_change_stamps(row).changes_since(as_of).inputs);+ }+ }+}diff --git a/Libraries/LibWeb/Rust/src/painting/record/damage.rs b/Libraries/LibWeb/Rust/src/painting/record/damage.rsdeleted file mode 100644index af0c1f801d8..00000000000--- a/Libraries/LibWeb/Rust/src/painting/record/damage.rs+++ /dev/null@@ -1,725 +0,0 @@-/*- * Copyright (c) 2026-present, the Ladybird developers.- *- * SPDX-License-Identifier: BSD-2-Clause- */--//! Paint damage is pushed by every mutation site that changes what a row paints or where its-//! output sits in CSS paint order. Recording reads the accumulated set and validates nothing.--use crate::layout::LayoutNodeArena;-use crate::layout::node_data::NodeSlotId;-use crate::painting::node_painting;-use crate::painting::paint_order;-use crate::painting::paint_read::GeometryRead;--#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)]-pub(crate) struct PaintDamage(u32);--impl PaintDamage {- pub(crate) const NONE: Self = Self(0);-- // Producers of a row whose output must be recorded again.- pub(crate) const DRAW_BACKGROUND: Self = Self(1 << 0);- pub(crate) const DRAW_BORDER: Self = Self(1 << 1);- pub(crate) const DRAW_TABLE_COLLAPSED_BORDER: Self = Self(1 << 2);- pub(crate) const DRAW_FOREGROUND: Self = Self(1 << 3);- pub(crate) const DRAW_OUTLINE: Self = Self(1 << 4);- pub(crate) const DRAW_OVERLAY: Self = Self(1 << 5);- pub(crate) const HIT_BACKGROUND: Self = Self(1 << 6);- pub(crate) const HIT_FOREGROUND: Self = Self(1 << 7);- pub(crate) const HIT_OVERLAY: Self = Self(1 << 8);- pub(crate) const SCROLL_METADATA: Self = Self(1 << 9);- pub(crate) const SCOPE_PREAMBLE: Self = Self(1 << 10);- pub(crate) const SVG: Self = Self(1 << 11);- pub(crate) const ALL_DRAW: Self = Self(- Self::DRAW_BACKGROUND.0- | Self::DRAW_BORDER.0- | Self::DRAW_TABLE_COLLAPSED_BORDER.0- | Self::DRAW_FOREGROUND.0- | Self::DRAW_OUTLINE.0- | Self::DRAW_OVERLAY.0- | Self::SCOPE_PREAMBLE.0- | Self::SVG.0,- );- pub(crate) const ALL_HIT: Self = Self(Self::HIT_BACKGROUND.0 | Self::HIT_FOREGROUND.0 | Self::HIT_OVERLAY.0);- pub(crate) const ALL_PRODUCERS: Self = Self(Self::ALL_DRAW.0 | Self::ALL_HIT.0 | Self::SCROLL_METADATA.0);-- // The row's absolute position changed: every producer of the row and of each populated row- // in its layout subtree records again. The subtree is expanded when recording plans.- pub(crate) const MOVED: Self = Self(1 << 16);- // Every scope the row owns is planned again: the row places its own descendants- // differently, or a descendant it is the nearest paint ancestor of appeared, disappeared or- // changed how it is placed.- pub(crate) const ORDER: Self = Self(1 << 17);- // The stacking context rooted at the row composes its hoisted content differently.- pub(crate) const CONTEXT_ORDER: Self = Self(1 << 20);- // Whether the row's stacking context paints at all flipped.- pub(crate) const ELIGIBILITY: Self = Self(1 << 21);- // Some paint descendant was damaged: producers of this row that read descendants run again.- pub(crate) const DESCENDANT_READERS: Self = Self(1 << 22);-- pub(crate) const fn is_empty(self) -> bool {- self.0 == 0- }-- pub(crate) const fn contains(self, other: Self) -> bool {- self.0 & other.0 == other.0- }-- pub(crate) const fn without(self, other: Self) -> Self {- Self(self.0 & !other.0)- }-- pub(crate) const fn intersects(self, other: Self) -> bool {- self.0 & other.0 != 0- }-}--impl std::ops::BitOr for PaintDamage {- type Output = Self;-- fn bitor(self, other: Self) -> Self {- Self(self.0 | other.0)- }-}--impl std::ops::BitOrAssign for PaintDamage {- fn bitor_assign(&mut self, other: Self) {- self.0 |= other.0;- }-}--impl std::fmt::Debug for PaintDamage {- fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {- const NAMES: [(PaintDamage, &str); 17] = [- (PaintDamage::DRAW_BACKGROUND, "draw-background"),- (PaintDamage::DRAW_BORDER, "draw-border"),- (PaintDamage::DRAW_TABLE_COLLAPSED_BORDER, "draw-table-collapsed-border"),- (PaintDamage::DRAW_FOREGROUND, "draw-foreground"),- (PaintDamage::DRAW_OUTLINE, "draw-outline"),- (PaintDamage::DRAW_OVERLAY, "draw-overlay"),- (PaintDamage::HIT_BACKGROUND, "hit-background"),- (PaintDamage::HIT_FOREGROUND, "hit-foreground"),- (PaintDamage::HIT_OVERLAY, "hit-overlay"),- (PaintDamage::SCROLL_METADATA, "scroll-metadata"),- (PaintDamage::SCOPE_PREAMBLE, "scope-preamble"),- (PaintDamage::SVG, "svg"),- (PaintDamage::MOVED, "moved"),- (PaintDamage::ORDER, "order"),- (PaintDamage::CONTEXT_ORDER, "context-order"),- (PaintDamage::ELIGIBILITY, "eligibility"),- (PaintDamage::DESCENDANT_READERS, "descendant-readers"),- ];- let mut list = formatter.debug_set();- for (bit, name) in NAMES {- if self.contains(bit) {- list.entry(&format_args!("{name}"));- }- }- list.finish()- }-}--/// The per-row state of the retained paint output, kept next to the other parallel row vectors.-#[derive(Clone, Default)]-pub(crate) struct RowPaintState {- damage: PaintDamage,- // The recording sequence number the row was last pushed in; publication clears rows pushed- // before the recording it publishes started and keeps rows pushed after.- damage_stamp: u32,-}--impl RowPaintState {- pub(crate) fn damage(&self) -> PaintDamage {- self.damage- }-- pub(crate) fn clear(&mut self) {- self.damage = PaintDamage::NONE;- self.damage_stamp = 0;- }-- fn add(&mut self, damage: PaintDamage, stamp: u32) -> bool {- let before = self.damage;- self.damage = before | damage;- self.damage_stamp = stamp;- before.is_empty()- }-}--#[derive(Clone, Default)]-pub(crate) struct DamageSet {- // Every row whose damage is non-empty, listed once when its first bit is pushed. Entries of- // rows reset since are skipped by their slot generation.- rows: crate::fork_vec::ForkVec<NodeSlotId>,- // Zero, or the stamp the whole-document damage was pushed at.- all: u32,- scroll_metadata_everywhere: u32,- started_publishing_recordings: u32,- push_revision: u64,-}--impl DamageSet {- fn stamp_for_push(&self) -> u32 {- self.started_publishing_recordings + 1- }-}--/// The paint damage a recording reads: the rows damaged when its frame was published, with their-/// damage, and whether damage covered everything. It is the frame's own copy of the live set.-#[derive(Default)]-pub(crate) struct FrameDamage {- // Sorted by slot, holding each populated row with non-empty damage once.- rows: Vec<(NodeSlotId, PaintDamage)>,- all: bool,- scroll_metadata_everywhere: bool,-}--impl FrameDamage {- pub(crate) fn of_row(&self, row: NodeSlotId) -> PaintDamage {- self.rows- .binary_search_by_key(&(row.slot_index(), row.generation()), |(listed, _)| {- (listed.slot_index(), listed.generation())- })- .map_or(PaintDamage::NONE, |index| self.rows[index].1)- }-- #[cfg(test)]- pub(crate) fn rows(&self) -> impl Iterator<Item = NodeSlotId> + '_ {- self.rows.iter().map(|(row, _)| *row)- }-- pub(crate) fn covers_everything(&self) -> bool {- self.all- }-- pub(crate) fn scroll_metadata_everywhere(&self) -> bool {- self.scroll_metadata_everywhere- }-- pub(crate) fn is_empty(&self) -> bool {- !self.all && !self.scroll_metadata_everywhere && self.rows.is_empty()- }-- /// The damage a recording starts from, for the trace header.- pub(crate) fn summary(&self) -> crate::painting::record::trace::DamageSummary {- let mut summary = crate::painting::record::trace::DamageSummary {- all: self.all,- ..Default::default()- };- for (_, damage) in &self.rows {- summary.rows += 1;- summary.moved += usize::from(damage.contains(PaintDamage::MOVED));- summary.order += usize::from(damage.intersects(PaintDamage::ORDER | PaintDamage::CONTEXT_ORDER));- summary.eligibility += usize::from(damage.contains(PaintDamage::ELIGIBILITY));- }- summary- }-}--impl LayoutNodeArena {- /// Copies the damage pushed so far for a frame to publish.- pub(crate) fn paint_damage_for_frame(&self) -> FrameDamage {- let mut rows: Vec<(NodeSlotId, PaintDamage)> = self- .paintable_rows- .damage- .rows- .iter()- .filter(|row| self.paintable_row_is_populated(**row))- .filter_map(|&row| {- let damage = self.row_paint_state(row).damage();- (!damage.is_empty()).then_some((row, damage))- })- .collect();- rows.sort_unstable_by_key(|(row, _)| (row.slot_index(), row.generation()));- rows.dedup_by_key(|(row, _)| *row);- FrameDamage {- rows,- all: self.paint_damage_covers_everything(),- scroll_metadata_everywhere: self.scroll_metadata_damaged_everywhere(),- }- }-- pub(crate) fn row_paint_state(&self, row: NodeSlotId) -> &RowPaintState {- &self.paintable_rows.row_paint_states[row.slot_index() as usize]- }-- #[cfg(test)]- pub(crate) fn paint_damage_of_row(&self, row: NodeSlotId) -> PaintDamage {- if !self.paintable_row_is_populated(row) {- return PaintDamage::NONE;- }- self.row_paint_state(row).damage()- }-- pub(crate) fn push_paint_damage(&mut self, row: NodeSlotId, damage: PaintDamage) {- if damage.is_empty() || !self.paintable_row_is_populated(row) {- return;- }- if damage.intersects(- PaintDamage::ALL_HIT- | PaintDamage::MOVED- | PaintDamage::ORDER- | PaintDamage::CONTEXT_ORDER- | PaintDamage::ELIGIBILITY,- ) {- self.note_hit_test_items_changed();- }- if damage.intersects(PaintDamage::ALL_DRAW | PaintDamage::MOVED | PaintDamage::ORDER) {- self.request_ink_overflow_recalculation(row);- self.request_inline_ink_overflow_recalculation(row);- if damage.contains(PaintDamage::MOVED) {- self.request_containing_block_ink_overflow_recalculation(row);- }- }- self.paintable_rows.damage.push_revision += 1;- let stamp = self.paintable_rows.damage.stamp_for_push();- // Whole-document damage pushed for the same recording already covers every row.- if self.paintable_rows.damage.all == stamp {- return;- }- // A listed row already hinted its ancestors: every push hints up to the root or to an- // ancestor whose own push did, and publication hints again for the rows it keeps.- if self.paintable_rows.row_paint_states[row.slot_index() as usize].add(damage, stamp) {- self.paintable_rows.damage.rows.push(row);- self.hint_descendant_readers_above(row, stamp);- }- }-- // Producers that read descendants, such as an SVG root or a snap container's scroll- // metadata, learn about damage below them from this hint. The walk stops at the first- // ancestor already hinted.- fn hint_descendant_readers_above(&mut self, row: NodeSlotId, stamp: u32) {- let mut current = row;- while let Some(ancestor) = self.paint_ancestor_for_damage_hints(current) {- let state = &mut self.paintable_rows.row_paint_states[ancestor.slot_index() as usize];- if state.damage().contains(PaintDamage::DESCENDANT_READERS) {- break;- }- if state.add(PaintDamage::DESCENDANT_READERS, stamp) {- self.paintable_rows.damage.rows.push(ancestor);- }- current = ancestor;- }- }-- // Resource subtrees (masks, clips, patterns) are not painted where they sit in the layout- // tree but by the element referencing them; the hint continues from the nearest painted- // layout ancestor so a change inside the resource reaches the content painted around it.- fn paint_ancestor_for_damage_hints(&self, row: NodeSlotId) -> Option<NodeSlotId> {- let rows = self.paintable_rows();- if let Some(parent) = paint_order::paint_parent(&rows, row) {- return Some(parent);- }- if !self- .node_kind_if_live(row)- .is_some_and(crate::layout::node_facts::kind_is_svg_resource_box)- {- return None;- }- let mut ancestor = self.node_parent_if_live(row);- while let Some(node) = ancestor {- if rows.paintable_row_is_populated(node) {- return Some(node);- }- ancestor = self.node_parent_if_live(node);- }- None- }-- pub(crate) fn push_paint_damage_to_paint_subtree(&mut self, root: NodeSlotId, damage: PaintDamage) {- let mut subtree = Vec::new();- paint_order::for_each_in_paint_subtree(&self.paintable_rows(), root, |row| subtree.push(row));- for row in subtree {- self.push_paint_damage(row, damage);- }- }-- /// The fan-out of a style repaint: the row, the anonymous boxes it generated, and for an- /// inline the ancestors up to the line root that paints its pieces.- pub(crate) fn push_paint_damage_for_repaint(&mut self, row: NodeSlotId, damage: PaintDamage) {- let mut repainted_rows = smallvec::SmallVec::<[NodeSlotId; 4]>::new();- self.paintable_rows()- .for_each_row_repainted_with(row, |repainted| repainted_rows.push(repainted));- for repainted in repainted_rows {- self.push_paint_damage(repainted, damage);- }- }-- /// The row's producers and scopes are listed by the plans of its nearest paint ancestor;- /// resolved now, while the links are intact, for rows about to appear, disappear or move.- /// The ancestor's content changed below it as well.- pub(crate) fn push_enclosing_paint_order_damage(&mut self, node: NodeSlotId) {- if let Some(owner) = self.enclosing_paint_order_owner(node) {- // A line's plan also places content nested inside ordinary inline boxes.- // Changes there must reach the block or self-painting inline that owns it.- let rows = self.paintable_rows();- let line_owner = node_painting::is_fragmented_inline(&rows, owner)- .then(|| {- crate::painting::fragment_ownership::nearest_self_painting_inline_box(&rows, node)- .unwrap_or(rows.paintable_data(owner).containing_block)- })- .filter(|line_owner| !line_owner.is_invalid());- self.push_paint_damage(owner, PaintDamage::ORDER | PaintDamage::DESCENDANT_READERS);- if let Some(line_owner) = line_owner {- self.push_paint_damage(line_owner, PaintDamage::ORDER);- }- }- }-- fn enclosing_paint_order_owner(&self, node: NodeSlotId) -> Option<NodeSlotId> {- let rows = self.paintable_rows();- if rows.paintable_row_is_populated(node) {- return paint_order::paint_parent(&rows, node);- }- let mut ancestor = self.node_parent_if_live(node);- while let Some(current) = ancestor {- if rows.paintable_row_is_populated(current) {- return Some(current);- }- ancestor = self.node_parent_if_live(current);- }- None- }-- pub(crate) fn note_hit_test_items_changed(&mut self) {- self.paintable_rows.hit_test_items_stamp = crate::cow_column::new_edit_token();- }-- pub(crate) fn push_all_paint_damage(&mut self) {- self.note_hit_test_items_changed();- let set = &mut self.paintable_rows.damage;- set.push_revision += 1;- set.all = set.stamp_for_push();- }-- pub(crate) fn push_scroll_metadata_damage_everywhere(&mut self) {- let set = &mut self.paintable_rows.damage;- set.push_revision += 1;- set.scroll_metadata_everywhere = set.stamp_for_push();- }-- pub(crate) fn paint_damage_push_revision(&self) -> u64 {- self.paintable_rows.damage.push_revision- }-- pub(crate) fn paint_damage_covers_everything(&self) -> bool {- self.paintable_rows.damage.all != 0- }-- pub(crate) fn scroll_metadata_damaged_everywhere(&self) -> bool {- self.paintable_rows.damage.scroll_metadata_everywhere != 0- }-- #[cfg(test)]- pub(crate) fn damaged_paint_rows(&self) -> Vec<NodeSlotId> {- let mut rows: Vec<NodeSlotId> = self- .paintable_rows- .damage- .rows- .iter()- .copied()- .filter(|row| self.paintable_row_is_populated(*row) && !self.row_paint_state(*row).damage().is_empty())- .collect();- rows.sort_unstable_by_key(|row| (row.slot_index(), row.generation()));- rows.dedup();- rows- }-- pub(crate) fn note_publishing_paint_recording_started(&mut self) {- let counter = &mut self.paintable_rows.damage.started_publishing_recordings;- *counter = counter.checked_add(1).expect("paint recording sequence overflowed");- }-- /// A recording that publishes nothing consumes no damage, so damage goes on accumulating: only the rows gone since,- /// and those listed again, leave the list.- pub(crate) fn forget_paint_damage_rows_gone(&mut self) {- let mut rows = self.paintable_rows.damage.rows.take_rows();- rows.retain(|row| self.paintable_row_is_populated(*row));- rows.sort_unstable_by_key(|row| (row.slot_index(), row.generation()));- rows.dedup();- self.paintable_rows.damage.rows = rows.into_iter().collect();- }-- /// The published recording consumed everything pushed before it started. Rows pushed since- /// stay listed, and their hints are renewed because the ancestors they hinted were cleared.- pub(crate) fn clear_paint_damage_consumed_by_published_recording(&mut self) {- let set = &mut self.paintable_rows.damage;- let consumed_through = set.started_publishing_recordings;- if set.all != 0 && set.all <= consumed_through {- set.all = 0;- }- if set.scroll_metadata_everywhere != 0 && set.scroll_metadata_everywhere <= consumed_through {- set.scroll_metadata_everywhere = 0;- }- let listed = set.rows.take_rows();- let mut kept = Vec::new();- for row in listed {- if !self.paintable_row_is_populated(row) {- continue;- }- let state = &mut self.paintable_rows.row_paint_states[row.slot_index() as usize];- if state.damage_stamp <= consumed_through {- state.clear();- } else {- kept.push(row);- }- }- // A row populated again after its push is listed again by its next push.- kept.sort_unstable_by_key(|row| (row.slot_index(), row.generation()));- kept.dedup();- self.paintable_rows.damage.rows = kept.iter().copied().collect();- for row in kept {- let stamp = self.paintable_rows.row_paint_states[row.slot_index() as usize].damage_stamp;- self.hint_descendant_readers_above(row, stamp);- }- }-}--#[cfg(test)]-mod tests {- use super::*;- use crate::layout::node_data::NodeKind;-- fn populated_child(arena: &mut LayoutNodeArena, parent: NodeSlotId) -> NodeSlotId {- let row = arena.allocate_for_test().slot;- arena.write_shape(row).set_kind(NodeKind::Box);- if !parent.is_invalid() {- arena.insert_child(parent, row, NodeSlotId::INVALID);- }- arena.populate_paintable_row(row);- row- }-- // Building the tree pushes attachment damage; a published recording consumes it.- fn settle(arena: &mut LayoutNodeArena) {- arena.note_publishing_paint_recording_started();- arena.clear_paint_damage_consumed_by_published_recording();- assert_eq!(arena.damaged_paint_rows(), Vec::new());- }-- #[test]- fn a_frame_keeps_the_damage_pushed_before_it_was_published() {- let mut arena = LayoutNodeArena::new();- let first = populated_child(&mut arena, NodeSlotId::INVALID);- let second = populated_child(&mut arena, NodeSlotId::INVALID);- settle(&mut arena);- arena.push_paint_damage(first, PaintDamage::DRAW_FOREGROUND);- let frame = arena.paint_damage_for_frame();- arena.push_paint_damage(second, PaintDamage::DRAW_BACKGROUND);-- assert_eq!(frame.of_row(first), PaintDamage::DRAW_FOREGROUND);- assert_eq!(frame.of_row(second), PaintDamage::NONE);- assert_eq!(frame.rows().collect::<Vec<_>>(), [first]);- assert!(!frame.is_empty() && !frame.covers_everything());- assert_eq!(arena.paint_damage_of_row(second), PaintDamage::DRAW_BACKGROUND);- }-- #[test]- fn a_push_lists_the_row_once_and_hints_every_ancestor_once() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let middle = populated_child(&mut arena, root);- let leaf = populated_child(&mut arena, middle);- let unrelated = populated_child(&mut arena, root);- settle(&mut arena);-- arena.push_paint_damage(leaf, PaintDamage::DRAW_BACKGROUND);- arena.push_paint_damage(leaf, PaintDamage::HIT_FOREGROUND);-- assert_eq!(- arena.paint_damage_of_row(leaf),- PaintDamage::DRAW_BACKGROUND | PaintDamage::HIT_FOREGROUND- );- assert_eq!(arena.paint_damage_of_row(middle), PaintDamage::DESCENDANT_READERS);- assert_eq!(arena.paint_damage_of_row(root), PaintDamage::DESCENDANT_READERS);- assert_eq!(arena.paint_damage_of_row(unrelated), PaintDamage::NONE);- assert_eq!(arena.damaged_paint_rows(), {- let mut expected = vec![leaf, middle, root];- expected.sort_unstable_by_key(|row| row.slot_index());- expected- });- }-- #[test]- fn order_changes_resolve_to_the_nearest_paint_ancestor_and_keep_siblings_clean() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let owner = populated_child(&mut arena, root);- let sibling = populated_child(&mut arena, root);- let unpopulated = arena.allocate_for_test().slot;- arena.write_shape(unpopulated).set_kind(NodeKind::InlineNode);- arena.insert_child(owner, unpopulated, NodeSlotId::INVALID);- let child = populated_child(&mut arena, unpopulated);- settle(&mut arena);-- arena.note_paint_order_changed(child);-- assert!(arena.paint_damage_of_row(child).contains(PaintDamage::ORDER));- assert!(- arena- .paint_damage_of_row(owner)- .contains(PaintDamage::ORDER | PaintDamage::DESCENDANT_READERS)- );- assert_eq!(arena.paint_damage_of_row(root), PaintDamage::DESCENDANT_READERS);- assert_eq!(arena.paint_damage_of_row(sibling), PaintDamage::NONE);- }-- #[test]- fn reparenting_damages_both_owners_and_renews_the_hints_above_the_new_parent() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let old_owner = populated_child(&mut arena, root);- let new_owner = populated_child(&mut arena, root);- let moved = populated_child(&mut arena, old_owner);- let leaf = populated_child(&mut arena, moved);- settle(&mut arena);-- arena.push_paint_damage(leaf, PaintDamage::DRAW_FOREGROUND);- arena.remove_child(old_owner, moved);- arena.insert_child(new_owner, moved, NodeSlotId::INVALID);- arena.push_paint_damage(leaf, PaintDamage::DRAW_OUTLINE);-- assert!(arena.paint_damage_of_row(old_owner).contains(PaintDamage::ORDER));- assert!(arena.paint_damage_of_row(new_owner).contains(PaintDamage::ORDER));- assert!(- arena- .paint_damage_of_row(new_owner)- .contains(PaintDamage::DESCENDANT_READERS)- );- assert!(arena.paint_damage_of_row(moved).contains(PaintDamage::ORDER));- assert!(- arena- .paint_damage_of_row(root)- .contains(PaintDamage::DESCENDANT_READERS)- );- }-- #[test]- fn resource_subtrees_hint_the_nearest_painted_layout_ancestor() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let svg_root = populated_child(&mut arena, root);- let mask = populated_child(&mut arena, svg_root);- arena.write_shape(mask).set_kind(NodeKind::SVGMaskBox);- let mask_content = populated_child(&mut arena, mask);- settle(&mut arena);-- arena.push_paint_damage(mask_content, PaintDamage::SVG);-- assert_eq!(arena.paint_damage_of_row(mask), PaintDamage::DESCENDANT_READERS);- assert_eq!(arena.paint_damage_of_row(svg_root), PaintDamage::DESCENDANT_READERS);- assert_eq!(arena.paint_damage_of_row(root), PaintDamage::DESCENDANT_READERS);- }-- #[test]- fn whole_document_damage_makes_later_pushes_for_the_same_recording_free() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let child = populated_child(&mut arena, root);- settle(&mut arena);-- arena.push_all_paint_damage();- arena.push_paint_damage(child, PaintDamage::ALL_PRODUCERS);-- assert!(arena.paint_damage_covers_everything());- assert_eq!(arena.damaged_paint_rows(), Vec::new());-- arena.note_publishing_paint_recording_started();- arena.push_paint_damage(child, PaintDamage::DRAW_BORDER);- arena.clear_paint_damage_consumed_by_published_recording();-- assert!(!arena.paint_damage_covers_everything());- assert_eq!(arena.paint_damage_of_row(child), PaintDamage::DRAW_BORDER);- assert_eq!(arena.paint_damage_of_row(root), PaintDamage::DESCENDANT_READERS);- }-- #[test]- fn publication_clears_what_the_recording_consumed_and_keeps_later_pushes() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let early = populated_child(&mut arena, root);- let late = populated_child(&mut arena, root);- settle(&mut arena);- arena.push_paint_damage(early, PaintDamage::DRAW_FOREGROUND);- arena.push_scroll_metadata_damage_everywhere();-- arena.note_publishing_paint_recording_started();- arena.push_paint_damage(late, PaintDamage::HIT_OVERLAY);- arena.clear_paint_damage_consumed_by_published_recording();-- assert_eq!(arena.paint_damage_of_row(early), PaintDamage::NONE);- assert_eq!(arena.paint_damage_of_row(late), PaintDamage::HIT_OVERLAY);- assert_eq!(arena.paint_damage_of_row(root), PaintDamage::DESCENDANT_READERS);- assert!(!arena.scroll_metadata_damaged_everywhere());- assert_eq!(arena.damaged_paint_rows(), {- let mut expected = vec![late, root];- expected.sort_unstable_by_key(|row| row.slot_index());- expected- });-- arena.note_publishing_paint_recording_started();- arena.clear_paint_damage_consumed_by_published_recording();- assert_eq!(arena.damaged_paint_rows(), Vec::new());- }-- #[test]- fn publication_keeps_a_row_listed_twice_since_the_recording_started_once() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let rows: Vec<NodeSlotId> = (0..3).map(|_| populated_child(&mut arena, root)).collect();- settle(&mut arena);-- arena.note_publishing_paint_recording_started();- for &row in &rows {- arena.push_paint_damage(row, PaintDamage::DRAW_FOREGROUND);- }- arena.populate_paintable_row(rows[1]);- arena.push_paint_damage(rows[1], PaintDamage::DRAW_FOREGROUND);- arena.clear_paint_damage_consumed_by_published_recording();-- let mut expected = vec![root, rows[0], rows[1], rows[2]];- expected.sort_unstable_by_key(|row| (row.slot_index(), row.generation()));- assert_eq!(- arena.paintable_rows.damage.rows.iter().copied().collect::<Vec<_>>(),- expected- );- }-- #[test]- fn a_reset_row_retires_from_the_set_and_damages_its_former_owner() {- let mut arena = LayoutNodeArena::new();- let root = populated_child(&mut arena, NodeSlotId::INVALID);- let owner = populated_child(&mut arena, root);- let cleared = populated_child(&mut arena, owner);- settle(&mut arena);- arena.push_paint_damage(cleared, PaintDamage::DRAW_BACKGROUND);-- let reset = arena.prepare_paintable_row_cleared_reset(cleared).unwrap();- arena.paintable_row_cleared(reset);-- assert!(!arena.paintable_row_is_populated(cleared));- assert!(arena.paint_damage_of_row(owner).contains(PaintDamage::ORDER));- assert!(!arena.damaged_paint_rows().contains(&cleared));- }-- #[test]- fn repaint_fan_out_reaches_anonymous_boxes_and_the_line_root_of_an_inline() {- let mut arena = LayoutNodeArena::new();- let line_root = populated_child(&mut arena, NodeSlotId::INVALID);- arena.write_shape(line_root).set_kind(NodeKind::BlockContainer);- let inline = populated_child(&mut arena, line_root);- arena.write_shape(inline).set_kind(NodeKind::InlineNode);- let anonymous = populated_child(&mut arena, inline);- arena.write_shape(anonymous).set_kind(NodeKind::BlockContainer);- arena.set_node_flag(anonymous, crate::layout::node_data::NodeFlag::Anonymous, true);- settle(&mut arena);-- arena.push_paint_damage_for_repaint(inline, PaintDamage::ALL_DRAW);-- assert!(arena.paint_damage_of_row(inline).contains(PaintDamage::ALL_DRAW));- assert!(arena.paint_damage_of_row(anonymous).contains(PaintDamage::ALL_DRAW));- assert!(arena.paint_damage_of_row(line_root).contains(PaintDamage::ALL_DRAW));- }-}diff --git a/Libraries/LibWeb/Rust/src/painting/record/mod.rs b/Libraries/LibWeb/Rust/src/painting/record/mod.rsindex 31e80f28040..fd74d4f111b 100644--- a/Libraries/LibWeb/Rust/src/painting/record/mod.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/mod.rs@@ -9,7 +9,7 @@ use crate::painting::record::trace::{Observer, Operation};pub(crate) mod assemble;pub mod async_scroll_metadata;-pub(crate) mod damage;+pub(crate) mod change_ticks;pub(crate) mod frame_inputs;pub mod hit_test_items;pub(crate) mod ink_bounds;@@ -45,11 +45,12 @@ pub(crate) use inputs::RecordingInputs;#[derive(Default)]pub struct RecordingOutput {pub recorded_structural_epoch: u64,+ pub(crate) recorded_as_of: change_ticks::PaintGeneration,/// The visual context tree the recording was recorded against: the frozen frame's.pub visual_context_tree: Option<Arc<crate::painting::visual_context::VisualContextTree>>,pub(crate) frame_inputs: FrameInputs,// The area the root background painted: the viewport united with the root's overflow. Only- // the root's background reads it, so a change pushes that producer instead of a new frame.+ // the root's background reads it, so a change stamps the root instead of asking for everything anew.pub(crate) root_background_canvas_rect: CssPixelRect,/// The name of the chunk the canvas was recorded into, outside the walked scopes, or none where it drew nothing.pub(crate) prologue_id: Option<crate::painting::display_list::chunks::ChunkId>,diff --git a/Libraries/LibWeb/Rust/src/painting/record/order_tree.rs b/Libraries/LibWeb/Rust/src/painting/record/order_tree.rsindex 4ca3061fa0f..c7ced2f15ef 100644--- a/Libraries/LibWeb/Rust/src/painting/record/order_tree.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/order_tree.rs@@ -16,12 +16,10 @@use crate::css::css_pixels::CssPixelPoint;use crate::painting::display_list::chunks::Chunk;use crate::painting::paint_order_plan::{PaintOrderItem, PaintScope};-use crate::painting::record::damage::PaintDamage;use std::ops::Range;use std::sync::{Arc, OnceLock};-/// One unit of recorded output owned by a row. The order of the draw phases mirrors `PaintPhase`, and every kind has-/// the damage bit that makes it record again.+/// One unit of recorded output owned by a row. The order of the draw phases mirrors `PaintPhase`.#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]#[repr(u8)]pub(crate) enum ProducerKind {@@ -38,26 +36,6 @@ pub(crate) enum ProducerKind {TextFragment(u32),}-impl ProducerKind {- pub(crate) fn damage(self) -> PaintDamage {- match self {- Self::DrawBackground => PaintDamage::DRAW_BACKGROUND,- Self::DrawBorder => PaintDamage::DRAW_BORDER,- Self::DrawTableCollapsedBorder => PaintDamage::DRAW_TABLE_COLLAPSED_BORDER,- Self::DrawForeground => PaintDamage::DRAW_FOREGROUND,- Self::DrawOutline => PaintDamage::DRAW_OUTLINE,- Self::DrawOverlay => PaintDamage::DRAW_OVERLAY,- Self::ScrollMetadata => PaintDamage::SCROLL_METADATA,- Self::ScopePreamble => PaintDamage::SCOPE_PREAMBLE,- Self::Svg => PaintDamage::SVG,- Self::InlinePiece(_) => {- PaintDamage::DRAW_BACKGROUND | PaintDamage::DRAW_BORDER | PaintDamage::DRAW_FOREGROUND- }- Self::TextFragment(_) => PaintDamage::DRAW_FOREGROUND,- }- }-}-/// What one part of a recording recorded, besides its chunks, that decides whether it can be reused.#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]pub(crate) struct OutputFacts {@@ -78,7 +56,7 @@ impl OutputFacts {}}-/// Where a row's boxes are, as far as an ancestor can move them without anything pushing damage for the row: the+/// Where a row's boxes are, as far as an ancestor can move them without anything stamping the row: the/// origin of its first fragment, and for a row in several fragments a digest of where the later ones are, which a/// change of the columns they sit in moves on its own.#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]@@ -173,7 +151,7 @@ impl RecordedChunk {}/// What a run recorded, and where the owners of its child scopes were when it did: a child that an ancestor moved-/// since records again though nothing pushed damage for it.+/// since records again though nothing stamped it.#[derive(Debug)]pub(crate) struct RecordedRun {/// None where the run recorded nothing.diff --git a/Libraries/LibWeb/Rust/src/painting/record/paint/svg.rs b/Libraries/LibWeb/Rust/src/painting/record/paint/svg.rsindex 53e49f161ce..580f3960243 100644--- a/Libraries/LibWeb/Rust/src/painting/record/paint/svg.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/paint/svg.rs@@ -398,8 +398,8 @@ pub(crate) fn paint_path<O: Observer>(recorder: &mut PaintRecorder<'_, O>, paint};let (facts, dash_array) = svg_paint_facts(recorder, paintable);// A pattern tile is rendered from the pattern's own subtree, and a textPath follows another- // element's geometry; neither pushes damage on this shape when it changes. A gradient is- // published by the paint resource sync, which pushes damage on the shapes using it.+ // element's geometry; neither stamps this shape when it changes. A gradient is+ // published by the paint resource sync, which stamps the shapes using it.let output_is_resolved_through_another_element = (facts.references_paint_server&& references_pattern(recorder, paintable))|| recorder.source.node_kind_if_live(paintable) == Some(NodeKind::SVGTextPathBox);diff --git a/Libraries/LibWeb/Rust/src/painting/record/producers.rs b/Libraries/LibWeb/Rust/src/painting/record/producers.rsindex 5b1a68e33ce..0ba68415c50 100644--- a/Libraries/LibWeb/Rust/src/painting/record/producers.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/producers.rs@@ -19,7 +19,7 @@ use crate::painting::display_list::commands::ContextRef;use crate::painting::force_dark::ForceDarkRole;use crate::painting::paint_order_plan::{PaintOrderItem, PaintProducer, PaintScope, PaintScopePlan};use crate::painting::paint_read::GeometryRead;-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::RowChanges;use crate::painting::record::svg_resources::MaskLayerSet;use crate::painting::{node_painting, paintable_geometry};use libgfx_rust::Color;@@ -117,7 +117,7 @@ impl<O: Observer> PaintRecorder<'_, O> {fn record_box_commands(&mut self, owner: NodeSlotId, phase: PaintPhase) {let facts = self.base_paint_facts(owner);- // Scrolling repaints without pushing damage, so output that depends on the scroll+ // Scrolling repaints without stamping any row, so output that depends on the scroll// offset records every frame.if facts.has_fixed_background|| (facts.has_scroll_offset_dependent_background && phase == PaintPhase::Background)@@ -230,9 +230,13 @@ impl<O: Observer> AssemblyHost for PaintRecorder<'_, O> {(!chunk.records.is_empty()).then(|| RecordedChunk::new(chunk, draws_vector_image_placeholders))}- fn damage_of_row(&mut self, row: NodeSlotId) -> PaintDamage {- // Nothing is recorded for what a box can be hit by: hit testing walks the rows.- self.source.paint_damage_of_row(row).without(PaintDamage::ALL_HIT)+ fn changes_of_row(&mut self, row: NodeSlotId) -> RowChanges {+ let Some(published) = &self.source_recording else {+ return RowChanges::NONE;+ };+ self.source+ .paint_change_stamps(row)+ .changes_since(published.recorded_as_of)}fn placement_of_row(&mut self, row: NodeSlotId) -> RowPlacement {diff --git a/Libraries/LibWeb/Rust/src/painting/record/publish.rs b/Libraries/LibWeb/Rust/src/painting/record/publish.rsindex 2fa4df072d1..e2ed0275499 100644--- a/Libraries/LibWeb/Rust/src/painting/record/publish.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/publish.rs@@ -346,15 +346,8 @@ pub(crate) fn take_in_presented_output(take_in(output);}-/// Takes the recording `output` the host published in as the document's last, where `arena` is the document's arena:-/// a recording that publishes consumes the damage it painted.+/// Takes the recording `output` the host published in as the document's last, where `arena` is the document's arena.pub(crate) fn take_in_recording(arena: &mut LayoutNodeArena, output: Arc<RecordingOutput>, publishes_recording: bool) {- // Read-only recordings publish nothing and must not consume the damage.- if publishes_recording {- arena.clear_paint_damage_consumed_by_published_recording();- } else {- arena.forget_paint_damage_rows_gone();- }let paint_state = arena.paint_state_mut();if publishes_recording {paint_state.visual_context.quarantined_slots_are_releasable = true;@@ -365,25 +358,23 @@ pub(crate) fn take_in_recording(arena: &mut LayoutNodeArena, output: Arc<Recordi#[cfg(test)]mod tests {use super::*;- use crate::painting::record::damage::PaintDamage;+ use crate::painting::record::change_ticks::RowPaintChange;use std::sync::Arc;#[test]- fn read_only_publication_keeps_the_source_recording_and_the_pending_damage() {+ fn read_only_publication_keeps_the_source_recording_whose_generation_later_changes_are_newer_than() {let mut arena = LayoutNodeArena::new();let mut recorder = RecorderState::default();let mut hit_test_items_on_screen = HitTestItemsOnScreen::default();let row = arena.allocate_for_test().slot;arena.populate_paintable_row(row);let mut original_source = None;- // Publish a source, a read-only recording, and then the pending repaint.+ // Publish a source, a read-only recording, and then the frame after the change.for (structural_epoch, read_write) in [(1, true), (2, false), (3, true)] {- if read_write {- arena.note_publishing_paint_recording_started();- }// Each recording is of another tree, so that it places other hit-test items.let output = RecordingOutput {recorded_structural_epoch: structural_epoch,+ recorded_as_of: arena.take_paint_generation(),..Default::default()};take_in_presented_output(@@ -395,18 +386,21 @@ mod tests {);assert_eq!(hit_test_items_on_screen.generation(), structural_epoch);let source = recorder.published_recording.clone().unwrap();+ let changed_since_source = arena+ .paint_change_stamps(row)+ .row_or_anything_below_it_changed_since(source.recorded_as_of);match structural_epoch {1 => {original_source = Some(source);- arena.push_paint_damage(row, PaintDamage::DRAW_FOREGROUND);+ arena.note_paint_change(row, RowPaintChange::DRAWING);}2 => {assert!(Arc::ptr_eq(original_source.as_ref().unwrap(), &source));- assert_eq!(arena.paint_damage_of_row(row), PaintDamage::DRAW_FOREGROUND);+ assert!(changed_since_source);}3 => {assert!(!Arc::ptr_eq(original_source.as_ref().unwrap(), &source));- assert_eq!(arena.paint_damage_of_row(row), PaintDamage::NONE);+ assert!(!changed_since_source);}_ => unreachable!(),}@@ -414,48 +408,17 @@ mod tests {}#[test]- fn a_take_in_that_publishes_nothing_leaves_damage_accumulating_and_quarantine_held() {+ fn only_a_take_in_that_publishes_releases_what_it_replaced() {let mut arena = LayoutNodeArena::new();- let consumed = arena.allocate_for_test().slot;- let kept = arena.allocate_for_test().slot;- let gone = arena.allocate_for_test().slot;- for row in [consumed, kept, gone] {- arena.populate_paintable_row(row);- }- arena.push_paint_damage(consumed, PaintDamage::DRAW_FOREGROUND);- arena.note_publishing_paint_recording_started();- arena.push_paint_damage(kept, PaintDamage::DRAW_FOREGROUND);let take_in = |arena: &mut LayoutNodeArena, publishes_recording| {take_in_recording(arena, Arc::new(RecordingOutput::default()), publishes_recording);};-- // The published frame consumes what it recorded, and what was pushed as it recorded stays.take_in(&mut arena, true);- assert_eq!(arena.paint_damage_of_row(consumed), PaintDamage::NONE);- assert_eq!(arena.paint_damage_of_row(kept), PaintDamage::DRAW_FOREGROUND);assert!(arena.paint_state().visual_context.quarantined_slots_are_releasable);arena.paint_state_mut().visual_context.quarantined_slots_are_releasable = false;-- // A frame that publishes nothing consumes nothing, and nothing it replaced is released.- arena.push_paint_damage(gone, PaintDamage::DRAW_BACKGROUND);take_in(&mut arena, false);- assert_eq!(arena.paint_damage_of_row(kept), PaintDamage::DRAW_FOREGROUND);- assert_eq!(arena.paint_damage_of_row(gone), PaintDamage::DRAW_BACKGROUND);assert!(!arena.paint_state().visual_context.quarantined_slots_are_releasable);- assert_eq!(arena.damaged_paint_rows(), [kept, gone]);-- // A row that went leaves the damage a later frame reads.- arena- .free_subtree(gone)- .destroy_shells_and_invoke_callbacks(&crate::stage::MainThread::for_test());- take_in(&mut arena, false);- assert_eq!(arena.paint_damage_for_frame().rows().collect::<Vec<_>>(), [kept]);- arena- .free_subtree(consumed)- .destroy_shells_and_invoke_callbacks(&crate::stage::MainThread::for_test());- arena- .free_subtree(kept)- .destroy_shells_and_invoke_callbacks(&crate::stage::MainThread::for_test());+ assert!(arena.paint_state().last_recording.is_some());}#[test]diff --git a/Libraries/LibWeb/Rust/src/painting/record/trace.rs b/Libraries/LibWeb/Rust/src/painting/record/trace.rsindex 89f619c7dd8..80b7f96a5f9 100644--- a/Libraries/LibWeb/Rust/src/painting/record/trace.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/trace.rs@@ -16,7 +16,6 @@ use std::rc::Rc;pub struct CaptureLog {pub(crate) events: Vec<Event>,pub(crate) open_events: Vec<usize>,- pub(crate) damage: Option<DamageSummary>,}// The normal recorder carries no observation state. Keeping the policy static also removes@@ -85,16 +84,6 @@ pub(crate) struct Event {pub empty: bool,}-/// The damage a recording started from, for tests that pin the exact amount of work.-#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]-pub(crate) struct DamageSummary {- pub rows: usize,- pub moved: usize,- pub order: usize,- pub eligibility: usize,- pub all: bool,-}-impl<O: Observer> super::PaintRecorder<'_, O> {pub(crate) fn trace_scope<R>(&mut self,@@ -142,14 +131,6 @@ impl CaptureLog {pub(crate) fn format(&self, mut name: impl FnMut(NodeSlotId) -> String) -> String {assert!(self.open_events.is_empty(), "incomplete recording trace");let mut output = String::new();- if let Some(damage) = self.damage {- writeln!(- output,- "damage: rows={} moved={} order={} eligibility={} all={}",- damage.rows, damage.moved, damage.order, damage.eligibility, damage.all- )- .unwrap();- }let mut depths = Vec::with_capacity(self.events.len());for event in &self.events {let depth = event.parent.map_or(0, |parent| depths[parent] + 1);@@ -224,10 +205,6 @@ mod tests {fn nested_work_is_indented_and_only_recording_reports_emptiness() {let mut log = CaptureLog::default();let owner = NodeSlotId::new(0, 1);- log.damage = Some(DamageSummary {- rows: 1,- ..DamageSummary::default()- });log.begin(Operation::Scope(PaintScope::stacking_context(owner)), Action::Assemble);log.leaf(Operation::Producer(owner, ProducerKind::DrawBackground),@@ -248,7 +225,7 @@ mod tests {let text = log.format(|_| "box".to_string());assert_eq!(text,- "damage: rows=1 moved=0 order=0 eligibility=0 all=false\nbox ASSEMBLE\n box/background COPY\n box/foreground RECORD (empty)\n box/outline SKIP\n"+ "box ASSEMBLE\n box/background COPY\n box/foreground RECORD (empty)\n box/outline SKIP\n");}}diff --git a/Libraries/LibWeb/Rust/src/painting/record/traversal.rs b/Libraries/LibWeb/Rust/src/painting/record/traversal.rsindex 5e7fb5cf814..536665886db 100644--- a/Libraries/LibWeb/Rust/src/painting/record/traversal.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/traversal.rs@@ -73,12 +73,10 @@ fn record_display_list_impl<O: Observer>(inputs.css_viewport_rect,);// The published recording is reused from while every input its producers read is unchanged and- // no push asked for everything; otherwise this frame records from scratch.- let source_is_usable = source_recording- .as_ref()- .is_some_and(|frame| frame.frame_inputs == frame_inputs)- && !source.frame().damage().covers_everything()- && !source.frame().damage().scroll_metadata_everywhere();+ // nothing asked for everything to paint anew since; otherwise this frame records from scratch.+ let source_is_usable = source_recording.as_ref().is_some_and(|published| {+ published.frame_inputs == frame_inputs && !source.frame().everything_paints_anew_since(published.recorded_as_of)+ });let source_recording = source_recording.filter(|_| source_is_usable);let window_focus_changed = source_recording.as_ref()@@ -104,9 +102,6 @@ fn record_display_list_impl<O: Observer>(scratch,resources: RecordingResourceManifest::default(),};- recorder- .observer- .observe(|log| log.damage = Some(source.frame().damage().summary()));let root_group_color = recorder.record_canvas();let prologue = recorder.take_run_chunk();let prologue_id = prologue.as_ref().map(|chunk| chunk.recorded().id);@@ -120,14 +115,17 @@ fn record_display_list_impl<O: Observer>(.source_recording.as_ref().and_then(|frame| frame.recorded_root.clone());- // Nothing was pushed and nothing records every frame: the published chunks are this frame's, which lets the+ // Nothing changed and nothing records every frame: the published chunks are this frame's, which lets the// compositor skip its update as well.let unchanged_frame = recorder.source_recording.as_ref().zip(published_root.as_ref()).filter(|(frame, root)| {- frame_is_unchanged(root, !source.frame().damage().is_empty(), window_focus_changed)+ let anything_changed = source+ .paint_change_stamps(viewport)+ .row_or_anything_below_it_changed_since(frame.recorded_as_of);+ frame_is_unchanged(root, anything_changed, window_focus_changed)&& !has_inspector_overlays&& frame.prologue_id == prologue_id})@@ -178,6 +176,7 @@ fn record_display_list_impl<O: Observer>(};let output = RecordingOutput {recorded_structural_epoch: structural_epoch,+ recorded_as_of: source.frame().paint_generation(),visual_context_tree: paint_state.visual_context_tree.clone(),frame_inputs,root_background_canvas_rect,diff --git a/Libraries/LibWeb/Rust/src/painting/recording_slot.rs b/Libraries/LibWeb/Rust/src/painting/recording_slot.rsindex 92fc33e3d0a..5a8b916697e 100644--- a/Libraries/LibWeb/Rust/src/painting/recording_slot.rs+++ b/Libraries/LibWeb/Rust/src/painting/recording_slot.rs@@ -24,6 +24,7 @@ use crate::painting::paint_read::PaintSource;use crate::painting::paint_state::{PendingRecording, PendingRecordingTrace};use crate::painting::presentation::Presentation;use crate::painting::published_frame::PublishedFrame;+use crate::painting::record::change_ticks::RowPaintChange;use crate::painting::record::publish::HitTestItemsOnScreen;use crate::painting::record::recorder_state::RecorderState;use crate::painting::record::vector_images::VectorImageRenderRequest;@@ -589,12 +590,9 @@ pub(crate) fn freeze_recording_frame(arena: &mut LayoutNodeArena, inputs: FrameIinputs.css_viewport_rect,);if canvas_rect != published_canvas_rect {- arena.push_paint_damage(root, crate::painting::record::damage::PaintDamage::DRAW_BACKGROUND);+ arena.note_paint_change(root, RowPaintChange::DRAWING);}}- if inputs.publishes_recording {- arena.note_publishing_paint_recording_started();- }// The recording reads the document as it is now: what the host writes after this goes to the next frame.let frame = arena.freeze_frame();let rows_version = arena.rows_version();diff --git a/Libraries/LibWeb/Rust/src/painting/replaced_paint_facts.rs b/Libraries/LibWeb/Rust/src/painting/replaced_paint_facts.rsindex 0871569b0c9..ea68d55d9a9 100644--- a/Libraries/LibWeb/Rust/src/painting/replaced_paint_facts.rs+++ b/Libraries/LibWeb/Rust/src/painting/replaced_paint_facts.rs@@ -10,7 +10,7 @@ use crate::painting::host::{FfiVideoPaintFacts, FfiVideoRepresentation,};use crate::painting::image_content::ImageContent;-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::RowPaintChange;use libgfx_rust::image_frame::ImageFrameHandle;#[derive(Clone, Copy, Debug, PartialEq, Eq)]@@ -103,15 +103,17 @@ pub(crate) enum ReplacedPaintFacts {}impl ReplacedPaintFacts {- /// The damage a row takes where its facts change to these. A canvas or a navigable container caches what it paints+ /// What changes of a row where its facts change to these. A canvas or a navigable container caches what it paints/// and is hit-tested with beside its row, which goes with the facts. Whether a navigable container's content is/// composited also decides which wheel region its scroll metadata records.- pub(crate) fn damage_when_changed(&self) -> PaintDamage {+ pub(crate) fn paint_change_when_changed(&self) -> RowPaintChange {match self {- Self::FormControl(_) => PaintDamage::DRAW_FOREGROUND,- Self::Canvas(_) => PaintDamage::ALL_DRAW | PaintDamage::ALL_HIT,- Self::NavigableContainer(_) => PaintDamage::ALL_DRAW | PaintDamage::ALL_HIT | PaintDamage::SCROLL_METADATA,- Self::Image(_) | Self::Video(_) | Self::FrameSet(_) => PaintDamage::ALL_DRAW,+ Self::FormControl(_) => RowPaintChange::DRAWING,+ Self::Canvas(_) => RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING,+ Self::NavigableContainer(_) => {+ RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING | RowPaintChange::SCROLL_METADATA+ }+ Self::Image(_) | Self::Video(_) | Self::FrameSet(_) => RowPaintChange::DRAWING,}}diff --git a/Libraries/LibWeb/Rust/src/painting/scrollable_overflow.rs b/Libraries/LibWeb/Rust/src/painting/scrollable_overflow.rsindex 6adbc3de3c6..8a517820909 100644--- a/Libraries/LibWeb/Rust/src/painting/scrollable_overflow.rs+++ b/Libraries/LibWeb/Rust/src/painting/scrollable_overflow.rs@@ -115,25 +115,25 @@ impl LayoutNodeArena {has_scrollable_overflow: bool,changed_outside_layout: bool,) {- use crate::painting::record::damage::PaintDamage;+ use crate::painting::record::change_ticks::RowPaintChange;if changed_outside_layout {self.scrollable_overflow.geometry_changed = true;}- self.push_paint_damage(+ self.note_paint_change(node,- PaintDamage::SCROLL_METADATA | PaintDamage::DRAW_OVERLAY | PaintDamage::HIT_OVERLAY,+ RowPaintChange::SCROLL_METADATA | RowPaintChange::DRAWING | RowPaintChange::HIT_TESTING,);// The root background covers the viewport united with the overflow of the viewport box.if self.node_kind_if_live(node) == Some(NodeKind::Viewport)&& let Some(source) = self.paint_state().root_background_source{- self.push_paint_damage(source.root_layout_node, PaintDamage::DRAW_BACKGROUND);+ self.note_paint_change(source.root_layout_node, RowPaintChange::DRAWING);}if had_scrollable_overflow != has_scrollable_overflow {self.scrollable_overflow.scrollability_changed = true;- self.push_paint_damage(node, PaintDamage::ALL_PRODUCERS);+ self.note_paint_change(node, RowPaintChange::EVERYTHING_IT_PAINTS);self.paintable_rows_mut()- .push_paint_damage_to_paint_subtree(node, PaintDamage::SCROLL_METADATA);+ .note_paint_change_in_paint_subtree(node, RowPaintChange::SCROLL_METADATA);self.note_visual_context_box_dirty(node, VisualContextBoxDirtyKind::ScrollableOverflowFlipped);}}diff --git a/Libraries/LibWeb/Rust/src/painting/selection.rs b/Libraries/LibWeb/Rust/src/painting/selection.rsindex 04aaf8c7922..cd14a108e2c 100644--- a/Libraries/LibWeb/Rust/src/painting/selection.rs+++ b/Libraries/LibWeb/Rust/src/painting/selection.rs@@ -21,7 +21,7 @@ use crate::painting::paintable_data::{FfiSpellingError, SELECTION_STATE_END, SELECTION_STATE_NONE, SELECTION_STATE_START, SELECTION_STATE_START_AND_END,};use crate::painting::paintable_rows::PaintableRowsMut;-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::RowPaintChange;use crate::painting::record::paint::text::{HighlightDecorationMetrics, HighlightShadowLayer, SelectionStyleAnswer, ShadowLayer,};@@ -73,10 +73,10 @@ pub(crate) struct SelectionRange {fn invalidate_text_node(layout_arena: &mut PaintableRowsMut<'_>, node: NodeSlotId) {if let Some(containing_block) = text_fragment::containing_block_paintable_of_node(layout_arena, node) {- layout_arena.push_paint_damage(containing_block, PaintDamage::ALL_DRAW);+ layout_arena.note_paint_change(containing_block, RowPaintChange::DRAWING);}if let Some(inline_box) = fragment_ownership::nearest_self_painting_inline_box(layout_arena, node) {- layout_arena.push_paint_damage(inline_box, PaintDamage::ALL_DRAW);+ layout_arena.note_paint_change(inline_box, RowPaintChange::DRAWING);}}@@ -92,7 +92,7 @@ pub(crate) fn clear(layout_arena: &mut PaintableRowsMut<'_>) {&& layout_arena.paintable_data(row).selection_state != SELECTION_STATE_NONE{layout_arena.paintable_data_mut(row).selection_state = SELECTION_STATE_NONE;- layout_arena.push_paint_damage(row, PaintDamage::ALL_DRAW);+ layout_arena.note_paint_change(row, RowPaintChange::DRAWING);}}}@@ -118,7 +118,7 @@ pub(crate) fn apply(}if layout_arena.paintable_data(entry.layout_node).selection_state != entry.state {layout_arena.paintable_data_mut(entry.layout_node).selection_state = entry.state;- layout_arena.push_paint_damage(entry.layout_node, PaintDamage::ALL_DRAW);+ layout_arena.note_paint_change(entry.layout_node, RowPaintChange::DRAWING);boxes_with_selection_state.push(entry.layout_node);}}@@ -313,7 +313,7 @@ fn damage_custom_highlight_changes(if previous.replaced_signature(node) != highlights.replaced_signature(node)&& layout_arena.paintable_row_is_populated(node){- layout_arena.push_paint_damage(node, PaintDamage::ALL_DRAW);+ layout_arena.note_paint_change(node, RowPaintChange::DRAWING);}}}diff --git a/Libraries/LibWeb/Rust/src/painting/stacking_context/entries.rs b/Libraries/LibWeb/Rust/src/painting/stacking_context/entries.rsindex 78daa4e4247..7b6d5b0daf5 100644--- a/Libraries/LibWeb/Rust/src/painting/stacking_context/entries.rs+++ b/Libraries/LibWeb/Rust/src/painting/stacking_context/entries.rs@@ -11,6 +11,7 @@ use crate::layout::node_data::NodeSlotId;use crate::painting::paint_order;use crate::painting::paint_read::GeometryRead;use crate::painting::paintable_rows::PAINTABLE_SLOTS_PER_CHUNK;+use crate::painting::record::change_ticks::RowPaintChange;use crate::painting::visual_context::dirty::VisualContextBoxDirtyKind;use std::ops::{Deref, DerefMut};use std::sync::Arc;@@ -357,7 +358,7 @@ impl LayoutNodeArena {cursor = self.next_node_in_layout_subtree_in_pre_order(subtree_root, node);}}- self.push_enclosing_paint_order_damage(subtree_root);+ self.note_enclosing_paint_order_change(subtree_root);}pub(crate) fn note_layout_subtree_attached(&mut self, subtree_root: NodeSlotId) {@@ -366,12 +367,12 @@ impl LayoutNodeArena {}// The new parent lists the subtree from now on, and every row inside plans its own// descendants under the new ancestry.- self.push_enclosing_paint_order_damage(subtree_root);+ self.note_enclosing_paint_order_change(subtree_root);let mut cursor = Some(subtree_root);while let Some(node) = cursor {if self.paintable_row_is_populated(node) {self.note_visual_context_box_dirty(node, VisualContextBoxDirtyKind::ReattachedInLayoutTree);- self.push_paint_damage(node, crate::painting::record::damage::PaintDamage::ORDER);+ self.note_paint_change(node, RowPaintChange::ORDER);}cursor = self.next_node_in_layout_subtree_in_pre_order(subtree_root, node);}diff --git a/Libraries/LibWeb/Rust/src/painting/visual_context/box_build.rs b/Libraries/LibWeb/Rust/src/painting/visual_context/box_build.rsindex a937fa4e769..6ba59500412 100644--- a/Libraries/LibWeb/Rust/src/painting/visual_context/box_build.rs+++ b/Libraries/LibWeb/Rust/src/painting/visual_context/box_build.rs@@ -56,7 +56,7 @@ impl PaintableVisualContextAssignment {}pub(crate) fn apply(self, layout_arena: &mut impl PaintableRowsWrite) {- use crate::painting::record::damage::PaintDamage;+ use crate::painting::record::change_ticks::RowPaintChange;if let Some(svg_filter_bounds) = self.gathered_svg_filter_bounds {super::node_values::set_svg_filter_bounds(layout_arena, self.slot, svg_filter_bounds);}@@ -90,11 +90,11 @@ impl PaintableVisualContextAssignment {}layout_arena.set_paintable_visual_context_record(self.slot, self.record, self.node_handles);if scroll_nodes_changed {- layout_arena.push_paint_damage(self.slot, PaintDamage::ALL_PRODUCERS);- layout_arena.push_paint_damage_to_paint_subtree(self.slot, PaintDamage::SCROLL_METADATA);+ layout_arena.note_paint_change(self.slot, RowPaintChange::EVERYTHING_IT_PAINTS);+ layout_arena.note_paint_change_in_paint_subtree(self.slot, RowPaintChange::SCROLL_METADATA);}if non_invertible_transform_flipped {- layout_arena.push_paint_damage(self.slot, PaintDamage::ELIGIBILITY | PaintDamage::ALL_PRODUCERS);+ layout_arena.note_paint_change(self.slot, RowPaintChange::ORDER | RowPaintChange::EVERYTHING_IT_PAINTS);}}}diff --git a/Libraries/LibWeb/Rust/src/painting/visual_context/compositor_scroll_table.rs b/Libraries/LibWeb/Rust/src/painting/visual_context/compositor_scroll_table.rsindex 701f2682905..0e367b46fdd 100644--- a/Libraries/LibWeb/Rust/src/painting/visual_context/compositor_scroll_table.rs+++ b/Libraries/LibWeb/Rust/src/painting/visual_context/compositor_scroll_table.rs@@ -166,7 +166,7 @@ pub(crate) fn refresh_compositor_scroll_table(state: &mut super::VisualContextState,inputs: CompositorScrollInputs,) -> CompositorScrollRefreshOutcome {- use crate::painting::record::damage::PaintDamage;+ use crate::painting::record::change_ticks::RowPaintChange;use libcompositing_rust::visual_context::CompositorScrollTable;use std::sync::Arc;@@ -175,8 +175,15 @@ pub(crate) fn refresh_compositor_scroll_table(};let previous = tree.compositor_scroll_table();let inputs_changed = state.last_compositor_scroll_inputs != Some(inputs);- let new_damage = state.compositor_snap_damage_revision != Some(arena.paint_damage_push_revision());- let damage_everywhere = arena.paint_damage_covers_everything() || arena.scroll_metadata_damaged_everywhere();+ let snap_records_as_of = state.compositor_snap_records_as_of;+ let snap_records_are_stale = |owner: NodeSlotId| {+ snap_records_as_of.is_none_or(|as_of| {+ arena.everything_paints_anew_since(as_of)+ || arena+ .paint_change_stamps(owner)+ .row_or_anything_below_it_changed_since(as_of)+ })+ };let source = arena.paintable_rows();let wheel_axes = |slot| crate::painting::chrome_geometry::wheel_scrollable_axes(&source, slot);let mut nodes_with_owners = Vec::new();@@ -221,9 +228,7 @@ pub(crate) fn refresh_compositor_scroll_table({damaged_subtrees.push(*owner);}- let recompute = inputs_changed- || !same_identity- || (new_damage && (damage_everywhere || !arena.row_paint_state(*owner).damage().is_empty()));+ let recompute = inputs_changed || !same_identity || snap_records_are_stale(*owner);let snap_records = if recompute {compositor_snap_container_and_area_records(&source, *owner)} else {@@ -270,10 +275,10 @@ pub(crate) fn refresh_compositor_scroll_table(}let requires_display_list_recording = !damaged_subtrees.is_empty();for owner in damaged_subtrees {- arena.push_paint_damage_to_paint_subtree(owner, PaintDamage::SCROLL_METADATA);+ arena.note_paint_change_in_paint_subtree(owner, RowPaintChange::SCROLL_METADATA);}state.last_compositor_scroll_inputs = Some(inputs);- state.compositor_snap_damage_revision = Some(arena.paint_damage_push_revision());+ state.compositor_snap_records_as_of = Some(arena.take_paint_generation());CompositorScrollRefreshOutcome {table_changed,requires_display_list_recording,diff --git a/Libraries/LibWeb/Rust/src/painting/visual_context/incremental.rs b/Libraries/LibWeb/Rust/src/painting/visual_context/incremental.rsindex 9260661d52a..462b3b0ca2e 100644--- a/Libraries/LibWeb/Rust/src/painting/visual_context/incremental.rs+++ b/Libraries/LibWeb/Rust/src/painting/visual_context/incremental.rs@@ -18,6 +18,7 @@ use crate::layout::node_data::{NodeKind, NodeSlotId};use crate::painting::host::FfiVisualContextTreeInputs;use crate::painting::paint_order;use crate::painting::paintable_rows::{PaintableRowsRead, PaintableRowsWrite};+use crate::painting::record::change_ticks::RowPaintChange;#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]struct ChildCascade {@@ -757,7 +758,7 @@ pub(crate) fn update_visual_context_tree<Arena: PaintableRowsWrite>(// Its recorded contexts must still be replaced in the next display list.delta.requires_display_list_recording |= contexts_changed;if reconcile.shape_changed || !record_existed || contexts_changed {- layout_arena.push_paint_damage(slot, crate::painting::record::damage::PaintDamage::ALL_PRODUCERS);+ layout_arena.note_paint_change(slot, RowPaintChange::EVERYTHING_IT_PAINTS);}if assignment.record.owns_geometry_dependent_nodes && !subtree_may_own_geometry_dependent_nodes {let mut ancestor = paint_order::paint_parent(&*layout_arena, slot);@@ -831,7 +832,7 @@ pub(crate) fn update_visual_context_tree<Arena: PaintableRowsWrite>(if state.scroll_state.has_non_viewport_wheel_scroll_target_candidate!= scroll_state.has_non_viewport_wheel_scroll_target_candidate{- layout_arena.push_scroll_metadata_damage_everywhere();+ layout_arena.note_everything_paints_anew();}state.scroll_state = scroll_state;state.needs_to_refresh_scroll_state = true;diff --git a/Libraries/LibWeb/Rust/src/painting/visual_context/node_values.rs b/Libraries/LibWeb/Rust/src/painting/visual_context/node_values.rsindex ee75d4651fa..feb11a48319 100644--- a/Libraries/LibWeb/Rust/src/painting/visual_context/node_values.rs+++ b/Libraries/LibWeb/Rust/src/painting/visual_context/node_values.rs@@ -566,8 +566,8 @@ pub(crate) fn set_svg_filter_bounds(bounds,);if previous != bounds {- use crate::painting::record::damage::PaintDamage;- layout_arena.push_paint_damage(slot, PaintDamage::SCOPE_PREAMBLE | PaintDamage::SVG);+ use crate::painting::record::change_ticks::RowPaintChange;+ layout_arena.note_paint_change(slot, RowPaintChange::DRAWING);}}diff --git a/Libraries/LibWeb/Rust/src/painting/visual_context/records.rs b/Libraries/LibWeb/Rust/src/painting/visual_context/records.rsindex 760f12b52c5..68ce364be4c 100644--- a/Libraries/LibWeb/Rust/src/painting/visual_context/records.rs+++ b/Libraries/LibWeb/Rust/src/painting/visual_context/records.rs@@ -21,8 +21,8 @@ pub struct VisualContextState {pub(crate) last_compositor_scroll_inputs: Option<super::compositor_scroll_table::CompositorScrollInputs>,// The owners of the tree's compositor scroll rows, in row order, so refresh can find boxes that left the table.pub(crate) compositor_scroll_owners: Vec<NodeSlotId>,- // The paint damage push revision the table's snap geometry was last brought up to.- pub(crate) compositor_snap_damage_revision: Option<u64>,+ // The paint generation the table's snap geometry was last brought up to.+ pub(crate) compositor_snap_records_as_of: Option<crate::painting::record::change_ticks::PaintGeneration>,pub last_tree_inputs: Option<crate::painting::host::FfiVisualContextTreeInputs>,// The viewport's overflow when the tree was last updated. A sticky box finds its scrolling box by it.pub last_viewport_overflow: (u8, u8),diff --git a/Libraries/LibWeb/Rust/src/render_state/clock.rs b/Libraries/LibWeb/Rust/src/render_state/clock.rsindex d07149a3981..bb28df5ab23 100644--- a/Libraries/LibWeb/Rust/src/render_state/clock.rs+++ b/Libraries/LibWeb/Rust/src/render_state/clock.rs@@ -44,7 +44,7 @@ use crate::paint_stage::Presenting;use crate::painting::paint_passes::{ClockTickVisualContexts, VisualContextsNeedHost, prepare_for_clock_tick};use crate::painting::paintable_geometry::absolute_border_box_rect;use crate::painting::presentation::Presentation;-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::RowPaintChange;use crate::painting::record::inputs::UnframedRecordingInputs;use crate::painting::record::publish::{published_vector_image_records, renders_vector_images, take_in_recording};use crate::painting::record::recorder_state::RecorderState;@@ -930,7 +930,7 @@ impl Lane {if let Some(host_style) = arena.install_sample(row, restyled, crate::layout::SampleKind::Animation)? {self.ticked.push((row, host_style));}- arena.push_paint_damage_for_repaint(row, PaintDamage::ALL_PRODUCERS);+ arena.note_paint_change_for_repaint(row, RowPaintChange::EVERYTHING_IT_PAINTS);}}self.mark_all_for_tree_build(state, rebuilt)@@ -1104,7 +1104,7 @@ fn restore_samples_for_build(let mut held = held.into_iter();for (row, host_style) in ticked.extract_if(.., |_| held.next().expect("each ticked row was asked once")) {arena.restore_host_style(row, host_style, crate::layout::StyleRelayout::ByLayoutAffectingGroups);- arena.push_paint_damage_for_repaint(row, PaintDamage::ALL_PRODUCERS);+ arena.note_paint_change_for_repaint(row, RowPaintChange::EVERYTHING_IT_PAINTS);}Ok(())}@@ -1506,7 +1506,7 @@ impl Lane {Ok(host_style) => self.ticked.extend(host_style.map(|host_style| (row, host_style))),Err(_) => shown = Err(Park("a rebuilt box takes no restyle")),}- arena.push_paint_damage_for_repaint(row, PaintDamage::ALL_PRODUCERS);+ arena.note_paint_change_for_repaint(row, RowPaintChange::EVERYTHING_IT_PAINTS);}arena.with_style_engine(|engine| engine.unpin_layout_style_record(record));}@@ -1661,10 +1661,11 @@ fn freeze_tick_frame(return Err(Park("a trace reads the recording"));}let visual_contexts = prepare_for_clock_tick(arena, viewport)?;- // A tick's frame copies from the lane's own, and its damage stays: the whole document would record again on every tick.- if arena.paint_damage_covers_everything()- || arena.scroll_metadata_damaged_everywhere()- || recorder.published_recording.is_none()+ // A tick's frame reuses from the lane's own, where the whole document would record again on every tick.+ if recorder+ .published_recording+ .as_ref()+ .is_none_or(|published| arena.everything_paints_anew_since(published.recorded_as_of)){return Err(Park("the whole document records again"));}diff --git a/Libraries/LibWeb/Rust/src/render_state/clock/effects.rs b/Libraries/LibWeb/Rust/src/render_state/clock/effects.rsindex e8eecfb97f0..d4cbd6ba5d8 100644--- a/Libraries/LibWeb/Rust/src/render_state/clock/effects.rs+++ b/Libraries/LibWeb/Rust/src/render_state/clock/effects.rs@@ -21,7 +21,7 @@ use crate::css::transition::{HoverTransitions, LaneTransitions};use crate::layout::node_data::{GENERATED_FOR_AFTER, GENERATED_FOR_BEFORE, GENERATED_FOR_MARKER, NodeSlotId};use crate::layout::{LayoutNodeArena, SampleKind, StyleRelayout};use crate::painting::host::FfiVisualAnimationTargetKind;-use crate::painting::record::damage::PaintDamage;+use crate::painting::record::change_ticks::RowPaintChange;use crate::painting::visual_animation::VisualAnimation;use crate::render_state::RenderState;use smallvec::SmallVec;@@ -469,7 +469,7 @@ impl Lane {}self.ticked.extend(host_style.map(|host_style| (row, host_style)));arena.note_style_visual_context_moves(row, damage);- arena.push_paint_damage_for_repaint(row, PaintDamage::ALL_PRODUCERS);+ arena.note_paint_change_for_repaint(row, RowPaintChange::EVERYTHING_IT_PAINTS);}/// Shows `element`'s sample of the effects of the element in its box, and what `overlay`, the values it animates,@@ -812,7 +812,7 @@ impl Lane {let arena = state.arena.arena_mut();arena.restore_host_style(row, host_style, StyleRelayout::ByDamage(damage));arena.note_style_visual_context_moves(row, damage);- arena.push_paint_damage_for_repaint(row, PaintDamage::ALL_PRODUCERS);+ arena.note_paint_change_for_repaint(row, RowPaintChange::EVERYTHING_IT_PAINTS);moved = true;}}diff --git a/Tests/LibWeb/Text/input/display_list/clean-scope-hit-geometry.html b/Tests/LibWeb/Text/input/display_list/clean-scope-hit-geometry.htmlindex d1393e9d7f4..404dc4481ab 100644--- a/Tests/LibWeb/Text/input/display_list/clean-scope-hit-geometry.html+++ b/Tests/LibWeb/Text/input/display_list/clean-scope-hit-geometry.html@@ -22,7 +22,6 @@ displayListTest({mutate: () => { other.style.height = "60px"; },check: equal => { equal(document.caretPositionFromPoint(20, 20)?.offsetNode, textNode, "caret target"); },expect: `- damage: rows=4 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -67,7 +66,6 @@ displayListTest({mutate: () => { document.getElementById("external").style.marginRight = "25px"; },check: equal => { equal(document.caretPositionFromPoint(20, 20)?.offsetNode, textNode, "caret target"); },expect: `- damage: rows=4 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-cache-abspos-child-insertion.html b/Tests/LibWeb/Text/input/display_list/paint-cache-abspos-child-insertion.htmlindex 9a77a674714..aa7aac7c5dd 100644--- a/Tests/LibWeb/Text/input/display_list/paint-cache-abspos-child-insertion.html+++ b/Tests/LibWeb/Text/input/display_list/paint-cache-abspos-child-insertion.html@@ -34,16 +34,15 @@ const insertionStep = {BlockContainer<DIV>#inserted/block RUN (cache=miss)`,displayList: `- damage: rows=5 moved=1 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPY@@ -97,7 +96,6 @@ displayListTest({{name: "quiet before abspos insertion",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,@@ -106,7 +104,6 @@ displayListTest({{name: "quiet after abspos insertion",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,@@ -119,16 +116,15 @@ displayListTest({equal(document.elementFromPoint(170, 30).id, "container", "removed child no longer hit");},expect: `- damage: rows=4 moved=0 order=2 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPY@@ -167,7 +163,6 @@ displayListTest({{name: "quiet after abspos removal",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,diff --git a/Tests/LibWeb/Text/input/display_list/paint-cache-first-recording-and-relayout.html b/Tests/LibWeb/Text/input/display_list/paint-cache-first-recording-and-relayout.htmlindex 1a84b81c96f..3d1ceece577 100644--- a/Tests/LibWeb/Text/input/display_list/paint-cache-first-recording-and-relayout.html+++ b/Tests/LibWeb/Text/input/display_list/paint-cache-first-recording-and-relayout.html@@ -25,7 +25,6 @@ displayListTest({name: "cold recording",cold: true,expect: `- damage: rows=6 moved=0 order=0 eligibility=0 all=true@canvas RECORD (empty)@viewport RECORD@viewport/preamble RECORD (empty)@@ -81,7 +80,6 @@ displayListTest({name: "relayout one card",mutate: () => { card1.firstChild.data = "Edited"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-cache-interior-change-after-quiet-frame.html b/Tests/LibWeb/Text/input/display_list/paint-cache-interior-change-after-quiet-frame.htmlindex 2ea15637827..456566240b4 100644--- a/Tests/LibWeb/Text/input/display_list/paint-cache-interior-change-after-quiet-frame.html+++ b/Tests/LibWeb/Text/input/display_list/paint-cache-interior-change-after-quiet-frame.html@@ -26,7 +26,6 @@ displayListTest({name: "first interior change",mutate: () => { card0.style.color = "red"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -75,7 +74,6 @@ displayListTest({{name: "quiet recording",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -84,7 +82,6 @@ displayListTest({name: "second interior change",mutate: () => { card0.style.color = "blue"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-cache-relayout-paint-inputs.html b/Tests/LibWeb/Text/input/display_list/paint-cache-relayout-paint-inputs.htmlindex 5c575598b83..c4ac07d1804 100644--- a/Tests/LibWeb/Text/input/display_list/paint-cache-relayout-paint-inputs.html+++ b/Tests/LibWeb/Text/input/display_list/paint-cache-relayout-paint-inputs.html@@ -32,7 +32,6 @@ displayListTest({CanvasBox<CANVAS>#trigger/internal-replaced RUN (cache=bypass)`,displayList: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,@@ -43,7 +42,6 @@ displayListTest({mutate: () => { document.getElementById("inline").firstChild.data = "Changed!"; },check: equal => { equal(target.getBoundingClientRect().height, 40, "unchanged target height"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -114,7 +112,6 @@ displayListTest({CanvasBox<CANVAS>#trigger/internal-replaced RUN (cache=bypass)`,displayList: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-cache-scrollability-flip-scope.html b/Tests/LibWeb/Text/input/display_list/paint-cache-scrollability-flip-scope.htmlindex d08b5b8da73..07858096460 100644--- a/Tests/LibWeb/Text/input/display_list/paint-cache-scrollability-flip-scope.html+++ b/Tests/LibWeb/Text/input/display_list/paint-cache-scrollability-flip-scope.html@@ -40,7 +40,6 @@ displayListTest({name: "quiet before scrollability change",check: equal => { equal(nestedElementScrollers(), 0, "inner has no element scroller parent"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -49,7 +48,6 @@ displayListTest({name: "change an unrelated box",mutate: () => { document.getElementById("row-2").style.color = "red"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -110,7 +108,6 @@ displayListTest({mutate: () => { filler.className = "tall"; },check: equal => { equal(nestedElementScrollers(), 1, "inner reports outer as its parent"); },expect: `- damage: rows=8 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -200,16 +197,15 @@ displayListTest({name: "insert scrollable box in second row",mutate: () => { const inserted = document.createElement("div"); inserted.id = "inserted"; inserted.className = "box"; inserted.style.overflow = "hidden"; inserted.innerHTML = '<div id="inserted-content" class="tall"></div>'; document.getElementById("second-row-1").after(inserted); },expect: `- damage: rows=7 moved=3 order=4 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-cache-unchanged-relayout.html b/Tests/LibWeb/Text/input/display_list/paint-cache-unchanged-relayout.htmlindex 77426533d40..14fb5f0c949 100644--- a/Tests/LibWeb/Text/input/display_list/paint-cache-unchanged-relayout.html+++ b/Tests/LibWeb/Text/input/display_list/paint-cache-unchanged-relayout.html@@ -31,7 +31,6 @@ displayListTest({BlockContainer<DIV>#boundary/block REUSE SUBTREE`,displayList: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,@@ -52,7 +51,6 @@ displayListTest({CanvasBox<CANVAS>#partial/internal-replaced RUN (cache=bypass)`,displayList: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-body-background-change.html b/Tests/LibWeb/Text/input/display_list/paint-damage-body-background-change.htmlindex 22ace54703f..2ce484612c6 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-body-background-change.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-body-background-change.html@@ -17,7 +17,6 @@ displayListTest({name: "paint with overlays",paintOverlay: true,expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD@viewport RECORD@viewport/preamble RECORD (empty)@@ -60,7 +59,6 @@ displayListTest({paintOverlay: true,mutate: () => { document.body.style.background = "black"; },expect: `- damage: rows=3 moved=0 order=0 eligibility=0 all=false@canvas RECORD@viewport RECORD@viewport/preamble RECORD (empty)@@ -102,7 +100,6 @@ displayListTest({name: "quiet with overlays",paintOverlay: true,expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-child-reorder.html b/Tests/LibWeb/Text/input/display_list/paint-damage-child-reorder.htmlindex 99bac09c28e..b731a762fc4 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-child-reorder.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-child-reorder.html@@ -20,7 +20,6 @@ displayListTest({name: "quiet before the swap",check: equal => { equal(document.elementFromPoint(75, 50).id, "b", "hit target"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -30,7 +29,6 @@ displayListTest({mutate: () => { panel.insertBefore(b, a); },check: equal => { equal(document.elementFromPoint(75, 50).id, "a", "hit target"); },expect: `- damage: rows=5 moved=1 order=2 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-clip-added-on-ancestor.html b/Tests/LibWeb/Text/input/display_list/paint-damage-clip-added-on-ancestor.htmlindex 40d881caa81..33df9549d70 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-clip-added-on-ancestor.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-clip-added-on-ancestor.html@@ -19,7 +19,6 @@ displayListTest({mutate: () => { wrap.style.overflow = "hidden"; },check: equal => { equal(document.elementFromPoint(10, 10).id, "inner", "hit target"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -68,7 +67,6 @@ displayListTest({{name: "quiet after clipping",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-compositor-retention.html b/Tests/LibWeb/Text/input/display_list/paint-damage-compositor-retention.htmlindex d5829769ddb..f69a3bd8272 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-compositor-retention.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-compositor-retention.html@@ -25,7 +25,6 @@ displayListTest({{name: "quiet while the animation runs on the compositor",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -34,7 +33,6 @@ displayListTest({name: "a selection pass after the animation started",mutate: () => { internals.updateCompositorAnimations(); },expect: `- damage: rows=4 moved=0 order=0 eligibility=1 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -53,11 +51,11 @@ displayListTest({BlockContainer<BODY>#body/scroll-metadata COPYBlockContainer<BODY>#body/background COPYBlockContainer<BODY>#body/border COPY- BlockContainer<DIV>#box/descendants(background-and-borders) ASSEMBLE+ BlockContainer<DIV>#box/descendants(background-and-borders) REPLANBlockContainer<HTML>#html/foreground COPYBlockContainer<BODY>#body/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/foreground COPY- BlockContainer<DIV>#box/descendants(foreground) ASSEMBLE+ BlockContainer<DIV>#box/descendants(foreground) REPLANBlockContainer<BODY>#body/outline COPYBlockContainer<BODY>#body/overlay COPYBlockContainer<DIV>#box REPLAN@@ -75,7 +73,6 @@ displayListTest({name: "a selection pass that keeps the animation on the compositor",mutate: () => { internals.updateCompositorAnimations(); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -84,7 +81,6 @@ displayListTest({name: "remove the animation",mutate: () => { box.style.animation = "none"; box.getBoundingClientRect(); internals.updateCompositorAnimations(); },expect: `- damage: rows=4 moved=0 order=0 eligibility=1 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -103,11 +99,11 @@ displayListTest({BlockContainer<BODY>#body/scroll-metadata COPYBlockContainer<BODY>#body/background COPYBlockContainer<BODY>#body/border COPY- BlockContainer<DIV>#box/descendants(background-and-borders) ASSEMBLE+ BlockContainer<DIV>#box/descendants(background-and-borders) REPLANBlockContainer<HTML>#html/foreground COPYBlockContainer<BODY>#body/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/foreground COPY- BlockContainer<DIV>#box/descendants(foreground) ASSEMBLE+ BlockContainer<DIV>#box/descendants(foreground) REPLANBlockContainer<BODY>#body/outline COPYBlockContainer<BODY>#body/overlay COPYBlockContainer<DIV>#box SKIP@@ -118,7 +114,6 @@ displayListTest({{name: "quiet after the animation",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-containing-block-change.html b/Tests/LibWeb/Text/input/display_list/paint-damage-containing-block-change.htmlindex cc43f40fe36..f009f890374 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-containing-block-change.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-containing-block-change.html@@ -20,16 +20,15 @@ displayListTest({mutate: () => { document.getElementById("parent").style.position = "relative"; },check: equal => { equal(document.elementFromPoint(20, 20).id, "child", "hit target"); },expect: `- damage: rows=5 moved=2 order=5 eligibility=0 all=false@canvas RECORD (empty)@viewport REPLAN@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPY@@ -71,7 +70,6 @@ displayListTest({{name: "quiet after the containing block change",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-dirty-while-skipped.html b/Tests/LibWeb/Text/input/display_list/paint-damage-dirty-while-skipped.htmlindex c6d153cddf1..fef368cfb7e 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-dirty-while-skipped.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-dirty-while-skipped.html@@ -20,7 +20,6 @@ displayListTest({mutate: () => { root.style.transform = "scale(0)"; },check: equal => { equal(document.elementFromPoint(10, 10).id, "html", "hit target"); },expect: `- damage: rows=4 moved=0 order=0 eligibility=1 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -39,11 +38,11 @@ displayListTest({BlockContainer<BODY>#body/scroll-metadata COPYBlockContainer<BODY>#body/background COPYBlockContainer<BODY>#body/border COPY- BlockContainer<DIV>#root/descendants(background-and-borders) ASSEMBLE+ BlockContainer<DIV>#root/descendants(background-and-borders) REPLANBlockContainer<HTML>#html/foreground COPYBlockContainer<BODY>#body/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/foreground COPY- BlockContainer<DIV>#root/descendants(foreground) ASSEMBLE+ BlockContainer<DIV>#root/descendants(foreground) REPLANBlockContainer<BODY>#body/outline COPYBlockContainer<BODY>#body/overlay COPYBlockContainer<DIV>#root SKIP@@ -55,7 +54,6 @@ displayListTest({name: "restyle the target while its context is collapsed",mutate: () => { target.style.background = "blue"; target.style.pointerEvents = "none"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -89,7 +87,6 @@ displayListTest({{name: "quiet frame keeps the context collapsed",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -99,7 +96,6 @@ displayListTest({mutate: () => { root.style.transform = "scale(1)"; },check: equal => { equal(document.elementFromPoint(10, 10).id, "root", "hit target"); },expect: `- damage: rows=4 moved=0 order=0 eligibility=1 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -118,11 +114,11 @@ displayListTest({BlockContainer<BODY>#body/scroll-metadata COPYBlockContainer<BODY>#body/background COPYBlockContainer<BODY>#body/border COPY- BlockContainer<DIV>#root/descendants(background-and-borders) ASSEMBLE+ BlockContainer<DIV>#root/descendants(background-and-borders) REPLANBlockContainer<HTML>#html/foreground COPYBlockContainer<BODY>#body/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/foreground COPY- BlockContainer<DIV>#root/descendants(foreground) ASSEMBLE+ BlockContainer<DIV>#root/descendants(foreground) REPLANBlockContainer<BODY>#body/outline COPYBlockContainer<BODY>#body/overlay COPYBlockContainer<DIV>#root REPLAN@@ -150,7 +146,6 @@ displayListTest({mutate: () => { target.style.pointerEvents = "auto"; },check: equal => { equal(document.elementFromPoint(10, 10).id, "target", "hit target"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-flex-item-z-index.html b/Tests/LibWeb/Text/input/display_list/paint-damage-flex-item-z-index.htmlindex 2800843946c..b33e5818fa8 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-flex-item-z-index.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-flex-item-z-index.html@@ -20,7 +20,6 @@ displayListTest({name: "quiet before the z-index change",check: equal => { equal(document.elementFromPoint(10, 10).id, "back", "hit target"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -30,16 +29,15 @@ displayListTest({mutate: () => { front.style.zIndex = "2"; },check: equal => { equal(document.elementFromPoint(10, 10).id, "front", "hit target"); },expect: `- damage: rows=5 moved=0 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPY@@ -83,16 +81,15 @@ displayListTest({mutate: () => { front.style.zIndex = "auto"; },check: equal => { equal(document.elementFromPoint(10, 10).id, "back", "hit target"); },expect: `- damage: rows=5 moved=0 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-float-toggle.html b/Tests/LibWeb/Text/input/display_list/paint-damage-float-toggle.htmlindex 069aba75049..b446a6c873e 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-float-toggle.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-float-toggle.html@@ -19,7 +19,6 @@ displayListTest({name: "quiet before floating",check: equal => { equal(document.elementFromPoint(60, 10).id, "box", "hit target"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -29,16 +28,15 @@ displayListTest({mutate: () => { floater.style.float = "left"; },check: equal => { equal(document.elementFromPoint(60, 10).id, "text", "hit target"); },expect: `- damage: rows=6 moved=2 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble RECORD (empty)BlockContainer<HTML>#html/scroll-metadata RECORD (empty)@@ -90,16 +88,15 @@ displayListTest({mutate: () => { floater.style.float = "none"; },check: equal => { equal(document.elementFromPoint(60, 10).id, "box", "hit target"); },expect: `- damage: rows=6 moved=2 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble RECORD (empty)BlockContainer<HTML>#html/scroll-metadata RECORD (empty)diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-removal-among-siblings.html b/Tests/LibWeb/Text/input/display_list/paint-damage-removal-among-siblings.htmlindex 9629d1e0001..05eadac5f25 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-removal-among-siblings.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-removal-among-siblings.html@@ -31,7 +31,6 @@ displayListTest({equal(document.elementFromPoint(220, 20).id, "card4", "hit target on the next card");},expect: `- damage: rows=4 moved=0 order=1 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -86,7 +85,6 @@ displayListTest({{name: "quiet after the removal",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-reparent-into-flex.html b/Tests/LibWeb/Text/input/display_list/paint-damage-reparent-into-flex.htmlindex bcb4c35ed8e..66f132d1fc1 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-reparent-into-flex.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-reparent-into-flex.html@@ -22,7 +22,6 @@ displayListTest({equal(document.elementFromPoint(10, 30).id, "stay", "hit target on the flex item");},expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -35,7 +34,6 @@ displayListTest({equal(document.elementFromPoint(70, 10).id, "moved", "hit target on the moved item");},expect: `- damage: rows=6 moved=2 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-root-overflow-growth.html b/Tests/LibWeb/Text/input/display_list/paint-damage-root-overflow-growth.htmlindex 1b82b0c4fc8..e1515652098 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-root-overflow-growth.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-root-overflow-growth.html@@ -21,7 +21,6 @@ displayListTest({mutate: () => { far.style.top = "1000px"; },check: equal => { equal(document.documentElement.scrollHeight, 1050, "scroll height"); },expect: `- damage: rows=5 moved=1 order=0 eligibility=0 all=false@canvas RECORD@viewport ASSEMBLE@viewport/preamble RECORD (empty)@@ -45,7 +44,7 @@ displayListTest({BlockContainer<DIV>#text/background SKIPBlockContainer<DIV>#text/border SKIPBlockContainer<DIV>#far/descendants(background-and-borders) ASSEMBLE- BlockContainer<HTML>#html/foreground COPY+ BlockContainer<HTML>#html/foreground RECORD (empty)BlockContainer<BODY>#body/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/foreground COPYBlockContainer<DIV>#text/descendants(foreground) ASSEMBLE@@ -62,14 +61,13 @@ displayListTest({BlockContainer<DIV>#far/foreground RECORD (empty)BlockContainer<DIV>#far/outline SKIPBlockContainer<DIV>#far/overlay SKIP- BlockContainer<HTML>#html/outline COPY+ BlockContainer<HTML>#html/outline SKIP@viewport/outline SKIP`},{name: "quiet after the growth",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-content-move.html b/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-content-move.htmlindex 4744973cc00..a8966f87469 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-content-move.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-content-move.html@@ -20,7 +20,6 @@ displayListTest({mutate: () => { row1.style.marginTop = "10px"; },check: equal => { equal(scroller.scrollHeight, 190, "scroll height"); },expect: `- damage: rows=6 moved=2 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -56,7 +55,7 @@ displayListTest({BlockContainer<BODY>#body/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/foreground COPYBlockContainer<DIV>#scroller/descendants(foreground) ASSEMBLE- BlockContainer<DIV>#scroller/foreground COPY+ BlockContainer<DIV>#scroller/foreground RECORD (empty)BlockContainer<DIV>#row0.row/descendants(foreground) COPYBlockContainer<DIV>#row1.row/descendants(foreground) ASSEMBLEBlockContainer<DIV>#row1.row/foreground RECORD (empty)@@ -78,7 +77,6 @@ displayListTest({name: "recolor the second row",mutate: () => { row1.style.background = "red"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-slot-reuse.html b/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-slot-reuse.htmlindex d5b132e98cc..cd26fe802ec 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-slot-reuse.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-scroller-slot-reuse.html@@ -29,7 +29,6 @@ displayListTest({equal(wheelTargetAt(50, 60), "no-scroll-target", "wheel target on the box that moved up");},expect: `- damage: rows=4 moved=1 order=1 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -74,11 +73,9 @@ displayListTest({BlockContainer<HTML>#html/outline SKIP@viewport/outline COPYrecording (overlay=false)- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPYrecording (overlay=false)- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -86,7 +83,6 @@ displayListTest({{name: "quiet frame releases the scroll node",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -96,7 +92,6 @@ displayListTest({mutate: () => { outer.style.overflow = "scroll"; },check: equal => { equal(wheelTargetAt(50, 60), "latched scroller=#outer", "wheel target on the new scroller"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -124,9 +119,9 @@ displayListTest({BlockContainer<DIV>#outer-content.content/scroll-metadata RECORDBlockContainer<DIV>#outer-content.content/background SKIPBlockContainer<DIV>#outer-content.content/border SKIP- BlockContainer<HTML>#html/foreground COPY+ BlockContainer<HTML>#html/foreground RECORD (empty)BlockContainer<BODY>#body/descendants(foreground) ASSEMBLE- BlockContainer<BODY>#body/foreground COPY+ BlockContainer<BODY>#body/foreground RECORD (empty)BlockContainer<DIV>#keep.box.scroller/descendants(foreground) COPYBlockContainer<DIV>#outer.box/descendants(foreground) ASSEMBLEBlockContainer<DIV>#outer.box/foreground RECORD (empty)@@ -138,10 +133,9 @@ displayListTest({BlockContainer<DIV>#outer.box/overlay RECORDBlockContainer<BODY>#body/outline SKIPBlockContainer<BODY>#body/overlay SKIP- BlockContainer<HTML>#html/outline COPY+ BlockContainer<HTML>#html/outline SKIP@viewport/outline COPYrecording (overlay=false)- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -151,7 +145,6 @@ displayListTest({mutate: () => { document.getElementById("outer-content").style.color = "red"; },check: equal => { equal(wheelTargetAt(50, 60), "latched scroller=#outer", "wheel target on the new scroller"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -196,7 +189,6 @@ displayListTest({BlockContainer<HTML>#html/outline COPY@viewport/outline COPYrecording (overlay=false)- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-selection-change.html b/Tests/LibWeb/Text/input/display_list/paint-damage-selection-change.htmlindex 0ab51491673..9f78657b327 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-selection-change.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-selection-change.html@@ -18,7 +18,6 @@ displayListTest({name: "select the middle block",mutate: () => { getSelection().selectAllChildren(target); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble RECORD (empty)@@ -70,7 +69,6 @@ displayListTest({name: "clear the selection",mutate: () => { getSelection().removeAllRanges(); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble RECORD (empty)diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-shifted-siblings.html b/Tests/LibWeb/Text/input/display_list/paint-damage-shifted-siblings.htmlindex e97b8be8583..60af391a024 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-shifted-siblings.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-shifted-siblings.html@@ -21,7 +21,6 @@ displayListTest({mutate: () => { c0.style.height = "10px"; },check: equal => { equal(document.elementFromPoint(15, 15).id, "c1-text", "hit target"); },expect: `- damage: rows=7 moved=2 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -109,7 +108,6 @@ displayListTest({{name: "quiet after the shift",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/paint-damage-snap-area-move.html b/Tests/LibWeb/Text/input/display_list/paint-damage-snap-area-move.htmlindex b8f04493d3c..c68ba58b7ab 100644--- a/Tests/LibWeb/Text/input/display_list/paint-damage-snap-area-move.html+++ b/Tests/LibWeb/Text/input/display_list/paint-damage-snap-area-move.html@@ -22,7 +22,6 @@ displayListTest({name: "quiet before the move",check: () => { topOfSecondSnapAreaBeforeTheMove = topOfSecondSnapArea(); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -34,7 +33,6 @@ displayListTest({equal(topOfSecondSnapArea() - topOfSecondSnapAreaBeforeTheMove, 10, "how far the snap area moved");},expect: `- damage: rows=6 moved=2 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -70,7 +68,7 @@ displayListTest({BlockContainer<BODY>#body/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/foreground COPYBlockContainer<DIV>#snap/descendants(foreground) ASSEMBLE- BlockContainer<DIV>#snap/foreground COPY+ BlockContainer<DIV>#snap/foreground RECORD (empty)BlockContainer<DIV>#area0.area/descendants(foreground) COPYBlockContainer<DIV>#area1.area/descendants(foreground) ASSEMBLEBlockContainer<DIV>#area1.area/foreground RECORD (empty)@@ -91,7 +89,6 @@ displayListTest({{name: "quiet after the move",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region-top-layer.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region-top-layer.htmlindex d50e267e01c..0f18a31af6a 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region-top-layer.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region-top-layer.html@@ -22,7 +22,6 @@ displayListTest({name: "quiet modal",check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(250, 250), false, "blocking wheel region"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -32,7 +31,6 @@ displayListTest({mutate: () => { host.style.height = "101px"; host.addEventListener("wheel", blocking, { passive: false }); },check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(250, 250), true, "blocking wheel region"); },expect: `- damage: rows=6 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -91,7 +89,6 @@ displayListTest({name: "quiet modal with listener",check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(250, 250), true, "blocking wheel region"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -101,7 +98,6 @@ displayListTest({mutate: () => { host.removeEventListener("wheel", blocking); },check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(250, 250), false, "blocking wheel region"); },expect: `- damage: rows=6 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region.htmlindex d35426b5da0..75fb4de73f2 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-blocking-wheel-region.html@@ -20,7 +20,6 @@ displayListTest({name: "quiet without listeners",check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(50, 150), false, "blocking wheel region"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -30,7 +29,6 @@ displayListTest({mutate: () => { target.addEventListener("wheel", passive, { passive: true }); },check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(50, 150), false, "blocking wheel region"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -40,7 +38,6 @@ displayListTest({mutate: () => { target.addEventListener("wheel", blocking, { passive: false }); },check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(50, 150), true, "blocking wheel region"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -94,7 +91,6 @@ displayListTest({name: "quiet with blocking listener",check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(50, 150), true, "blocking wheel region"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -104,7 +100,6 @@ displayListTest({mutate: () => { target.removeEventListener("wheel", blocking); },check: equal => { equal(internals.recordedDisplayListBlocksWheelEventAt(50, 150), false, "blocking wheel region"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-canvas-color-change.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-canvas-color-change.htmlindex be1eee932e2..4e647516038 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-canvas-color-change.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-canvas-color-change.html@@ -20,7 +20,6 @@ displayListTest({{name: "quiet light canvas",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -29,7 +28,6 @@ displayListTest({name: "change canvas to dark",mutate: () => { internals.setPreferredColorScheme("dark"); },expect: `- damage: rows=4 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport RECORD@viewport/preamble RECORD (empty)@@ -68,7 +66,6 @@ displayListTest({{name: "quiet dark canvas",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-clean-sibling-context.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-clean-sibling-context.htmlindex 86a9ae466e7..7221c1c6be2 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-clean-sibling-context.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-clean-sibling-context.html@@ -26,7 +26,6 @@ displayListTest({{name: "quiet siblings",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -35,7 +34,6 @@ displayListTest({name: "change inside B",mutate: () => { b0.style.color = "red"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -93,7 +91,6 @@ displayListTest({name: "change inside A while B is clean",mutate: () => { a0.style.color = "red"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-iframe.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-iframe.htmlindex 04a3e4be3b5..2dd6ed8d049 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-iframe.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-iframe.html@@ -17,7 +17,6 @@ displayListTest({{name: "quiet iframe",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -27,7 +26,6 @@ displayListTest({mutate: () => { after.style.color = "red"; },check: equal => { equal(document.elementFromPoint(50, 30).id, "frame", "hit target"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -83,7 +81,6 @@ displayListTest({{name: "quiet after adjacent change",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-interior-change-after-quiet-frames.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-interior-change-after-quiet-frames.htmlindex 21d4958046b..eabc7705c67 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-interior-change-after-quiet-frames.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-interior-change-after-quiet-frames.html@@ -27,7 +27,6 @@ displayListTest({name: "first interior change",mutate: () => { b0.style.color = "red"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -84,7 +83,6 @@ displayListTest({{name: "first quiet recording",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -92,7 +90,6 @@ displayListTest({{name: "second quiet recording",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -101,7 +98,6 @@ displayListTest({name: "second interior change",mutate: () => { b0.style.color = "blue"; },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-masked-box.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-masked-box.htmlindex a651ea2f300..eb4eccfc5ab 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-masked-box.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-masked-box.html@@ -16,7 +16,6 @@ displayListTest({{name: "quiet masked root",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -26,7 +25,6 @@ displayListTest({mutate: () => { r1.style.color = "red"; },check: equal => { equal(document.elementFromPoint(10, 30).id, "r1", "hit target"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-moved-box.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-moved-box.htmlindex c19e2a7c633..274b4c0e3d8 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-moved-box.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-moved-box.html@@ -18,7 +18,6 @@ displayListTest({name: "quiet before moving B",check: equal => { equal(document.elementFromPoint(10, 110).id, "html", "hit target"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -29,7 +28,6 @@ displayListTest({mutate: () => { b.style.top = "20px"; },check: equal => { equal(document.elementFromPoint(10, 110).id, "b2", "hit target"); },expect: `- damage: rows=4 moved=1 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -50,9 +48,9 @@ displayListTest({BlockContainer<BODY>#body/border SKIPBlockContainer<DIV>#a/descendants(background-and-borders) COPYBlockContainer<DIV>#b/descendants(background-and-borders) ASSEMBLE- BlockContainer<HTML>#html/foreground COPY+ BlockContainer<HTML>#html/foreground RECORD (empty)BlockContainer<BODY>#body/descendants(foreground) ASSEMBLE- BlockContainer<BODY>#body/foreground COPY+ BlockContainer<BODY>#body/foreground RECORD (empty)BlockContainer<DIV>#a/descendants(foreground) COPYBlockContainer<DIV>#b/descendants(foreground) ASSEMBLEBlockContainer<BODY>#body/outline SKIP@@ -95,14 +93,13 @@ displayListTest({BlockContainer<DIV>#b2.row/overlay SKIPBlockContainer<DIV>#b/outline SKIPBlockContainer<DIV>#b/overlay SKIP- BlockContainer<HTML>#html/outline COPY+ BlockContainer<HTML>#html/outline SKIP@viewport/outline COPY`},{name: "quiet after moving B",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-new-positioned-descendant.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-new-positioned-descendant.htmlindex 57c259eeebe..107a55bde52 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-new-positioned-descendant.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-new-positioned-descendant.html@@ -17,7 +17,6 @@ displayListTest({{name: "quiet before insertion",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -28,16 +27,15 @@ displayListTest({mutate: () => { const inserted = document.createElement("div"); inserted.id = "inserted"; inserted.className = "row"; inserted.style.position = "relative"; inserted.textContent = "B 1"; b.appendChild(inserted); },check: equal => { equal(document.elementFromPoint(10, 70).id, "inserted", "hit target"); },expect: `- damage: rows=5 moved=1 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble RECORD (empty)BlockContainer<HTML>#html/scroll-metadata RECORD (empty)@@ -86,7 +84,6 @@ displayListTest({{name: "quiet after insertion",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-overlay-config.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-overlay-config.htmlindex 13430007881..adcb06006ef 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-overlay-config.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-overlay-config.html@@ -17,7 +17,6 @@ displayListTest({{name: "quiet without overlays",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -26,7 +25,6 @@ displayListTest({name: "enable overlays",paintOverlay: true,expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport RECORD@viewport/preamble RECORD (empty)@@ -87,7 +85,6 @@ displayListTest({{name: "disable overlays",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport RECORD@viewport/preamble RECORD (empty)@@ -144,7 +141,6 @@ displayListTest({{name: "quiet without overlays again",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-self-contained-svg.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-self-contained-svg.htmlindex 2e6b2fe81f5..8a2db844e01 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-self-contained-svg.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-self-contained-svg.html@@ -16,7 +16,6 @@ displayListTest({{name: "quiet SVG",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -26,7 +25,6 @@ displayListTest({mutate: () => { p.setAttribute("fill", "blue"); },check: equal => { equal(document.elementFromPoint(15, 15).id, "p", "hit target"); },expect: `- damage: rows=6 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -81,7 +79,6 @@ displayListTest({{name: "quiet after SVG change",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-context.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-context.htmlindex 5306f056d93..a0a3548efcc 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-context.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-context.html@@ -17,7 +17,6 @@ displayListTest({{name: "quiet SVG with external paint server",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -26,7 +25,6 @@ displayListTest({name: "edit external gradient",mutate: () => { s0.setAttribute("stop-color", "blue"); },expect: `- damage: rows=6 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-mask-area-change.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-mask-area-change.htmlindex 2d0d3e4e40f..63e1c76fa02 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-mask-area-change.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-svg-mask-area-change.html@@ -20,7 +20,6 @@ displayListTest({name: "quiet empty mask",check: equal => { equal(document.elementFromPoint(50, 50) === masked, false, "empty mask excludes hit"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -30,7 +29,6 @@ displayListTest({mutate: () => { m.setAttribute("width", "200"); },check: equal => { equal(document.elementFromPoint(50, 50), masked, "expanded mask includes hit"); },expect: `- damage: rows=7 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-z-order-change.html b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-z-order-change.htmlindex 565e8947c16..a9541d35b39 100644--- a/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-z-order-change.html+++ b/Tests/LibWeb/Text/input/display_list/painted-as-stacking-context-capture-z-order-change.html@@ -19,7 +19,6 @@ displayListTest({name: "quiet before reordering",check: equal => { equal(document.elementFromPoint(50, 50).id, "b", "hit target"); },expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -29,16 +28,15 @@ displayListTest({mutate: () => { b.style.zIndex = "-1"; },check: equal => { equal(document.elementFromPoint(50, 50).id, "a", "hit target"); },expect: `- damage: rows=4 moved=0 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPY@@ -74,16 +72,15 @@ displayListTest({mutate: () => { b.style.zIndex = "1"; },check: equal => { equal(document.elementFromPoint(50, 50).id, "b", "hit target"); },expect: `- damage: rows=4 moved=0 order=3 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@viewport/scroll-metadata COPY@viewport/background COPY@viewport/border COPY- BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE+ BlockContainer<HTML>#html/descendants(background-and-borders) REPLAN@viewport/foreground COPY- BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE+ BlockContainer<HTML>#html/descendants(foreground) REPLANBlockContainer<HTML>#html REPLANBlockContainer<HTML>#html/preamble COPYBlockContainer<HTML>#html/scroll-metadata COPYdiff --git a/Tests/LibWeb/Text/input/display_list/recording-trace-owner-names.html b/Tests/LibWeb/Text/input/display_list/recording-trace-owner-names.htmlindex 150b25e132f..6e4ee0dbd28 100644--- a/Tests/LibWeb/Text/input/display_list/recording-trace-owner-names.html+++ b/Tests/LibWeb/Text/input/display_list/recording-trace-owner-names.html@@ -23,7 +23,6 @@ displayListTest({name: "change one shadow owner with a pseudo-element",mutate: () => { first.shadowRoot.getElementById("item").style.color = "red"; },expect: `- damage: rows=7 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -104,7 +103,6 @@ displayListTest({{name: "quiet shadow trees",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,diff --git a/Tests/LibWeb/Text/input/display_list/stacking-context-capture-nested-clean-sibling.html b/Tests/LibWeb/Text/input/display_list/stacking-context-capture-nested-clean-sibling.htmlindex 3147ce4a85c..f8c720ac30e 100644--- a/Tests/LibWeb/Text/input/display_list/stacking-context-capture-nested-clean-sibling.html+++ b/Tests/LibWeb/Text/input/display_list/stacking-context-capture-nested-clean-sibling.html@@ -32,7 +32,6 @@ displayListTest({check: checkHitTargets,// A must be a single reuse leaf, covering both nested contexts and their content.expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -90,7 +89,6 @@ displayListTest({name: "quiet recording covers both contexts",check: checkHitTargets,expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -101,7 +99,6 @@ displayListTest({check: checkHitTargets,// Changing the command size before B also tests relocation of B's complete capture.expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -161,7 +158,6 @@ displayListTest({check: checkHitTargets,// Descend into the previously spliced B, reusing its positive context from the first step.expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/svg-resource-clip-content-change.html b/Tests/LibWeb/Text/input/display_list/svg-resource-clip-content-change.htmlindex 45906519a8d..b135c52b8d8 100644--- a/Tests/LibWeb/Text/input/display_list/svg-resource-clip-content-change.html+++ b/Tests/LibWeb/Text/input/display_list/svg-resource-clip-content-change.html@@ -21,7 +21,6 @@ displayListTest({{name: "quiet clipped shape",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -30,7 +29,6 @@ displayListTest({name: "widen the clip content",mutate: () => { document.getElementById("clip-rect").setAttribute("width", "200"); },expect: `- damage: rows=8 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -92,7 +90,6 @@ displayListTest({{name: "quiet after the clip change",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/svg-resource-filter-change.html b/Tests/LibWeb/Text/input/display_list/svg-resource-filter-change.htmlindex f367e078d8c..fd203a4af52 100644--- a/Tests/LibWeb/Text/input/display_list/svg-resource-filter-change.html+++ b/Tests/LibWeb/Text/input/display_list/svg-resource-filter-change.html@@ -20,7 +20,6 @@ displayListTest({{name: "quiet filtered box",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -29,7 +28,6 @@ displayListTest({name: "resize the filtered box",mutate: () => { filtered.style.width = "150px"; },expect: `- damage: rows=4 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -78,7 +76,6 @@ displayListTest({name: "change the flood color",mutate: () => { flood.setAttribute("flood-color", "green"); },expect: `- damage: rows=4 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -126,7 +123,6 @@ displayListTest({{name: "quiet after the filter changes",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/svg-resource-gradient-change.html b/Tests/LibWeb/Text/input/display_list/svg-resource-gradient-change.htmlindex 8f63d376b12..3904a87b2d0 100644--- a/Tests/LibWeb/Text/input/display_list/svg-resource-gradient-change.html+++ b/Tests/LibWeb/Text/input/display_list/svg-resource-gradient-change.html@@ -19,7 +19,6 @@ displayListTest({{name: "quiet gradient fill",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -28,7 +27,6 @@ displayListTest({name: "edit a gradient stop",mutate: () => { s1.setAttribute("stop-color", "blue"); },expect: `- damage: rows=5 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -75,7 +73,6 @@ displayListTest({{name: "quiet after the gradient change",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/svg-resource-mask-content-change.html b/Tests/LibWeb/Text/input/display_list/svg-resource-mask-content-change.htmlindex dea7883ed7b..780bfa3890f 100644--- a/Tests/LibWeb/Text/input/display_list/svg-resource-mask-content-change.html+++ b/Tests/LibWeb/Text/input/display_list/svg-resource-mask-content-change.html@@ -23,7 +23,6 @@ displayListTest({{name: "quiet masked group",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`@@ -32,7 +31,6 @@ displayListTest({name: "widen the mask content",mutate: () => { document.getElementById("mask-rect").setAttribute("width", "200"); },expect: `- damage: rows=8 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -96,7 +94,6 @@ displayListTest({{name: "quiet after the mask change",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`diff --git a/Tests/LibWeb/Text/input/display_list/svg-resource-pattern-stays-live.html b/Tests/LibWeb/Text/input/display_list/svg-resource-pattern-stays-live.htmlindex 6a9ddadfee3..c4fa75c58ad 100644--- a/Tests/LibWeb/Text/input/display_list/svg-resource-pattern-stays-live.html+++ b/Tests/LibWeb/Text/input/display_list/svg-resource-pattern-stays-live.html@@ -19,7 +19,6 @@ displayListTest({{name: "quiet pattern fill",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -67,7 +66,6 @@ displayListTest({name: "recolor the tile",mutate: () => { tile.setAttribute("fill", "green"); },expect: `- damage: rows=7 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/display_list/will-change-opacity-value-update.html b/Tests/LibWeb/Text/input/display_list/will-change-opacity-value-update.htmlindex 508738f83e1..de47ce7f235 100644--- a/Tests/LibWeb/Text/input/display_list/will-change-opacity-value-update.html+++ b/Tests/LibWeb/Text/input/display_list/will-change-opacity-value-update.html@@ -17,7 +17,6 @@ const valueUpdate = `div#box effects UPDATED`;const quiet = `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`;diff --git a/Tests/LibWeb/Text/input/display_list/will-change-transform-value-update.html b/Tests/LibWeb/Text/input/display_list/will-change-transform-value-update.htmlindex 07a0123871a..d7df3116257 100644--- a/Tests/LibWeb/Text/input/display_list/will-change-transform-value-update.html+++ b/Tests/LibWeb/Text/input/display_list/will-change-transform-value-update.html@@ -17,7 +17,6 @@ const valueUpdate = `div#box transform UPDATED`;const quiet = `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`;diff --git a/Tests/LibWeb/Text/input/display_list/window-focus-change-records-caret.html b/Tests/LibWeb/Text/input/display_list/window-focus-change-records-caret.htmlindex ab86f3a589c..83fb88a0761 100644--- a/Tests/LibWeb/Text/input/display_list/window-focus-change-records-caret.html+++ b/Tests/LibWeb/Text/input/display_list/window-focus-change-records-caret.html@@ -13,7 +13,6 @@// The caret paints only while the window is focused, so a focus change records the block that paints it// again and copies everything else.const focusChangeTrace = `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -52,7 +51,6 @@ displayListTest({{name: "quiet before focus changes",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,diff --git a/Tests/LibWeb/Text/input/display_list/window-focus-change-records-focus-dependent-output.html b/Tests/LibWeb/Text/input/display_list/window-focus-change-records-focus-dependent-output.htmlindex 538bf525adc..6b4add0b767 100644--- a/Tests/LibWeb/Text/input/display_list/window-focus-change-records-focus-dependent-output.html+++ b/Tests/LibWeb/Text/input/display_list/window-focus-change-records-focus-dependent-output.html@@ -13,7 +13,6 @@// Only an outline: auto ring and the selection paint differently while the window is unfocused, so a// focus change records them again and copies everything else.const focusChangeTrace = ringOutline => `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -55,7 +54,6 @@ displayListTest({{name: "quiet before focus changes",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,@@ -68,7 +66,6 @@ displayListTest({{name: "quiet while unfocused",expect: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`,diff --git a/Tests/LibWeb/Text/input/inspector-overlay-visual-context-tree-growth.html b/Tests/LibWeb/Text/input/inspector-overlay-visual-context-tree-growth.htmlindex 39087371bea..a4b81d06457 100644--- a/Tests/LibWeb/Text/input/inspector-overlay-visual-context-tree-growth.html+++ b/Tests/LibWeb/Text/input/inspector-overlay-visual-context-tree-growth.html@@ -24,7 +24,6 @@expect: {visualContexts: ``,displayList: `- damage: rows=4 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport RECORD@viewport/preamble RECORD (empty)@@ -72,7 +71,6 @@expect: {visualContexts: ``,displayList: `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPY@@ -96,7 +94,6 @@expect: {visualContexts: ``,displayList: `- damage: rows=4 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport ASSEMBLE@viewport/preamble COPYdiff --git a/Tests/LibWeb/Text/input/visual-context/value-only-update-keeps-tree.html b/Tests/LibWeb/Text/input/visual-context/value-only-update-keeps-tree.htmlindex e3c8ac5b151..78c9b6fe496 100644--- a/Tests/LibWeb/Text/input/visual-context/value-only-update-keeps-tree.html+++ b/Tests/LibWeb/Text/input/visual-context/value-only-update-keeps-tree.html@@ -8,7 +8,6 @@<div id="backdrop-box" style="width: 100px; height: 100px; backdrop-filter: invert(1)"></div><script>const quietRecording = `- damage: rows=0 moved=0 order=0 eligibility=0 all=false@canvas RECORD (empty)@viewport COPY`;