layout: Proper check for BoxFragment generated by a table wrapper box (#35136)

We were just checking the computed `display` style, but a few HTML
elements can ignore some `display` values and generate a different
kind of box.

This uses the right check, though for now there is no difference in
behavior since we don't have special HTML layouts.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-01-22 12:36:41 -08:00 committed by GitHub
parent 30365a8aba
commit 2ee25e344d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1930,9 +1930,7 @@ impl<'container> PlacementState<'container> {
// > When finding the first/last baseline set of an inline-block, any baselines
// > contributed by table boxes must be skipped. (This quirk is a legacy behavior from
// > [CSS2].)
let display = box_fragment.style.clone_display();
let is_table = display == Display::Table;
if self.is_inline_block_context && is_table {
if self.is_inline_block_context && box_fragment.is_table_wrapper() {
return;
}