From b8a1df2bc251494223c14fc5b0925c4dc90f8eac Mon Sep 17 00:00:00 2001 From: JoeDow Date: Wed, 23 Jul 2025 11:36:32 +0800 Subject: [PATCH] script: Use `NodeDamage::ContentOrHeritage` for slot changes (#38198) This change aims to reduce the scope of incremental box tree construction. Previously, when children of slot node changed, the slot would always be marked as requiring box tree reconstruction; now, it is adjusted to only mark the slot node as needing to recollect its box tree children. Testing: This should not change observable behavior and is thus covered by existing WPT tests. Signed-off-by: sharpshooter_pt --- components/script/dom/htmlslotelement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/dom/htmlslotelement.rs b/components/script/dom/htmlslotelement.rs index d995a78f139..0f77549a202 100644 --- a/components/script/dom/htmlslotelement.rs +++ b/components/script/dom/htmlslotelement.rs @@ -346,7 +346,7 @@ impl HTMLSlotElement { /// pub(crate) fn signal_a_slot_change(&self) { - self.upcast::().dirty(NodeDamage::Other); + self.upcast::().dirty(NodeDamage::ContentOrHeritage); if self.is_in_agents_signal_slots.get() { return;