aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/layout_2020/flow/mod.rs2
-rw-r--r--components/layout_2020/geom.rs12
-rw-r--r--components/layout_2020/table/layout.rs2
3 files changed, 5 insertions, 11 deletions
diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs
index 445972e64ab..80dcba20b66 100644
--- a/components/layout_2020/flow/mod.rs
+++ b/components/layout_2020/flow/mod.rs
@@ -2002,7 +2002,7 @@ impl IndependentFormattingContext {
// https://drafts.csswg.org/css2/visudet.html#float-width
// https://drafts.csswg.org/css2/visudet.html#inlineblock-width
let tentative_inline_size = box_size.inline.resolve(
- Size::fit_content,
+ Size::FitContent,
available_inline_size,
&mut get_content_size,
);
diff --git a/components/layout_2020/geom.rs b/components/layout_2020/geom.rs
index 74171278e57..baa2c541415 100644
--- a/components/layout_2020/geom.rs
+++ b/components/layout_2020/geom.rs
@@ -653,13 +653,8 @@ impl<T> Default for Size<T> {
impl<T> Size<T> {
#[inline]
- pub(crate) fn fit_content() -> Self {
- Self::FitContent
- }
-
- #[inline]
- pub(crate) fn is_keyword(&self) -> bool {
- !matches!(self, Self::Numeric(_))
+ pub(crate) fn is_numeric(&self) -> bool {
+ matches!(self, Self::Numeric(_))
}
#[inline]
@@ -778,12 +773,11 @@ impl Size<Au> {
#[inline]
pub(crate) fn resolve(
&self,
- get_initial_behavior: impl Fn() -> Self,
+ initial_behavior: Self,
stretch_size: Au,
get_content_size: &mut impl FnMut() -> ContentSizes,
) -> Au {
if self.is_initial() {
- let initial_behavior = get_initial_behavior();
assert!(!initial_behavior.is_initial());
initial_behavior.resolve_non_initial(stretch_size, get_content_size)
} else {
diff --git a/components/layout_2020/table/layout.rs b/components/layout_2020/table/layout.rs
index 455e0e3d25d..c0c0a92c051 100644
--- a/components/layout_2020/table/layout.rs
+++ b/components/layout_2020/table/layout.rs
@@ -2877,7 +2877,7 @@ fn get_outer_sizes_for_measurement(
outer_size(size.map(|v| get_size_for_axis(v).unwrap_or_else(Au::zero))),
outer_size(min_size.map(|v| get_size_for_axis(v).unwrap_or_else(Au::zero))),
outer_size(max_size.map(|v| get_size_for_axis(v).unwrap_or(MAX_AU))),
- size.inline.is_keyword(),
+ !size.inline.is_numeric(),
get_size_percentage_contribution(&size, &max_size),
)
}