layout: Add incremental box tree construction for table caption (#37849)

This change extends incremental box tree updates to table captions. In
addition, calls to `LayoutBox::invalidate_cached_fragment()` are moved
to the damage calculation traversal.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2025-07-03 12:32:05 +02:00 committed by GitHub
parent 00472dec8e
commit 82f7f761d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 14 deletions

View file

@ -145,6 +145,10 @@ pub(crate) fn compute_damage_and_repair_style_inner(
element_data.borrow_mut().damage.insert(element_damage);
}
if element_damage.contains(LayoutDamage::recollect_box_tree_children()) {
node.invalidate_cached_fragment();
}
// Only propagate up layout phases from children, as other types of damage are
// incorporated into `element_damage` above.
element_damage | (damage_from_children & RestyleDamage::RELAYOUT)