layout: Make non-normal align-content establish a block formatting context (#34984)

* Make non-normal align-content establish a block formatting context

Signed-off-by: rayguo17 <rayguo17@gmail.com>

* Adjust code comment

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: rayguo17 <rayguo17@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
TIN TUN AUNG 2025-01-16 00:46:37 +08:00 committed by GitHub
parent e81951a973
commit cbea70d1a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 24 additions and 271 deletions

View file

@ -721,6 +721,15 @@ impl ComputedValuesExt for ComputedValues {
return true;
}
// Per <https://drafts.csswg.org/css-align/#distribution-block>:
// Block containers with an `align-content` value that is not `normal` should
// form an independent block formatting context. This should really only happen
// for block containers, but we do not support subgrid containers yet which is the
// only other case.
if self.get_position().align_content.0.primary() != AlignFlags::NORMAL {
return true;
}
// TODO: We need to handle CSS Contain here.
false
}