Refactor and modify stuff to make use of NoCalcLength

This commit is contained in:
Ravi Shankar 2017-01-16 01:34:54 +05:30
parent 4035bbd738
commit 377a23df50
14 changed files with 83 additions and 67 deletions

View file

@ -6,21 +6,21 @@ use app_units::Au;
use style::properties::{DeclaredValue, PropertyDeclaration};
use style::properties::longhands::border_top_width;
use style::values::HasViewportPercentage;
use style::values::specified::{Length, ViewportPercentageLength};
use style::values::specified::{Length, NoCalcLength, ViewportPercentageLength};
#[test]
fn has_viewport_percentage_for_specified_value() {
//TODO: test all specified value with a HasViewportPercentage impl
let pvw = PropertyDeclaration::BorderTopWidth(
DeclaredValue::Value(border_top_width::SpecifiedValue::from_length(
Length::ViewportPercentage(ViewportPercentageLength::Vw(100.))
Length::NoCalc(NoCalcLength::ViewportPercentage(ViewportPercentageLength::Vw(100.)))
))
);
assert!(pvw.has_viewport_percentage());
let pabs = PropertyDeclaration::BorderTopWidth(
DeclaredValue::Value(border_top_width::SpecifiedValue::from_length(
Length::Absolute(Au(100))
Length::NoCalc(NoCalcLength::Absolute(Au(100)))
))
);
assert!(!pabs.has_viewport_percentage());