1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

LibWeb: Make grid containers be Layout::Box

Grid containers were incorrectly represented as BlockContainer before.
Furthermore, GridFormattingContext had a bogus inheritance relationship
with BlockFormattingContext.

This patch brings our architecture closer to spec by making grid
containers be plain boxes and making GFC not inherit from BFC.
This commit is contained in:
Andreas Kling 2023-01-23 15:19:32 +01:00
parent 44cf418975
commit 8fe748bb89
6 changed files with 10 additions and 10 deletions

View file

@ -66,7 +66,8 @@ static Box const* nearest_ancestor_capable_of_forming_a_containing_block(Node co
{
for (auto const* ancestor = node.parent(); ancestor; ancestor = ancestor->parent()) {
if (ancestor->is_block_container()
|| ancestor->display().is_flex_inside()) {
|| ancestor->display().is_flex_inside()
|| ancestor->display().is_grid_inside()) {
return verify_cast<Box>(ancestor);
}
}