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 <ibluegalaxy_taoj@163.com>
This commit is contained in:
JoeDow 2025-07-23 11:36:32 +08:00 committed by GitHub
parent 4ff6b1d4a7
commit b8a1df2bc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -346,7 +346,7 @@ impl HTMLSlotElement {
/// <https://dom.spec.whatwg.org/#signal-a-slot-change>
pub(crate) fn signal_a_slot_change(&self) {
self.upcast::<Node>().dirty(NodeDamage::Other);
self.upcast::<Node>().dirty(NodeDamage::ContentOrHeritage);
if self.is_in_agents_signal_slots.get() {
return;