impl From<&'_ DefiniteContainingBlock> for ContainingBlock

This commit is contained in:
Simon Sapin 2019-12-07 23:40:36 +01:00
parent 14ddf39215
commit f09c14aa6b
2 changed files with 19 additions and 15 deletions

View file

@ -44,6 +44,16 @@ struct DefiniteContainingBlock<'a> {
style: &'a ComputedValues,
}
impl<'a> From<&'_ DefiniteContainingBlock<'a>> for ContainingBlock<'a> {
fn from(definite: &DefiniteContainingBlock<'a>) -> Self {
ContainingBlock {
inline_size: definite.size.inline,
block_size: LengthOrAuto::LengthPercentage(definite.size.block),
style: definite.style,
}
}
}
/// https://drafts.csswg.org/css2/visuren.html#relative-positioning
fn relative_adjustement(
style: &ComputedValues,