layout: align-content with default value normal should behave as strech in flex container (#35178)

Signed-off-by: rayguo17 <rayguo17@gmail.com>
This commit is contained in:
TIN TUN AUNG 2025-02-03 16:27:55 +08:00 committed by GitHub
parent 6a2e37183c
commit 2030b7affd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 8 additions and 137 deletions

View file

@ -784,12 +784,17 @@ impl FlexContainer {
// the resolution of https://github.com/w3c/csswg-drafts/issues/10154
let num_lines = initial_line_layouts.len();
let resolved_align_content: AlignFlags = {
// Computed value from the style system
let align_content_style = flex_context.config.align_content.0.primary();
// Inital values from the style system
let mut resolved_align_content = align_content_style.value();
let mut is_safe = align_content_style.flags() == AlignFlags::SAFE;
// From https://drafts.csswg.org/css-align/#distribution-flex
// > `normal` behaves as `stretch`.
let mut resolved_align_content = match align_content_style.value() {
AlignFlags::NORMAL => AlignFlags::STRETCH,
align_content => align_content,
};
// From https://drafts.csswg.org/css-flexbox/#algo-line-align:
// > Some alignments can only be fulfilled in certain situations or are
// > limited in how much space they can consume; for example, space-between