servo: Merge #16473 - Upgrade to rustc 1.18.0-nightly (5f13a3b54 2017-04-15) (from servo:rustup); r=emilio
authorSimon Sapin <simon.sapin@exyr.org>
Sun, 16 Apr 2017 00:13:28 -0500
changeset 353368 55519369af2b2a65f2a5c2275522a8b1dc014953
parent 353367 1f030c7f4fc574643c9b200ef06014f608da1b16
child 353369 d3551474de3d6fdb8b58e770c658efe39d24f15f
push id31663
push userarchaeopteryx@coole-files.de
push dateSun, 16 Apr 2017 17:59:55 +0000
treeherdermozilla-central@d3551474de3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #16473 - Upgrade to rustc 1.18.0-nightly (5f13a3b54 2017-04-15) (from servo:rustup); r=emilio This version enables [struct field reordering][1] which brings the size of the types for specified values of some CSS properties under the threshold such that they shouldn’t be boxed anymore, making unit tests fail. Simply unboxing them moves the test failure to Stylo’s unit tests, since the stable compiler used in that case does not do field re-ordering. Therefore, we manually reorder a couple fields to effectively bring this optimization to older compilers for a few specific types. [1]: https://github.com/rust-lang/rust/pull/40377 Source-Repo: https://github.com/servo/servo Source-Revision: c453e2ef89b32798dabbb23b22cfd5a72dddf6a5
servo/components/script/dom/element.rs
servo/components/style/properties/longhand/border.mako.rs
servo/components/style/properties/longhand/box.mako.rs
servo/components/style/properties/longhand/column.mako.rs
servo/components/style/properties/longhand/inherited_text.mako.rs
servo/components/style/values/computed/length.rs
servo/components/style/values/specified/length.rs
servo/ports/geckolib/glue.rs
servo/rust-commit-hash
servo/tests/unit/style/properties/serialization.rs
servo/tests/unit/style/properties/viewport.rs
--- a/servo/components/script/dom/element.rs
+++ b/servo/components/script/dom/element.rs
@@ -644,26 +644,26 @@ impl LayoutElementHelpers for LayoutJS<E
         } else {
             None
         };
 
         if let Some(border) = border {
             let width_value = specified::BorderWidth::from_length(specified::Length::from_px(border as f32));
             hints.push(from_declaration(
                 shared_lock,
-                PropertyDeclaration::BorderTopWidth(Box::new(width_value.clone()))));
+                PropertyDeclaration::BorderTopWidth(width_value.clone())));
             hints.push(from_declaration(
                 shared_lock,
-                PropertyDeclaration::BorderLeftWidth(Box::new(width_value.clone()))));
+                PropertyDeclaration::BorderLeftWidth(width_value.clone())));
             hints.push(from_declaration(
                 shared_lock,
-                PropertyDeclaration::BorderBottomWidth(Box::new(width_value.clone()))));
+                PropertyDeclaration::BorderBottomWidth(width_value.clone())));
             hints.push(from_declaration(
                 shared_lock,
-                PropertyDeclaration::BorderRightWidth(Box::new(width_value))));
+                PropertyDeclaration::BorderRightWidth(width_value)));
         }
     }
 
     #[allow(unsafe_code)]
     unsafe fn get_colspan(self) -> u32 {
         if let Some(this) = self.downcast::<HTMLTableCellElement>() {
             this.get_colspan().unwrap_or(1)
         } else {
--- a/servo/components/style/properties/longhand/border.mako.rs
+++ b/servo/components/style/properties/longhand/border.mako.rs
@@ -31,17 +31,17 @@
                               spec=maybe_logical_spec(side, "style"),
                               animation_type="none", logical = side[1])}
 % endfor
 
 ${helpers.gecko_keyword_conversion(Keyword('border-style',
                                    "none solid double dotted dashed hidden groove ridge inset outset"),
                                    type="::values::specified::BorderStyle")}
 % for side in ALL_SIDES:
-    <%helpers:longhand name="border-${side[0]}-width" boxed="True" animation_type="normal" logical="${side[1]}"
+    <%helpers:longhand name="border-${side[0]}-width" animation_type="normal" logical="${side[1]}"
                        alias="${maybe_moz_logical_alias(product, side, '-moz-border-%s-width')}"
                        spec="${maybe_logical_spec(side, 'width')}">
         use app_units::Au;
         use std::fmt;
         use style_traits::ToCss;
         use values::HasViewportPercentage;
         use values::specified::BorderWidth;
 
--- a/servo/components/style/properties/longhand/box.mako.rs
+++ b/servo/components/style/properties/longhand/box.mako.rs
@@ -1859,17 +1859,16 @@
 
 ${helpers.predefined_type("perspective",
                           "LengthOrNone",
                           "Either::Second(None_)",
                           "parse_non_negative_length",
                           gecko_ffi_name="mChildPerspective",
                           spec="https://drafts.csswg.org/css-transforms/#perspective",
                           extra_prefixes="moz webkit",
-                          boxed=True,
                           creates_stacking_context=True,
                           fixpos_cb=True,
                           animation_type="normal")}
 
 // FIXME: This prop should be animatable
 <%helpers:longhand name="perspective-origin" boxed="True" animation_type="none" extra_prefixes="moz webkit"
                    spec="https://drafts.csswg.org/css-transforms/#perspective-origin-property">
     use std::fmt;
