mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:17:43 +00:00
LibWeb: Flex, grid and table containers should not create BFC
Fixes https://github.com/SerenityOS/serenity/issues/16082
This commit is contained in:
parent
1944e8936d
commit
7bc7790912
1 changed files with 19 additions and 9 deletions
|
@ -37,6 +37,21 @@ bool FormattingContext::creates_block_formatting_context(Box const& box)
|
||||||
if (box.is_replaced_box())
|
if (box.is_replaced_box())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// display: table
|
||||||
|
if (box.display().is_table_inside()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// display: flex
|
||||||
|
if (box.display().is_flex_inside()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// display: grid
|
||||||
|
if (box.display().is_grid_inside()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: This function uses MDN as a reference, not because it's authoritative,
|
// NOTE: This function uses MDN as a reference, not because it's authoritative,
|
||||||
// but because they've gathered all the conditions in one convenient location.
|
// but because they've gathered all the conditions in one convenient location.
|
||||||
|
|
||||||
|
@ -85,16 +100,11 @@ bool FormattingContext::creates_block_formatting_context(Box const& box)
|
||||||
auto parent_display = box.parent()->display();
|
auto parent_display = box.parent()->display();
|
||||||
|
|
||||||
// Flex items (direct children of the element with display: flex or inline-flex) if they are neither flex nor grid nor table containers themselves.
|
// Flex items (direct children of the element with display: flex or inline-flex) if they are neither flex nor grid nor table containers themselves.
|
||||||
if (parent_display.is_flex_inside()) {
|
if (parent_display.is_flex_inside())
|
||||||
if (!box.display().is_flex_inside())
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Grid items (direct children of the element with display: grid or inline-grid) if they are neither flex nor grid nor table containers themselves.
|
// Grid items (direct children of the element with display: grid or inline-grid) if they are neither flex nor grid nor table containers themselves.
|
||||||
if (parent_display.is_grid_inside()) {
|
if (parent_display.is_grid_inside())
|
||||||
if (!box.display().is_grid_inside()) {
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Multicol containers (elements where column-count or column-width isn't auto, including elements with column-count: 1).
|
// FIXME: Multicol containers (elements where column-count or column-width isn't auto, including elements with column-count: 1).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue