Bug 1374233 - Part 7: Add NonNegativeLengthOrPercentage.

For padding-{*} and grid-{*}-gap.

MozReview-Commit-ID: 81G0b1k6JnD
This commit is contained in:
Boris Chiou 2017-07-21 10:52:34 +08:00
parent 9d69cb2866
commit e72a0f126e
14 changed files with 123 additions and 20 deletions

View file

@ -268,10 +268,12 @@ mod shorthand_serialization {
#[test]
fn padding_should_serialize_correctly() {
use style::values::specified::NonNegativeLengthOrPercentage;
let mut properties = Vec::new();
let px_10 = LengthOrPercentage::Length(NoCalcLength::from_px(10f32));
let px_15 = LengthOrPercentage::Length(NoCalcLength::from_px(15f32));
let px_10: NonNegativeLengthOrPercentage = NoCalcLength::from_px(10f32).into();
let px_15: NonNegativeLengthOrPercentage = NoCalcLength::from_px(15f32).into();
properties.push(PropertyDeclaration::PaddingTop(px_10.clone()));
properties.push(PropertyDeclaration::PaddingRight(px_15.clone()));
properties.push(PropertyDeclaration::PaddingBottom(px_10));