--- a/servo/components/style/properties/longhand/column.mako.rs
+++ b/servo/components/style/properties/longhand/column.mako.rs
@@ -8,17 +8,16 @@
 
 // FIXME: This prop should be animatable.
 ${helpers.predefined_type("column-width",
                           "length::LengthOrAuto",
                           "Either::Second(Auto)",
                           initial_specified_value="Either::Second(Auto)",
                           parse_method="parse_non_negative_length",
                           extra_prefixes="moz",
-                          boxed=True,
                           animation_type="none",
                           experimental=True,
                           spec="https://drafts.csswg.org/css-multicol/#propdef-column-width")}
 
 
 // FIXME: This prop should be animatable.
 ${helpers.predefined_type("column-count", "IntegerOrAuto",
                           "Either::Second(Auto)",
@@ -31,26 +30,25 @@
 
 // FIXME: This prop should be animatable.
 ${helpers.predefined_type("column-gap",
                           "length::LengthOrNormal",
                           "Either::Second(Normal)",
                           parse_method='parse_non_negative_length',
                           extra_prefixes="moz",
                           experimental=True,
-                          boxed=True,
                           animation_type="none",
                           spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap")}
 
 ${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz",
                          products="gecko", animation_type="none",
                          spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill")}
 
 // https://drafts.csswg.org/css-multicol-1/#propdef-column-rule-width
-<%helpers:longhand name="column-rule-width" products="gecko" boxed="True" animation_type="normal" extra_prefixes="moz"
+<%helpers:longhand name="column-rule-width" products="gecko" animation_type="normal" extra_prefixes="moz"
                    spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width">
     use app_units::Au;
     use std::fmt;
     use style_traits::ToCss;
     use values::HasViewportPercentage;
     use values::specified::BorderWidth;
 
     pub mod computed_value {
--- a/servo/components/style/properties/longhand/inherited_text.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_text.mako.rs
@@ -401,17 +401,17 @@
         impl ComputedValueAsSpecified for SpecifiedValue {}
         pub use self::computed_value::T as SpecifiedValue;
         pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
             computed_value::T::parse(input)
         }
     % endif
 </%helpers:longhand>
 
-<%helpers:longhand name="letter-spacing" boxed="True" animation_type="normal"
+<%helpers:longhand name="letter-spacing" animation_type="normal"
                    spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing">
     use std::fmt;
     use style_traits::ToCss;
     use values::HasViewportPercentage;
 
     impl HasViewportPercentage for SpecifiedValue {
         fn has_viewport_percentage(&self) -> bool {
             match *self {
@@ -1206,17 +1206,17 @@
                           complex_color=True, need_clone=True,
                           spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-color")}
 
 
 ${helpers.predefined_type(
     "-moz-tab-size", "LengthOrNumber",
     "::values::Either::Second(8.0)",
     "parse_non_negative",
-    products="gecko", boxed=True, animation_type="none",
+    products="gecko", animation_type="none",
     spec="https://drafts.csswg.org/css-text-3/#tab-size-property")}
 
 
 // CSS Compatibility
 // https://compat.spec.whatwg.org
 ${helpers.predefined_type(
     "-webkit-text-fill-color", "CSSColor",
     "CSSParserColor::CurrentColor",
@@ -1227,17 +1227,17 @@
 ${helpers.predefined_type(
     "-webkit-text-stroke-color", "CSSColor",
     "CSSParserColor::CurrentColor",
     initial_specified_value="specified::CSSColor::currentcolor()",
     products="gecko", animation_type="normal",
     complex_color=True, need_clone=True,
     spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color")}
 
-<%helpers:longhand products="gecko" name="-webkit-text-stroke-width" boxed="True" animation_type="none"
+<%helpers:longhand products="gecko" name="-webkit-text-stroke-width" animation_type="none"
                    spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width">
     use app_units::Au;
     use std::fmt;
     use style_traits::ToCss;
     use values::HasViewportPercentage;
     use values::specified::{BorderWidth, Length};
 
     pub type SpecifiedValue = BorderWidth;
--- a/servo/components/style/values/computed/length.rs
+++ b/servo/components/style/values/computed/length.rs
@@ -41,17 +41,17 @@ impl ToComputedValue for specified::NoCa
 
 impl ToComputedValue for specified::Length {
     type ComputedValue = Au;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Au {
         match *self {
             specified::Length::NoCalc(l) => l.to_computed_value(context),
-            specified::Length::Calc(ref calc, range) => range.clamp(calc.to_computed_value(context).length()),
+            specified::Length::Calc(range, ref calc) => range.clamp(calc.to_computed_value(context).length()),
         }
     }
 
     #[inline]
     fn from_computed_value(computed: &Au) -> Self {
         specified::Length::NoCalc(specified::NoCalcLength::from_computed_value(computed))
     }
 }
--- a/servo/components/style/values/specified/length.rs
+++ b/servo/components/style/values/specified/length.rs
@@ -460,40 +460,40 @@ impl NoCalcLength {
 #[derive(Clone, PartialEq, Debug)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum Length {
     /// The internal length type that cannot parse `calc`
     NoCalc(NoCalcLength),
     /// A calc expression.
     ///
     /// https://drafts.csswg.org/css-values/#calc-notation
-    Calc(Box<CalcLengthOrPercentage>, AllowedLengthType),
+    Calc(AllowedLengthType, Box<CalcLengthOrPercentage>),
 }
 
 impl From<NoCalcLength> for Length {
     #[inline]
     fn from(len: NoCalcLength) -> Self {
         Length::NoCalc(len)
     }
 }
 
 impl HasViewportPercentage for Length {
     fn has_viewport_percentage(&self) -> bool {
         match *self {
             Length::NoCalc(ref inner) => inner.has_viewport_percentage(),
-            Length::Calc(ref calc, _) => calc.has_viewport_percentage(),
+            Length::Calc(_, ref calc) => calc.has_viewport_percentage(),
         }
     }
 }
 
 impl ToCss for Length {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
         match *self {
             Length::NoCalc(ref inner) => inner.to_css(dest),
-            Length::Calc(ref calc, _) => calc.to_css(dest),
+            Length::Calc(_, ref calc) => calc.to_css(dest),
         }
     }
 }
 
 impl Mul<CSSFloat> for Length {
     type Output = Length;
 
     #[inline]
@@ -823,17 +823,17 @@ impl CalcLengthOrPercentage {
             Some(ref value) => Ok(value * multiplier)
         }
     }
 
     fn parse_length(context: &ParserContext,
                     input: &mut Parser,
                     num_context: AllowedLengthType) -> Result<Length, ()> {
         CalcLengthOrPercentage::parse(context, input, CalcUnit::Length).map(|calc| {
-            Length::Calc(Box::new(calc), num_context)
+            Length::Calc(num_context, Box::new(calc))
         })
     }
 
     fn parse_length_or_percentage(context: &ParserContext, input: &mut Parser) -> Result<CalcLengthOrPercentage, ()> {
         CalcLengthOrPercentage::parse(context, input, CalcUnit::LengthOrPercentage)
     }
 
     #[allow(missing_docs)]
@@ -1086,17 +1086,17 @@ pub enum LengthOrPercentage {
     Percentage(Percentage),
     Calc(Box<CalcLengthOrPercentage>),
 }
 
 impl From<Length> for LengthOrPercentage {
     fn from(len: Length) -> LengthOrPercentage {
         match len {
             Length::NoCalc(l) => LengthOrPercentage::Length(l),
-            Length::Calc(l, _) => LengthOrPercentage::Calc(l),
+            Length::Calc(_, l) => LengthOrPercentage::Calc(l),
         }
     }
 }
 
 impl From<NoCalcLength> for LengthOrPercentage {
     #[inline]
     fn from(len: NoCalcLength) -> Self {
         LengthOrPercentage::Length(len)
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -1439,20 +1439,20 @@ pub extern "C" fn Servo_DeclarationBlock
     use style::values::specified::length::NoCalcLength;
 
     let long = get_longhand_from_id!(property);
     let nocalc = NoCalcLength::from_px(value);
 
     let prop = match_wrap_declared! { long,
         Height => nocalc.into(),
         Width => nocalc.into(),
-        BorderTopWidth => Box::new(BorderWidth::Width(nocalc.into())),
-        BorderRightWidth => Box::new(BorderWidth::Width(nocalc.into())),
-        BorderBottomWidth => Box::new(BorderWidth::Width(nocalc.into())),
-        BorderLeftWidth => Box::new(BorderWidth::Width(nocalc.into())),
+        BorderTopWidth => BorderWidth::Width(nocalc.into()),
+        BorderRightWidth => BorderWidth::Width(nocalc.into()),
+        BorderBottomWidth => BorderWidth::Width(nocalc.into()),
+        BorderLeftWidth => BorderWidth::Width(nocalc.into()),
         MarginTop => nocalc.into(),
         MarginRight => nocalc.into(),
         MarginBottom => nocalc.into(),
         MarginLeft => nocalc.into(),
         PaddingTop => nocalc.into(),
         PaddingRight => nocalc.into(),
         PaddingBottom => nocalc.into(),
         PaddingLeft => nocalc.into(),
--- a/servo/rust-commit-hash
+++ b/servo/rust-commit-hash
@@ -1,1 +1,1 @@
-474f7a91eec8cba83b7eb7a578a7adb70614f877
+5f13a3b540ab6024665322d716e487c800645f24
--- a/servo/tests/unit/style/properties/serialization.rs
+++ b/servo/tests/unit/style/properties/serialization.rs
@@ -220,20 +220,20 @@ mod shorthand_serialization {
           properties.push(PropertyDeclaration::BorderTopStyle(solid.clone()));
           properties.push(PropertyDeclaration::BorderRightStyle(solid.clone()));
           properties.push(PropertyDeclaration::BorderBottomStyle(solid.clone()));
           properties.push(PropertyDeclaration::BorderLeftStyle(solid.clone()));
 
           let px_30 = BorderWidth::from_length(Length::from_px(30f32));
           let px_10 = BorderWidth::from_length(Length::from_px(10f32));
 
-          properties.push(PropertyDeclaration::BorderTopWidth(Box::new(px_30.clone())));
-          properties.push(PropertyDeclaration::BorderRightWidth(Box::new(px_30.clone())));
-          properties.push(PropertyDeclaration::BorderBottomWidth(Box::new(px_30.clone())));
-          properties.push(PropertyDeclaration::BorderLeftWidth(Box::new(px_10.clone())));
+          properties.push(PropertyDeclaration::BorderTopWidth(px_30.clone()));
+          properties.push(PropertyDeclaration::BorderRightWidth(px_30.clone()));
+          properties.push(PropertyDeclaration::BorderBottomWidth(px_30.clone()));
+          properties.push(PropertyDeclaration::BorderLeftWidth(px_10.clone()));
 
           let blue = CSSColor {
               parsed: ComputedColor::RGBA(RGBA::new(0, 0, 255, 255)),
               authored: None
           };
 
           properties.push(PropertyDeclaration::BorderTopColor(blue.clone()));
           properties.push(PropertyDeclaration::BorderRightColor(blue.clone()));
@@ -253,20 +253,20 @@ mod shorthand_serialization {
 
           properties.push(PropertyDeclaration::BorderTopStyle(solid.clone()));
           properties.push(PropertyDeclaration::BorderRightStyle(solid.clone()));
           properties.push(PropertyDeclaration::BorderBottomStyle(solid.clone()));
           properties.push(PropertyDeclaration::BorderLeftStyle(solid.clone()));
 
           let px_30 = BorderWidth::from_length(Length::from_px(30f32));
 
-          properties.push(PropertyDeclaration::BorderTopWidth(Box::new(px_30.clone())));
-          properties.push(PropertyDeclaration::BorderRightWidth(Box::new(px_30.clone())));
-          properties.push(PropertyDeclaration::BorderBottomWidth(Box::new(px_30.clone())));
-          properties.push(PropertyDeclaration::BorderLeftWidth(Box::new(px_30.clone())));
+          properties.push(PropertyDeclaration::BorderTopWidth(px_30.clone()));
+          properties.push(PropertyDeclaration::BorderRightWidth(px_30.clone()));
+          properties.push(PropertyDeclaration::BorderBottomWidth(px_30.clone()));
+          properties.push(PropertyDeclaration::BorderLeftWidth(px_30.clone()));
 
           let blue = CSSColor {
               parsed: ComputedColor::RGBA(RGBA::new(0, 0, 255, 255)),
               authored: None
           };
 
           properties.push(PropertyDeclaration::BorderTopColor(blue.clone()));
           properties.push(PropertyDeclaration::BorderRightColor(blue.clone()));
@@ -297,38 +297,38 @@ mod shorthand_serialization {
             let mut properties = Vec::new();
 
             let top_px = BorderWidth::from_length(Length::from_px(10f32));
             let bottom_px = BorderWidth::from_length(Length::from_px(10f32));
 
             let right_px = BorderWidth::from_length(Length::from_px(15f32));
             let left_px = BorderWidth::from_length(Length::from_px(15f32));
 
-            properties.push(PropertyDeclaration::BorderTopWidth(Box::new(top_px)));
-            properties.push(PropertyDeclaration::BorderRightWidth(Box::new(right_px)));
-            properties.push(PropertyDeclaration::BorderBottomWidth(Box::new(bottom_px)));
-            properties.push(PropertyDeclaration::BorderLeftWidth(Box::new(left_px)));
+            properties.push(PropertyDeclaration::BorderTopWidth(top_px));
+            properties.push(PropertyDeclaration::BorderRightWidth(right_px));
+            properties.push(PropertyDeclaration::BorderBottomWidth(bottom_px));
+            properties.push(PropertyDeclaration::BorderLeftWidth(left_px));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border-width: 10px 15px;");
         }
 
         #[test]
         fn border_width_with_keywords_should_serialize_correctly() {
             let mut properties = Vec::new();
 
             let top_px = BorderWidth::Thin;
             let right_px = BorderWidth::Medium;
             let bottom_px = BorderWidth::Thick;
             let left_px = BorderWidth::from_length(Length::from_px(15f32));
 
-            properties.push(PropertyDeclaration::BorderTopWidth(Box::new(top_px)));
-            properties.push(PropertyDeclaration::BorderRightWidth(Box::new(right_px)));
-            properties.push(PropertyDeclaration::BorderBottomWidth(Box::new(bottom_px)));
-            properties.push(PropertyDeclaration::BorderLeftWidth(Box::new(left_px)));
+            properties.push(PropertyDeclaration::BorderTopWidth(top_px));
+            properties.push(PropertyDeclaration::BorderRightWidth(right_px));
+            properties.push(PropertyDeclaration::BorderBottomWidth(bottom_px));
+            properties.push(PropertyDeclaration::BorderLeftWidth(left_px));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border-width: thin medium thick 15px;");
         }
 
         #[test]
         fn border_color_should_serialize_correctly() {
             let mut properties = Vec::new();
@@ -406,17 +406,17 @@ mod shorthand_serialization {
 
             let width = BorderWidth::from_length(Length::from_px(4f32));
             let style = BorderStyle::solid;
             let color = CSSColor {
                 parsed: ComputedColor::RGBA(RGBA::new(255, 0, 0, 255)),
                 authored: None
             };
 
-            properties.push(PropertyDeclaration::BorderTopWidth(Box::new(width)));
+            properties.push(PropertyDeclaration::BorderTopWidth(width));
             properties.push(PropertyDeclaration::BorderTopStyle(style));
             properties.push(PropertyDeclaration::BorderTopColor(color));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border-top: 4px solid rgb(255, 0, 0);");
         }
 
         fn get_border_property_values() -> (BorderWidth, BorderStyle, CSSColor) {
@@ -424,78 +424,78 @@ mod shorthand_serialization {
              BorderStyle::solid,
              CSSColor::currentcolor())
         }
 
         #[test]
         fn border_top_should_serialize_correctly() {
             let mut properties = Vec::new();
             let (width, style, color) = get_border_property_values();
-            properties.push(PropertyDeclaration::BorderTopWidth(Box::new(width)));
+            properties.push(PropertyDeclaration::BorderTopWidth(width));
             properties.push(PropertyDeclaration::BorderTopStyle(style));
             properties.push(PropertyDeclaration::BorderTopColor(color));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border-top: 4px solid;");
         }
 
         #[test]
         fn border_right_should_serialize_correctly() {
             let mut properties = Vec::new();
             let (width, style, color) = get_border_property_values();
-            properties.push(PropertyDeclaration::BorderRightWidth(Box::new(width)));
+            properties.push(PropertyDeclaration::BorderRightWidth(width));
             properties.push(PropertyDeclaration::BorderRightStyle(style));
             properties.push(PropertyDeclaration::BorderRightColor(color));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border-right: 4px solid;");
         }
 
         #[test]
         fn border_bottom_should_serialize_correctly() {
             let mut properties = Vec::new();
             let (width, style, color) = get_border_property_values();
-            properties.push(PropertyDeclaration::BorderBottomWidth(Box::new(width)));
+            properties.push(PropertyDeclaration::BorderBottomWidth(width));
             properties.push(PropertyDeclaration::BorderBottomStyle(style));
             properties.push(PropertyDeclaration::BorderBottomColor(color));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border-bottom: 4px solid;");
         }
 
         #[test]
         fn border_left_should_serialize_correctly() {
             let mut properties = Vec::new();
             let (width, style, color) = get_border_property_values();
-            properties.push(PropertyDeclaration::BorderLeftWidth(Box::new(width)));
+            properties.push(PropertyDeclaration::BorderLeftWidth(width));
             properties.push(PropertyDeclaration::BorderLeftStyle(style));
             properties.push(PropertyDeclaration::BorderLeftColor(color));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border-left: 4px solid;");
         }
 
         #[test]
         fn border_should_serialize_correctly() {
             let mut properties = Vec::new();
             let (width, style, color) = get_border_property_values();
 
-            properties.push(PropertyDeclaration::BorderTopWidth(Box::new(width.clone())));
+            properties.push(PropertyDeclaration::BorderTopWidth(width.clone()));
             properties.push(PropertyDeclaration::BorderTopStyle(style.clone()));
             properties.push(PropertyDeclaration::BorderTopColor(color.clone()));
 
-            properties.push(PropertyDeclaration::BorderRightWidth(Box::new(width.clone())));
+            properties.push(PropertyDeclaration::BorderRightWidth(width.clone()));
             properties.push(PropertyDeclaration::BorderRightStyle(style.clone()));
             properties.push(PropertyDeclaration::BorderRightColor(color.clone()));
 
-            properties.push(PropertyDeclaration::BorderBottomWidth(Box::new(width.clone())));
+            properties.push(PropertyDeclaration::BorderBottomWidth(width.clone()));
             properties.push(PropertyDeclaration::BorderBottomStyle(style.clone()));
             properties.push(PropertyDeclaration::BorderBottomColor(color.clone()));
 
-            properties.push(PropertyDeclaration::BorderLeftWidth(Box::new(width.clone())));
+            properties.push(PropertyDeclaration::BorderLeftWidth(width.clone()));
             properties.push(PropertyDeclaration::BorderLeftStyle(style.clone()));
             properties.push(PropertyDeclaration::BorderLeftColor(color.clone()));
 
             let serialization = shorthand_properties_to_string(properties);
             assert_eq!(serialization, "border: 4px solid;");
         }
     }
 
@@ -570,17 +570,17 @@ mod shorthand_serialization {
     fn columns_should_serialize_correctly() {
         use style::values::{Auto, Either};
 
         let mut properties = Vec::new();
 
         let width = Either::Second(Auto);
         let count = Either::Second(Auto);
 
-        properties.push(PropertyDeclaration::ColumnWidth(Box::new(width)));
+        properties.push(PropertyDeclaration::ColumnWidth(width));
         properties.push(PropertyDeclaration::ColumnCount(count));
 
         let serialization = shorthand_properties_to_string(properties);
         assert_eq!(serialization, "columns: auto auto;");
     }
 
     #[test]
     fn flex_should_serialize_all_available_properties() {
--- a/servo/tests/unit/style/properties/viewport.rs
+++ b/servo/tests/unit/style/properties/viewport.rs
@@ -6,22 +6,22 @@ use app_units::Au;
 use style::properties::PropertyDeclaration;
 use style::properties::longhands::border_top_width;
 use style::values::HasViewportPercentage;
 use style::values::specified::{AbsoluteLength, Length, NoCalcLength, ViewportPercentageLength};
 
 #[test]
 fn has_viewport_percentage_for_specified_value() {
     //TODO: test all specified value with a HasViewportPercentage impl
-    let pvw = PropertyDeclaration::BorderTopWidth(Box::new(
+    let pvw = PropertyDeclaration::BorderTopWidth(
         border_top_width::SpecifiedValue::from_length(
             Length::NoCalc(NoCalcLength::ViewportPercentage(ViewportPercentageLength::Vw(100.)))
         )
-    ));
+    );
     assert!(pvw.has_viewport_percentage());
 
-    let pabs = PropertyDeclaration::BorderTopWidth(Box::new(
+    let pabs = PropertyDeclaration::BorderTopWidth(
         border_top_width::SpecifiedValue::from_length(
             Length::NoCalc(NoCalcLength::Absolute(AbsoluteLength::Px(Au(100).to_f32_px())))
         )
-    ));
+    );
     assert!(!pabs.has_viewport_percentage());
 }