mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
2e0fbfcb95
commit
5148b444be
3 changed files with 5 additions and 11 deletions
|
@ -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,
|
||||
);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue