mirror of
https://github.com/servo/servo.git
synced 2025-08-20 12:55:33 +01:00
Refactor and modify stuff to make use of NoCalcLength
This commit is contained in:
parent
4035bbd738
commit
377a23df50
14 changed files with 83 additions and 67 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue