layout: Add incremental box tree construction for table cell (#37850)

This change extends incremental box tree updates to table cells. In
addition, for simplicity this refactors `BoxSlot::take_layout_box()`
into `BoxSlot::take_layout_box_if_undamaged()`.

Testing: This should not change observable behavior and is thus covered
by existing WPT tests.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Oriol Brufau 2025-07-03 14:06:31 +02:00 committed by GitHub
parent 06cc4bdae7
commit d33d057763
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 54 additions and 45 deletions

View file

@ -181,7 +181,10 @@ impl BoxSlot<'_> {
}
}
pub(crate) fn take_layout_box(&self) -> Option<LayoutBox> {
pub(crate) fn take_layout_box_if_undamaged(&self, damage: LayoutDamage) -> Option<LayoutBox> {
if damage.has_box_damage() {
return None;
}
self.slot.as_ref().and_then(|slot| slot.borrow_mut().take())
}
}