aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs44
1 files changed, 31 insertions, 13 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 233d4a01bb3..6feb6381b77 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -718,7 +718,9 @@ impl LayoutElementHelpers for LayoutDom<Element> {
specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(size));
hints.push(from_declaration(
shared_lock,
- PropertyDeclaration::Width(specified::LengthOrPercentageOrAuto::Length(value)),
+ PropertyDeclaration::Width(specified::LengthOrPercentageOrAuto::LengthOrPercentage(
+ specified::LengthOrPercentage::Length(value)
+ )),
));
}
@@ -743,8 +745,10 @@ impl LayoutElementHelpers for LayoutDom<Element> {
match width {
LengthOrPercentageOrAuto::Auto => {},
LengthOrPercentageOrAuto::Percentage(percentage) => {
- let width_value = specified::LengthOrPercentageOrAuto::Percentage(
- computed::Percentage(percentage),
+ let width_value = specified::LengthOrPercentageOrAuto::LengthOrPercentage(
+ specified::LengthOrPercentage::Percentage(
+ computed::Percentage(percentage),
+ ),
);
hints.push(from_declaration(
shared_lock,
@@ -753,9 +757,13 @@ impl LayoutElementHelpers for LayoutDom<Element> {
},
LengthOrPercentageOrAuto::Length(length) => {
let width_value =
- specified::LengthOrPercentageOrAuto::Length(specified::NoCalcLength::Absolute(
- specified::AbsoluteLength::Px(length.to_f32_px()),
- ));
+ specified::LengthOrPercentageOrAuto::LengthOrPercentage(
+ specified::LengthOrPercentage::Length(
+ specified::NoCalcLength::Absolute(
+ specified::AbsoluteLength::Px(length.to_f32_px()),
+ ),
+ ),
+ );
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Width(width_value),
@@ -776,8 +784,10 @@ impl LayoutElementHelpers for LayoutDom<Element> {
match height {
LengthOrPercentageOrAuto::Auto => {},
LengthOrPercentageOrAuto::Percentage(percentage) => {
- let height_value = specified::LengthOrPercentageOrAuto::Percentage(
- computed::Percentage(percentage),
+ let height_value = specified::LengthOrPercentageOrAuto::LengthOrPercentage(
+ specified::LengthOrPercentage::Percentage(
+ computed::Percentage(percentage),
+ )
);
hints.push(from_declaration(
shared_lock,
@@ -786,9 +796,13 @@ impl LayoutElementHelpers for LayoutDom<Element> {
},
LengthOrPercentageOrAuto::Length(length) => {
let height_value =
- specified::LengthOrPercentageOrAuto::Length(specified::NoCalcLength::Absolute(
- specified::AbsoluteLength::Px(length.to_f32_px()),
- ));
+ specified::LengthOrPercentageOrAuto::LengthOrPercentage(
+ specified::LengthOrPercentage::Length(
+ specified::NoCalcLength::Absolute(
+ specified::AbsoluteLength::Px(length.to_f32_px()),
+ )
+ )
+ );
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Height(height_value),
@@ -815,7 +829,9 @@ impl LayoutElementHelpers for LayoutDom<Element> {
specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(cols));
hints.push(from_declaration(
shared_lock,
- PropertyDeclaration::Width(specified::LengthOrPercentageOrAuto::Length(value)),
+ PropertyDeclaration::Width(specified::LengthOrPercentageOrAuto::LengthOrPercentage(
+ specified::LengthOrPercentage::Length(value)
+ )),
));
}
@@ -837,7 +853,9 @@ impl LayoutElementHelpers for LayoutDom<Element> {
));
hints.push(from_declaration(
shared_lock,
- PropertyDeclaration::Height(specified::LengthOrPercentageOrAuto::Length(value)),
+ PropertyDeclaration::Height(specified::LengthOrPercentageOrAuto::LengthOrPercentage(
+ specified::LengthOrPercentage::Length(value)
+ )),
));
}