Truly independent web browser
LibWeb: Step from a paint child without checking it again
Aliaksandr Kalenik28d39359e09c
diff --git a/Libraries/LibWeb/Rust/src/painting/paint_order.rs b/Libraries/LibWeb/Rust/src/painting/paint_order.rsindex 4cb796006c0..d1f029ca06d 100644--- a/Libraries/LibWeb/Rust/src/painting/paint_order.rs+++ b/Libraries/LibWeb/Rust/src/painting/paint_order.rs@@ -122,8 +122,14 @@ pub(crate) fn next_paint_sibling(layout_arena: &impl PaintRead, slot: NodeSlotId{return None;}+ next_paint_sibling_of_paint_child(layout_arena, slot)+}- let mut node = slot;+pub(crate) fn next_paint_sibling_of_paint_child(+ layout_arena: &impl PaintRead,+ paint_child: NodeSlotId,+) -> Option<NodeSlotId> {+ let mut node = paint_child;loop {if let Some(sibling) =first_paintable_in_layout_siblings(layout_arena, layout_arena.node_next_sibling_if_live(node))diff --git a/Libraries/LibWeb/Rust/src/painting/paint_order_plan.rs b/Libraries/LibWeb/Rust/src/painting/paint_order_plan.rsindex 5ee4c4a2ce4..1afca47b1da 100644--- a/Libraries/LibWeb/Rust/src/painting/paint_order_plan.rs+++ b/Libraries/LibWeb/Rust/src/painting/paint_order_plan.rs@@ -710,7 +710,7 @@ impl<R: PaintRead, LeavesOut: PlanLeavesOut> PaintOrderBuilder<'_, R, LeavesOut>let begin = self.items.len();let mut next_child = crate::painting::paint_order::first_paint_child(self.layout_arena, paintable);while let Some(child) = next_child {- next_child = crate::painting::paint_order::next_paint_sibling(self.layout_arena, child);+ next_child = crate::painting::paint_order::next_paint_sibling_of_paint_child(self.layout_arena, child);if !matches(self, child) || self.descendant_phase_is_empty(child, phase) {continue;}