mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Change the IndefiniteContainingBlock
sizes to Option<Au>
(#35653)
Thus avoiding the need to convert to/from `AuOrAuto`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
31b2f81bc6
commit
ebb19bcd60
6 changed files with 19 additions and 37 deletions
|
@ -898,19 +898,11 @@ impl SizeConstraint {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn to_auto_or(self) -> AutoOr<Au> {
|
||||
self.to_definite()
|
||||
.map_or(AutoOr::Auto, AutoOr::LengthPercentage)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AuOrAuto> for SizeConstraint {
|
||||
fn from(size: AuOrAuto) -> Self {
|
||||
size.non_auto()
|
||||
.map(SizeConstraint::Definite)
|
||||
.unwrap_or_default()
|
||||
impl From<Option<Au>> for SizeConstraint {
|
||||
fn from(size: Option<Au>) -> Self {
|
||||
size.map(SizeConstraint::Definite).unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue