Enable min-content, max-content, fit-content and stretch (#33492)

For the sizing properties.

We don't actually support them yet, just treating them as
the initial value.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Oriol Brufau 2024-09-20 16:48:27 +02:00 committed by GitHub
parent 4bde9af515
commit 9597390d2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 120 additions and 2798 deletions

View file

@ -50,7 +50,7 @@ use style::selector_parser::RestyleDamage;
use style::servo::restyle_damage::ServoRestyleDamage;
use style::str::char_is_whitespace;
use style::values::computed::counters::ContentItem;
use style::values::computed::{Length, Size, VerticalAlign};
use style::values::computed::{Length, VerticalAlign};
use style::values::generics::box_::{Perspective, VerticalAlignKeyword};
use style::values::generics::transform;
use webrender_api::units::LayoutTransform;
@ -1642,11 +1642,7 @@ impl Fragment {
SpecificFragmentInfo::Canvas(_) |
SpecificFragmentInfo::Iframe(_) |
SpecificFragmentInfo::Svg(_) => {
let inline_size = match self.style.content_inline_size() {
Size::Auto => None,
Size::LengthPercentage(ref lp) => lp.maybe_to_used_value(None),
};
let inline_size = self.style.content_inline_size().maybe_to_used_value(None);
let mut inline_size = inline_size.unwrap_or_else(|| {
// We have to initialize the `border_padding` field first to make
// the size constraints work properly.