mirror of
https://github.com/servo/servo.git
synced 2025-08-23 14:25:33 +01:00
layout: Implement the fit-content()
sizing function (#36056)
Spec: https://drafts.csswg.org/css-sizing-3/#funcdef-width-fit-content It's similar to the `fit-content` keyword but, instead of clamping the stretch size between `min-content` and `max-content`, it clamps the provided argument. So now that we support `fit-content`, it's quite straightforward to add. It's just not completely clear what should happen when the argument has a cyclic percentage, so this may need some further adjustments depending on the outcome of https://github.com/w3c/csswg-drafts/issues/11805 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
3a356ffb74
commit
8c2ac88ad0
33 changed files with 100 additions and 192 deletions
|
@ -54,6 +54,7 @@ pub fn dimension(val: &stylo::Size) -> taffy::Dimension {
|
|||
stylo::Size::MaxContent => taffy::Dimension::Auto,
|
||||
stylo::Size::MinContent => taffy::Dimension::Auto,
|
||||
stylo::Size::FitContent => taffy::Dimension::Auto,
|
||||
stylo::Size::FitContentFunction(_) => taffy::Dimension::Auto,
|
||||
stylo::Size::Stretch => taffy::Dimension::Auto,
|
||||
|
||||
// Anchor positioning will be flagged off for time being
|
||||
|
@ -71,6 +72,7 @@ pub fn max_size_dimension(val: &stylo::MaxSize) -> taffy::Dimension {
|
|||
stylo::MaxSize::MaxContent => taffy::Dimension::Auto,
|
||||
stylo::MaxSize::MinContent => taffy::Dimension::Auto,
|
||||
stylo::MaxSize::FitContent => taffy::Dimension::Auto,
|
||||
stylo::MaxSize::FitContentFunction(_) => taffy::Dimension::Auto,
|
||||
stylo::MaxSize::Stretch => taffy::Dimension::Auto,
|
||||
|
||||
// Anchor positioning will be flagged off for time being
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue