LibWeb: Mark width & height of grid item definite before inside layout
Some checks are pending
Lint Code / lint (push) Waiting to run
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

FFC expects parent formatting context to mark size as definite if that's
the case, because otherwise it cannot figure cross line size correctly.
Fixes incorrect alignment when FFC is nested in GFC.

Progress on https://web.telegram.org/a/ layout.
This commit is contained in:
Aliaksandr Kalenik 2025-08-07 07:32:51 +02:00 committed by Jelle Raaijmakers
commit 564003b22a
Notes: github-actions[bot] 2025-08-07 07:35:23 +00:00
4 changed files with 43 additions and 4 deletions

View file

@ -2073,6 +2073,8 @@ void GridFormattingContext::run(AvailableSpace const& available_space)
compute_inset(grid_item.box, grid_area_rect.size());
auto available_space_for_children = AvailableSpace(AvailableSize::make_definite(grid_item.used_values.content_width()), AvailableSize::make_definite(grid_item.used_values.content_height()));
grid_item.used_values.set_has_definite_width(true);
grid_item.used_values.set_has_definite_height(true);
if (auto independent_formatting_context = layout_inside(grid_item.box, LayoutMode::Normal, available_space_for_children))
independent_formatting_context->parent_context_did_dimension_child_root_box();
}