diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/element.rs | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index dbcab42f11f..4321540676b 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -718,11 +718,9 @@ impl LayoutElementHelpers for LayoutDom<Element> { specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(size)); hints.push(from_declaration( shared_lock, - PropertyDeclaration::Width( - specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative( - specified::LengthPercentage::Length(value), - )), - ), + PropertyDeclaration::Width(specified::Size::LengthPercentage(NonNegative( + specified::LengthPercentage::Length(value), + ))), )); } @@ -747,22 +745,20 @@ impl LayoutElementHelpers for LayoutDom<Element> { match width { LengthOrPercentageOrAuto::Auto => {}, LengthOrPercentageOrAuto::Percentage(percentage) => { - let width_value = - specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative( - specified::LengthPercentage::Percentage(computed::Percentage(percentage)), - )); + let width_value = specified::Size::LengthPercentage(NonNegative( + specified::LengthPercentage::Percentage(computed::Percentage(percentage)), + )); hints.push(from_declaration( shared_lock, PropertyDeclaration::Width(width_value), )); }, LengthOrPercentageOrAuto::Length(length) => { - let width_value = - specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative( - specified::LengthPercentage::Length(specified::NoCalcLength::Absolute( - specified::AbsoluteLength::Px(length.to_f32_px()), - )), - )); + let width_value = specified::Size::LengthPercentage(NonNegative( + specified::LengthPercentage::Length(specified::NoCalcLength::Absolute( + specified::AbsoluteLength::Px(length.to_f32_px()), + )), + )); hints.push(from_declaration( shared_lock, PropertyDeclaration::Width(width_value), @@ -783,22 +779,20 @@ impl LayoutElementHelpers for LayoutDom<Element> { match height { LengthOrPercentageOrAuto::Auto => {}, LengthOrPercentageOrAuto::Percentage(percentage) => { - let height_value = - specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative( - specified::LengthPercentage::Percentage(computed::Percentage(percentage)), - )); + let height_value = specified::Size::LengthPercentage(NonNegative( + specified::LengthPercentage::Percentage(computed::Percentage(percentage)), + )); hints.push(from_declaration( shared_lock, PropertyDeclaration::Height(height_value), )); }, LengthOrPercentageOrAuto::Length(length) => { - let height_value = - specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative( - specified::LengthPercentage::Length(specified::NoCalcLength::Absolute( - specified::AbsoluteLength::Px(length.to_f32_px()), - )), - )); + let height_value = specified::Size::LengthPercentage(NonNegative( + specified::LengthPercentage::Length(specified::NoCalcLength::Absolute( + specified::AbsoluteLength::Px(length.to_f32_px()), + )), + )); hints.push(from_declaration( shared_lock, PropertyDeclaration::Height(height_value), @@ -825,11 +819,9 @@ impl LayoutElementHelpers for LayoutDom<Element> { specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(cols)); hints.push(from_declaration( shared_lock, - PropertyDeclaration::Width( - specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative( - specified::LengthPercentage::Length(value), - )), - ), + PropertyDeclaration::Width(specified::Size::LengthPercentage(NonNegative( + specified::LengthPercentage::Length(value), + ))), )); } @@ -851,11 +843,9 @@ impl LayoutElementHelpers for LayoutDom<Element> { )); hints.push(from_declaration( shared_lock, - PropertyDeclaration::Height( - specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative( - specified::LengthPercentage::Length(value), - )), - ), + PropertyDeclaration::Height(specified::Size::LengthPercentage(NonNegative( + specified::LengthPercentage::Length(value), + ))), )); } |