aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/layout_2020/flow/construct.rs6
-rw-r--r--components/layout_2020/flow/float.rs2
-rw-r--r--components/layout_2020/positioned.rs2
-rw-r--r--components/layout_2020/style_ext.rs6
4 files changed, 8 insertions, 8 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs
index c02dcd08fd7..896293831bc 100644
--- a/components/layout_2020/flow/construct.rs
+++ b/components/layout_2020/flow/construct.rs
@@ -393,7 +393,7 @@ where
style.clone(),
display_inside,
contents,
- ContentSizesRequest::inline_if(style.inline_size_is_auto()),
+ ContentSizesRequest::inline_if(!style.inline_size_is_length()),
),
))
};
@@ -590,7 +590,7 @@ where
&style,
ContentSizesRequest::inline_if(
max_assign_in_flow_outer_content_sizes_to.is_some() &&
- style.inline_size_is_auto(),
+ !style.inline_size_is_length(),
),
);
if let Some(to) = max_assign_in_flow_outer_content_sizes_to {
@@ -607,7 +607,7 @@ where
} => {
let content_sizes = ContentSizesRequest::inline_if(
max_assign_in_flow_outer_content_sizes_to.is_some() &&
- style.inline_size_is_auto(),
+ !style.inline_size_is_length(),
);
let contents = IndependentFormattingContext::construct(
context,
diff --git a/components/layout_2020/flow/float.rs b/components/layout_2020/flow/float.rs
index 2acc2095004..df9cbbaf514 100644
--- a/components/layout_2020/flow/float.rs
+++ b/components/layout_2020/flow/float.rs
@@ -33,7 +33,7 @@ impl FloatBox {
display_inside: DisplayInside,
contents: Contents<impl NodeExt<'dom>>,
) -> Self {
- let content_sizes = ContentSizesRequest::inline_if(style.inline_size_is_auto());
+ let content_sizes = ContentSizesRequest::inline_if(!style.inline_size_is_length());
Self {
contents: IndependentFormattingContext::construct(
context,
diff --git a/components/layout_2020/positioned.rs b/components/layout_2020/positioned.rs
index 8b5f078f520..9459f3c3f84 100644
--- a/components/layout_2020/positioned.rs
+++ b/components/layout_2020/positioned.rs
@@ -60,7 +60,7 @@ impl AbsolutelyPositionedBox {
// "Shrink-to-fit" in https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width
let content_sizes = ContentSizesRequest::inline_if(
// If inline-size is non-auto, that value is used without shrink-to-fit
- style.inline_size_is_auto() &&
+ !style.inline_size_is_length() &&
// If it is, then the only case where shrink-to-fit is *not* used is
// if both offsets are non-auto, leaving inline-size as the only variable
// in the constraint equation.
diff --git a/components/layout_2020/style_ext.rs b/components/layout_2020/style_ext.rs
index 59c87fd633c..67d8bc78d7e 100644
--- a/components/layout_2020/style_ext.rs
+++ b/components/layout_2020/style_ext.rs
@@ -40,7 +40,7 @@ pub(crate) enum DisplayInside {
}
pub(crate) trait ComputedValuesExt {
- fn inline_size_is_auto(&self) -> bool;
+ fn inline_size_is_length(&self) -> bool;
fn inline_box_offsets_are_both_non_auto(&self) -> bool;
fn box_offsets(&self) -> flow_relative::Sides<LengthPercentageOrAuto>;
fn box_size(&self) -> flow_relative::Vec2<LengthPercentageOrAuto>;
@@ -52,14 +52,14 @@ pub(crate) trait ComputedValuesExt {
}
impl ComputedValuesExt for ComputedValues {
- fn inline_size_is_auto(&self) -> bool {
+ fn inline_size_is_length(&self) -> bool {
let position = self.get_position();
let size = if self.writing_mode.is_horizontal() {
position.width
} else {
position.height
};
- size == Size::Auto
+ matches!(size, Size::LengthPercentage(lp) if lp.0.as_length().is_some())
}
fn inline_box_offsets_are_both_non_auto(&self) -> bool {