From 2ee25e344d675628f60b2105a8ded279667a9b96 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Wed, 22 Jan 2025 12:36:41 -0800 Subject: [PATCH] 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 --- components/layout_2020/flow/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 1f7aeccaaaa..09519fef395 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -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; }