Auto merge of #16713 - emilio:calc-in-calc, r=manishearth

style: Allow parsing nested calc() expressions.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16713)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-03 18:33:03 -05:00 committed by GitHub
commit 53b391daf8
3 changed files with 5 additions and 3 deletions

View file

@ -843,6 +843,10 @@ impl CalcLengthOrPercentage {
input.parse_nested_block(|i| CalcLengthOrPercentage::parse_sum(context, i, expected_unit))
.map(|result| CalcValueNode::Sum(Box::new(result)))
},
(Token::Function(ref name), _) if name.eq_ignore_ascii_case("calc") => {
input.parse_nested_block(|i| CalcLengthOrPercentage::parse_sum(context, i, expected_unit))
.map(|result| CalcValueNode::Sum(Box::new(result)))
}
_ => Err(())
}
}