aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-02-10 06:48:00 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-02-10 07:23:51 +0100
commit6daebcc5dfc4e57d2f9e9450aa01b8c67dd34986 (patch)
tree2e73145e44bcffe555093109983ce74ce432978a /components/script/dom/element.rs
parent1cb235c81a412548bb650a5f0b0b01aff803fba9 (diff)
downloadservo-6daebcc5dfc4e57d2f9e9450aa01b8c67dd34986.tar.gz
servo-6daebcc5dfc4e57d2f9e9450aa01b8c67dd34986.zip
Fix servo build.
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs60
1 files changed, 35 insertions, 25 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 234a10f9448..dbcab42f11f 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -718,9 +718,11 @@ impl LayoutElementHelpers for LayoutDom<Element> {
specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(size));
hints.push(from_declaration(
shared_lock,
- PropertyDeclaration::Width(specified::LengthPercentageOrAuto::LengthPercentage(
- specified::LengthPercentage::Length(value),
- )),
+ PropertyDeclaration::Width(
+ specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
+ specified::LengthPercentage::Length(value),
+ )),
+ ),
));
}
@@ -745,20 +747,22 @@ impl LayoutElementHelpers for LayoutDom<Element> {
match width {
LengthOrPercentageOrAuto::Auto => {},
LengthOrPercentageOrAuto::Percentage(percentage) => {
- let width_value = specified::LengthPercentageOrAuto::LengthPercentage(
- specified::LengthPercentage::Percentage(computed::Percentage(percentage)),
- );
+ let width_value =
+ specified::NonNegativeLengthPercentageOrAuto::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::LengthPercentageOrAuto::LengthPercentage(
- specified::LengthPercentage::Length(specified::NoCalcLength::Absolute(
- specified::AbsoluteLength::Px(length.to_f32_px()),
- )),
- );
+ let width_value =
+ specified::NonNegativeLengthPercentageOrAuto::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),
@@ -779,20 +783,22 @@ impl LayoutElementHelpers for LayoutDom<Element> {
match height {
LengthOrPercentageOrAuto::Auto => {},
LengthOrPercentageOrAuto::Percentage(percentage) => {
- let height_value = specified::LengthPercentageOrAuto::LengthPercentage(
- specified::LengthPercentage::Percentage(computed::Percentage(percentage)),
- );
+ let height_value =
+ specified::NonNegativeLengthPercentageOrAuto::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::LengthPercentageOrAuto::LengthPercentage(
- specified::LengthPercentage::Length(specified::NoCalcLength::Absolute(
- specified::AbsoluteLength::Px(length.to_f32_px()),
- )),
- );
+ let height_value =
+ specified::NonNegativeLengthPercentageOrAuto::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),
@@ -819,9 +825,11 @@ impl LayoutElementHelpers for LayoutDom<Element> {
specified::NoCalcLength::ServoCharacterWidth(specified::CharacterWidth(cols));
hints.push(from_declaration(
shared_lock,
- PropertyDeclaration::Width(specified::LengthPercentageOrAuto::LengthPercentage(
- specified::LengthPercentage::Length(value),
- )),
+ PropertyDeclaration::Width(
+ specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
+ specified::LengthPercentage::Length(value),
+ )),
+ ),
));
}
@@ -843,9 +851,11 @@ impl LayoutElementHelpers for LayoutDom<Element> {
));
hints.push(from_declaration(
shared_lock,
- PropertyDeclaration::Height(specified::LengthPercentageOrAuto::LengthPercentage(
- specified::LengthPercentage::Length(value),
- )),
+ PropertyDeclaration::Height(
+ specified::NonNegativeLengthPercentageOrAuto::LengthPercentage(NonNegative(
+ specified::LengthPercentage::Length(value),
+ )),
+ ),
));
}