mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Take into account the intrinsic block size when computing the main size of a column flex container (#33135)
In particular, `main_content_sizes()` now works with columns. `layout_for_block_content_size()` is now used for both intrinsic sizes and intrinsic contributions, a IntrinsicSizingMode parameter is added to choose the behavior. Also, we consider the main size of a flex item as indefinite if its flex basis is indefinite and the flex container has an indefinite main size. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
cf98d8d7ec
commit
c00cd1326a
36 changed files with 290 additions and 213 deletions
|
@ -16,6 +16,22 @@ use style::Zero;
|
|||
|
||||
use crate::style_ext::{Clamp, ComputedValuesExt};
|
||||
|
||||
#[derive(PartialEq)]
|
||||
pub(crate) enum IntrinsicSizingMode {
|
||||
/// Used to refer to a min-content contribution or max-content contribution.
|
||||
/// This is the size that a box contributes to its containing block’s min-content
|
||||
/// or max-content size. Note this is based on the outer size of the box,
|
||||
/// and takes into account the relevant sizing properties of the element.
|
||||
/// <https://drafts.csswg.org/css-sizing-3/#contributions>
|
||||
Contribution,
|
||||
/// Used to refer to a min-content size or max-content size.
|
||||
/// This is the size based on the contents of an element, without regard for its context.
|
||||
/// Note this is usually based on the inner (content-box) size of the box,
|
||||
/// and ignores the relevant sizing properties of the element.
|
||||
/// <https://drafts.csswg.org/css-sizing-3/#intrinsic>
|
||||
Size,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Serialize)]
|
||||
pub(crate) struct ContentSizes {
|
||||
pub min_content: Au,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue