aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/model.rs
diff options
context:
space:
mode:
authorDavid Zbarsky <dzbarsky@gmail.com>2015-08-20 12:31:19 -0400
committerDavid Zbarsky <dzbarsky@gmail.com>2015-11-01 23:16:14 -0800
commit00980ea595dd54643eee59c1a0e2ddef39286e7f (patch)
tree75e43edd9ead2fc0e9c484ae57c9bef8bccf2fca /components/layout/model.rs
parent35b452660bf0759d222e8f2ac4b8c57f75529443 (diff)
downloadservo-00980ea595dd54643eee59c1a0e2ddef39286e7f.tar.gz
servo-00980ea595dd54643eee59c1a0e2ddef39286e7f.zip
Implement calc expressions for more value types
Diffstat (limited to 'components/layout/model.rs')
-rw-r--r--components/layout/model.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/layout/model.rs b/components/layout/model.rs
index 8ee98a39678..f49ac51ad21 100644
--- a/components/layout/model.rs
+++ b/components/layout/model.rs
@@ -411,6 +411,8 @@ pub fn specified_or_none(length: LengthOrPercentageOrNone, containing_length: Au
match length {
LengthOrPercentageOrNone::None => None,
LengthOrPercentageOrNone::Percentage(percent) => Some(containing_length.scale_by(percent)),
+ LengthOrPercentageOrNone::Calc(calc) =>
+ Some(containing_length.scale_by(calc.percentage()) + calc.length()),
LengthOrPercentageOrNone::Length(length) => Some(length),
}
}