LibWeb: Don't create dummy formating context for internal table boxes

Internal table boxes are managed by TFC and do not need a dummy FC. We
still need to keep dummy FC for <math> though.
This commit is contained in:
Aliaksandr Kalenik 2024-09-13 22:41:01 +02:00 committed by Andreas Kling
parent 20f18d6ec2
commit d17f94e7cc
Notes: github-actions[bot] 2024-09-14 13:05:03 +00:00

View file

@ -142,14 +142,17 @@ Optional<FormattingContext::Type> FormattingContext::formatting_context_type_cre
if (box.children_are_inline())
return {};
if (display.is_table_column() || display.is_table_row_group() || display.is_table_header_group() || display.is_table_footer_group() || display.is_table_row() || display.is_table_column_group())
return {};
// The box is a block container that doesn't create its own BFC.
// It will be formatted by the containing BFC.
if (!display.is_flow_inside()) {
// HACK: Instead of crashing, create a dummy formatting context that does nothing.
// FIXME: Remove this once it's no longer needed. It currently swallows problem with standalone
// table-related boxes that don't get fixed up by CSS anonymous table box generation.
// FIXME: We need this for <math> elements
return Type::InternalDummy;
}
return {};
}