aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_2020/lib.rs')
-rw-r--r--components/layout_2020/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/layout_2020/lib.rs b/components/layout_2020/lib.rs
index f0c56afa6f1..8e923f870d7 100644
--- a/components/layout_2020/lib.rs
+++ b/components/layout_2020/lib.rs
@@ -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,