Bug 1574148 - Fix formatting of recent changes.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 15 Aug 2019 13:31:37 +0000
changeset 488229 0fffa7c38535239a5b51cee44096e246de446856
parent 488228 175608dbc5018b3563b85908578cc0ca038f7acb
child 488230 289698fdd8ce1d2ab7f25c2e536bd7f553646e9a
push id36437
push userncsoregi@mozilla.com
push dateThu, 15 Aug 2019 19:33:18 +0000
treeherdermozilla-central@44aac6fc3352 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1574148
milestone70.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
Bug 1574148 - Fix formatting of recent changes. Differential Revision: https://phabricator.services.mozilla.com/D42129
servo/components/style/gecko/pseudo_element.rs
servo/components/style/style_adjuster.rs
servo/components/style/values/computed/mod.rs
servo/components/style/values/computed/text.rs
servo/components/style/values/generics/grid.rs
servo/components/style/values/specified/box.rs
servo/components/style/values/specified/grid.rs
servo/components/style/values/specified/text.rs
--- a/servo/components/style/gecko/pseudo_element.rs
+++ b/servo/components/style/gecko/pseudo_element.rs
@@ -182,18 +182,19 @@ impl PseudoElement {
     /// Property flag that properties must have to apply to this pseudo-element.
     #[inline]
     pub fn property_restriction(&self) -> Option<PropertyFlags> {
         Some(match *self {
             PseudoElement::FirstLetter => PropertyFlags::APPLIES_TO_FIRST_LETTER,
             PseudoElement::FirstLine => PropertyFlags::APPLIES_TO_FIRST_LINE,
             PseudoElement::Placeholder => PropertyFlags::APPLIES_TO_PLACEHOLDER,
             PseudoElement::Cue => PropertyFlags::APPLIES_TO_CUE,
-            PseudoElement::Marker if static_prefs::pref!("layout.css.marker.restricted") =>
-                PropertyFlags::APPLIES_TO_MARKER,
+            PseudoElement::Marker if static_prefs::pref!("layout.css.marker.restricted") => {
+                PropertyFlags::APPLIES_TO_MARKER
+            },
             _ => return None,
         })
     }
 
     /// Whether this pseudo-element should actually exist if it has
     /// the given styles.
     pub fn should_exist(&self, style: &ComputedValues) -> bool {
         debug_assert!(self.is_eager());
--- a/servo/components/style/style_adjuster.rs
+++ b/servo/components/style/style_adjuster.rs
@@ -3,22 +3,22 @@
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 //! A struct to encapsulate all the style fixups and flags propagations
 //! a computed style needs in order for it to adhere to the CSS spec.
 
 use crate::dom::TElement;
 use crate::properties::computed_value_flags::ComputedValueFlags;
 use crate::properties::longhands::display::computed_value::T as Display;
-#[cfg(feature = "gecko")]
-use crate::values::specified::box_::DisplayInside;
 use crate::properties::longhands::float::computed_value::T as Float;
 use crate::properties::longhands::overflow_x::computed_value::T as Overflow;
 use crate::properties::longhands::position::computed_value::T as Position;
 use crate::properties::{self, ComputedValues, StyleBuilder};
+#[cfg(feature = "gecko")]
+use crate::values::specified::box_::DisplayInside;
 use app_units::Au;
 
 /// A struct that implements all the adjustment methods.
 ///
 /// NOTE(emilio): If new adjustments are introduced that depend on reset
 /// properties of the parent, you may need tweaking the
 /// `ChildCascadeRequirement` code in `matching.rs`.
 ///
@@ -204,18 +204,20 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
 
         let is_item_or_root = blockify;
 
         blockify_if!(self.style.floated());
         blockify_if!(self.style.out_of_flow_positioned());
         #[cfg(feature = "gecko")]
         blockify_if!(
             self.style.pseudo.map_or(false, |p| p.is_marker()) &&
-             self.style.get_parent_list().clone_list_style_position() == ListStylePosition::Outside &&
-             layout_parent_style.get_box().clone_display().inside() != DisplayInside::Inline);
+                self.style.get_parent_list().clone_list_style_position() ==
+                    ListStylePosition::Outside &&
+                layout_parent_style.get_box().clone_display().inside() != DisplayInside::Inline
+        );
 
         if !blockify {
             return;
         }
 
         let display = self.style.get_box().clone_display();
         let blockified_display = display.equivalent_block_display(is_root);
         if display != blockified_display {
--- a/servo/components/style/values/computed/mod.rs
+++ b/servo/components/style/values/computed/mod.rs
@@ -71,20 +71,20 @@ pub use self::outline::OutlineStyle;
 pub use self::percentage::{NonNegativePercentage, Percentage};
 pub use self::position::{GridAutoFlow, GridTemplateAreas, Position, PositionOrAuto, ZIndex};
 pub use self::rect::NonNegativeLengthOrNumberRect;
 pub use self::resolution::Resolution;
 pub use self::svg::MozContextProperties;
 pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
 pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
 pub use self::table::XSpan;
-pub use self::text::{TextDecorationLength, TextDecorationSkipInk};
 pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight};
 pub use self::text::{OverflowWrap, TextOverflow, WordBreak, WordSpacing};
 pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
+pub use self::text::{TextDecorationLength, TextDecorationSkipInk};
 pub use self::time::Time;
 pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
 pub use self::transform::{TransformOrigin, TransformStyle, Translate};
 #[cfg(feature = "gecko")]
 pub use self::ui::CursorImage;
 pub use self::ui::{Cursor, MozForceBrokenImageIcon, UserSelect};
 pub use super::specified::TextTransform;
 pub use super::specified::{BorderStyle, TextDecorationLine};
--- a/servo/components/style/values/computed/text.rs
+++ b/servo/components/style/values/computed/text.rs
@@ -5,17 +5,17 @@
 //! Computed types for text properties.
 
 #[cfg(feature = "servo")]
 use crate::properties::StyleBuilder;
 use crate::values::computed::length::{Length, LengthPercentage};
 use crate::values::computed::{Context, NonNegativeLength, NonNegativeNumber, ToComputedValue};
 use crate::values::generics::text::InitialLetter as GenericInitialLetter;
 use crate::values::generics::text::LineHeight as GenericLineHeight;
-use crate::values::generics::text::{Spacing, GenericTextDecorationLength};
+use crate::values::generics::text::{GenericTextDecorationLength, Spacing};
 use crate::values::specified::text::{self as specified, TextOverflowSide};
 use crate::values::specified::text::{TextEmphasisFillMode, TextEmphasisShapeKeyword};
 use crate::values::{CSSFloat, CSSInteger};
 use crate::Zero;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
 
 pub use crate::values::specified::TextAlignKeyword as TextAlign;
--- a/servo/components/style/values/generics/grid.rs
+++ b/servo/components/style/values/generics/grid.rs
@@ -414,17 +414,17 @@ impl Parse for RepeatCount<specified::In
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if let Ok(mut i) = input.try(|i| specified::Integer::parse_positive(context, i)) {
             if i.value() > MAX_GRID_LINE {
                 i = specified::Integer::new(MAX_GRID_LINE);
             }
-            return Ok(RepeatCount::Number(i))
+            return Ok(RepeatCount::Number(i));
         }
         try_match_ident_ignore_ascii_case! { input,
             "auto-fill" => Ok(RepeatCount::AutoFill),
             "auto-fit" => Ok(RepeatCount::AutoFit),
         }
     }
 }
 
@@ -522,17 +522,26 @@ impl<L, I> TrackListValue<L, I> {
     fn is_repeat(&self) -> bool {
         matches!(*self, TrackListValue::TrackRepeat(..))
     }
 }
 
 /// A grid `<track-list>` type.
 ///
 /// <https://drafts.csswg.org/css-grid/#typedef-track-list>
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
+#[derive(
+    Clone,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToResolvedValue,
+    ToShmem,
+)]
 #[repr(C)]
 pub struct GenericTrackList<LengthPercentage, Integer> {
     /// The index in `values` where our `<auto-repeat>` value is, if in bounds.
     #[css(skip)]
     pub auto_repeat_index: usize,
     /// A vector of `<track-size> | <track-repeat>` values.
     pub values: crate::OwnedSlice<GenericTrackListValue<LengthPercentage, Integer>>,
     /// `<line-names>` accompanying `<track-size> | <track-repeat>` values.
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -46,53 +46,31 @@ fn parse_unimplemented_in_servo_2020(_co
         .as_bool()
         .unwrap_or(false)
 }
 
 /// Defines an element’s display type, which consists of
 /// the two basic qualities of how an element generates boxes
 /// <https://drafts.csswg.org/css-display/#propdef-display>
 #[allow(missing_docs)]
-#[derive(
-    MallocSizeOf,
-    ToShmem,
-    Clone,
-    Copy,
-    Debug,
-    Eq,
-    FromPrimitive,
-    Hash,
-    PartialEq,
-    ToCss,
-)]
+#[derive(Clone, Copy, Debug, Eq, FromPrimitive, Hash, MallocSizeOf, PartialEq, ToCss, ToShmem)]
 #[cfg(feature = "gecko")]
 #[repr(u8)]
 pub enum DisplayOutside {
     None = 0,
     Inline,
     Block,
     TableCaption,
     InternalTable,
     InternalRuby,
     XUL,
 }
 
 #[allow(missing_docs)]
-#[derive(
-    MallocSizeOf,
-    ToShmem,
-    Clone,
-    Copy,
-    Debug,
-    Eq,
-    FromPrimitive,
-    Hash,
-    PartialEq,
-    ToCss,
-)]
+#[derive(Clone, Copy, Debug, Eq, FromPrimitive, Hash, MallocSizeOf, PartialEq, ToCss, ToShmem)]
 #[cfg(feature = "gecko")]
 #[repr(u8)]
 pub enum DisplayInside {
     None = 0,
     Contents,
     Block,
     FlowRoot,
     Inline,
@@ -145,87 +123,104 @@ pub enum DisplayInside {
 pub struct Display(u16);
 
 /// Gecko-only impl block for Display (shared stuff later in this file):
 #[allow(missing_docs)]
 #[allow(non_upper_case_globals)]
 #[cfg(feature = "gecko")]
 impl Display {
     // Our u16 bits are used as follows:    LOOOOOOOIIIIIIII
-    const LIST_ITEM_BIT : u16 = 0x8000;   //^
-    const DISPLAY_OUTSIDE_BITS : u16 = 7; // ^^^^^^^
-    const DISPLAY_INSIDE_BITS : u16 = 8;  //        ^^^^^^^^
+    const LIST_ITEM_BIT: u16 = 0x8000; //^
+    const DISPLAY_OUTSIDE_BITS: u16 = 7; // ^^^^^^^
+    const DISPLAY_INSIDE_BITS: u16 = 8; //        ^^^^^^^^
 
     /// https://drafts.csswg.org/css-display/#the-display-properties
-    pub const None : Self = Self::new(DisplayOutside::None, DisplayInside::None);
-    pub const Contents : Self = Self::new(DisplayOutside::None, DisplayInside::Contents);
-    pub const Inline : Self = Self::new(DisplayOutside::Inline, DisplayInside::Inline);
-    pub const InlineBlock : Self = Self::new(DisplayOutside::Inline, DisplayInside::FlowRoot);
-    pub const Block : Self = Self::new(DisplayOutside::Block, DisplayInside::Block);
-    pub const FlowRoot : Self = Self::new(DisplayOutside::Block, DisplayInside::FlowRoot);
-    pub const Flex : Self = Self::new(DisplayOutside::Block, DisplayInside::Flex);
-    pub const InlineFlex : Self = Self::new(DisplayOutside::Inline, DisplayInside::Flex);
-    pub const Grid : Self = Self::new(DisplayOutside::Block, DisplayInside::Grid);
-    pub const InlineGrid : Self = Self::new(DisplayOutside::Inline, DisplayInside::Grid);
-    pub const Table : Self = Self::new(DisplayOutside::Block, DisplayInside::Table);
-    pub const InlineTable : Self = Self::new(DisplayOutside::Inline, DisplayInside::Table);
-    pub const TableCaption : Self = Self::new(DisplayOutside::TableCaption, DisplayInside::Block);
-    pub const Ruby : Self = Self::new(DisplayOutside::Inline, DisplayInside::Ruby);
-    pub const WebkitBox : Self = Self::new(DisplayOutside::Block, DisplayInside::WebkitBox);
-    pub const WebkitInlineBox : Self = Self::new(DisplayOutside::Inline, DisplayInside::WebkitBox);
-    pub const ListItem : Self = Self::new_list_item(DisplayOutside::Block, DisplayInside::Block);
+    pub const None: Self = Self::new(DisplayOutside::None, DisplayInside::None);
+    pub const Contents: Self = Self::new(DisplayOutside::None, DisplayInside::Contents);
+    pub const Inline: Self = Self::new(DisplayOutside::Inline, DisplayInside::Inline);
+    pub const InlineBlock: Self = Self::new(DisplayOutside::Inline, DisplayInside::FlowRoot);
+    pub const Block: Self = Self::new(DisplayOutside::Block, DisplayInside::Block);
+    pub const FlowRoot: Self = Self::new(DisplayOutside::Block, DisplayInside::FlowRoot);
+    pub const Flex: Self = Self::new(DisplayOutside::Block, DisplayInside::Flex);
+    pub const InlineFlex: Self = Self::new(DisplayOutside::Inline, DisplayInside::Flex);
+    pub const Grid: Self = Self::new(DisplayOutside::Block, DisplayInside::Grid);
+    pub const InlineGrid: Self = Self::new(DisplayOutside::Inline, DisplayInside::Grid);
+    pub const Table: Self = Self::new(DisplayOutside::Block, DisplayInside::Table);
+    pub const InlineTable: Self = Self::new(DisplayOutside::Inline, DisplayInside::Table);
+    pub const TableCaption: Self = Self::new(DisplayOutside::TableCaption, DisplayInside::Block);
+    pub const Ruby: Self = Self::new(DisplayOutside::Inline, DisplayInside::Ruby);
+    pub const WebkitBox: Self = Self::new(DisplayOutside::Block, DisplayInside::WebkitBox);
+    pub const WebkitInlineBox: Self = Self::new(DisplayOutside::Inline, DisplayInside::WebkitBox);
+    pub const ListItem: Self = Self::new_list_item(DisplayOutside::Block, DisplayInside::Block);
 
     /// Internal table boxes.
-    pub const TableRowGroup : Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableRowGroup);
-    pub const TableHeaderGroup : Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableHeaderGroup);
-    pub const TableFooterGroup : Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableFooterGroup);
-    pub const TableColumn : Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableColumn);
-    pub const TableColumnGroup : Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableColumnGroup);
-    pub const TableRow : Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableRow);
-    pub const TableCell : Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableCell);
+    pub const TableRowGroup: Self =
+        Self::new(DisplayOutside::InternalTable, DisplayInside::TableRowGroup);
+    pub const TableHeaderGroup: Self = Self::new(
+        DisplayOutside::InternalTable,
+        DisplayInside::TableHeaderGroup,
+    );
+    pub const TableFooterGroup: Self = Self::new(
+        DisplayOutside::InternalTable,
+        DisplayInside::TableFooterGroup,
+    );
+    pub const TableColumn: Self =
+        Self::new(DisplayOutside::InternalTable, DisplayInside::TableColumn);
+    pub const TableColumnGroup: Self = Self::new(
+        DisplayOutside::InternalTable,
+        DisplayInside::TableColumnGroup,
+    );
+    pub const TableRow: Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableRow);
+    pub const TableCell: Self = Self::new(DisplayOutside::InternalTable, DisplayInside::TableCell);
 
     /// Internal ruby boxes.
-    pub const RubyBase : Self = Self::new(DisplayOutside::InternalRuby, DisplayInside::RubyBase);
-    pub const RubyBaseContainer : Self = Self::new(DisplayOutside::InternalRuby, DisplayInside::RubyBaseContainer);
-    pub const RubyText : Self = Self::new(DisplayOutside::InternalRuby, DisplayInside::RubyText);
-    pub const RubyTextContainer : Self = Self::new(DisplayOutside::InternalRuby, DisplayInside::RubyTextContainer);
+    pub const RubyBase: Self = Self::new(DisplayOutside::InternalRuby, DisplayInside::RubyBase);
+    pub const RubyBaseContainer: Self = Self::new(
+        DisplayOutside::InternalRuby,
+        DisplayInside::RubyBaseContainer,
+    );
+    pub const RubyText: Self = Self::new(DisplayOutside::InternalRuby, DisplayInside::RubyText);
+    pub const RubyTextContainer: Self = Self::new(
+        DisplayOutside::InternalRuby,
+        DisplayInside::RubyTextContainer,
+    );
 
     /// XUL boxes.
-    pub const MozBox : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozBox);
-    pub const MozInlineBox : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozInlineBox);
-    pub const MozGrid : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGrid);
-    pub const MozInlineGrid : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozInlineGrid);
-    pub const MozGridGroup : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGridGroup);
-    pub const MozGridLine : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGridLine);
-    pub const MozStack : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozStack);
-    pub const MozInlineStack : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozInlineStack);
-    pub const MozDeck : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozDeck);
-    pub const MozGroupbox : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGroupbox);
-    pub const MozPopup : Self = Self::new(DisplayOutside::XUL, DisplayInside::MozPopup);
+    pub const MozBox: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozBox);
+    pub const MozInlineBox: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozInlineBox);
+    pub const MozGrid: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGrid);
+    pub const MozInlineGrid: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozInlineGrid);
+    pub const MozGridGroup: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGridGroup);
+    pub const MozGridLine: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGridLine);
+    pub const MozStack: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozStack);
+    pub const MozInlineStack: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozInlineStack);
+    pub const MozDeck: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozDeck);
+    pub const MozGroupbox: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGroupbox);
+    pub const MozPopup: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozPopup);
 
     /// Make a raw display value from <display-outside> and <display-inside> values.
     #[inline]
-    const fn new(outside:DisplayOutside, inside:DisplayInside) -> Self {
-        let o : u16 = ((outside as u8) as u16) << Self::DISPLAY_INSIDE_BITS;
-        let i : u16 = (inside as u8) as u16;
+    const fn new(outside: DisplayOutside, inside: DisplayInside) -> Self {
+        let o: u16 = ((outside as u8) as u16) << Self::DISPLAY_INSIDE_BITS;
+        let i: u16 = (inside as u8) as u16;
         Self(o | i)
     }
 
     /// Make a list-item display value from <display-outside> and <display-inside>.
     #[inline]
-    const fn new_list_item(outside:DisplayOutside, inside:DisplayInside) -> Self {
+    const fn new_list_item(outside: DisplayOutside, inside: DisplayInside) -> Self {
         let v = Self::new(outside, inside);
         Self(v.0 | Self::LIST_ITEM_BIT)
     }
 
     /// Make a display enum value from <display-outside> and <display-inside> values.
     /// We store `flow` as a synthetic `block` or `inline` inside-value to simplify
     /// our layout code.
     #[inline]
-    fn from3(outside:DisplayOutside, inside:DisplayInside, list_item:bool) -> Self {
+    fn from3(outside: DisplayOutside, inside: DisplayInside, list_item: bool) -> Self {
         let inside = match inside {
             DisplayInside::Flow => match outside {
                 DisplayOutside::Inline => DisplayInside::Inline,
                 _ => DisplayInside::Block,
             },
             _ => inside,
         };
         let v = Self::new(outside, inside);
@@ -240,18 +235,19 @@ impl Display {
     pub fn inside(&self) -> DisplayInside {
         DisplayInside::from_u16(self.0 & ((1 << Self::DISPLAY_INSIDE_BITS) - 1)).unwrap()
     }
 
     /// Accessor for the <display-outside> value.
     #[inline]
     pub fn outside(&self) -> DisplayOutside {
         DisplayOutside::from_u16(
-            (self.0 >> Self::DISPLAY_INSIDE_BITS) & ((1 << Self::DISPLAY_OUTSIDE_BITS) - 1)
-        ).unwrap()
+            (self.0 >> Self::DISPLAY_INSIDE_BITS) & ((1 << Self::DISPLAY_OUTSIDE_BITS) - 1),
+        )
+        .unwrap()
     }
 
     /// Returns whether this `display` value is some kind of list-item.
     #[inline]
     pub const fn is_list_item(&self) -> bool {
         (self.0 & Self::LIST_ITEM_BIT) != 0
     }
 
@@ -398,17 +394,17 @@ impl Display {
         #[cfg(feature = "gecko")]
         {
             // Special handling for `contents` and `list-item`s on the root element.
             if _is_root_element && (*self == Display::Contents || self.is_list_item()) {
                 return Display::Block;
             }
             match self.outside() {
                 DisplayOutside::Inline => {
-                    let inside =  match self.inside() {
+                    let inside = match self.inside() {
                         DisplayInside::Inline | DisplayInside::FlowRoot => DisplayInside::Block,
                         inside => inside,
                     };
                     Display::from3(DisplayOutside::Block, inside, self.is_list_item())
                 },
                 DisplayOutside::Block | DisplayOutside::None => *self,
                 _ => Display::Block,
             }
@@ -438,22 +434,20 @@ impl Display {
         match self.outside() {
             DisplayOutside::Block => {
                 let inside = match self.inside() {
                     DisplayInside::Block => DisplayInside::FlowRoot,
                     inside => inside,
                 };
                 Display::from3(DisplayOutside::Inline, inside, self.is_list_item())
             },
-            DisplayOutside::XUL => {
-                match self.inside() {
-                    DisplayInside::MozBox => Display::MozInlineBox,
-                    DisplayInside::MozStack => Display::MozInlineStack,
-                    _ => *self,
-                }
+            DisplayOutside::XUL => match self.inside() {
+                DisplayInside::MozBox => Display::MozInlineBox,
+                DisplayInside::MozStack => Display::MozInlineStack,
+                _ => *self,
             },
             _ => *self,
         }
     }
 
     /// Returns true if the value is `Contents`
     #[inline]
     pub fn is_contents(&self) -> bool {
@@ -472,18 +466,21 @@ impl Display {
 }
 
 #[cfg(feature = "gecko")]
 impl ToCss for Display {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: fmt::Write,
     {
-        debug_assert_ne!(self.inside(), DisplayInside::Flow,
-                         "`flow` never appears in `display` computed value");
+        debug_assert_ne!(
+            self.inside(),
+            DisplayInside::Flow,
+            "`flow` never appears in `display` computed value"
+        );
         let outside = self.outside();
         let inside = match self.inside() {
             DisplayInside::Block | DisplayInside::Inline => DisplayInside::Flow,
             inside => inside,
         };
         match *self {
             Display::Block | Display::Inline => outside.to_css(dest),
             Display::InlineBlock => dest.write_str("inline-block"),
@@ -494,36 +491,34 @@ impl ToCss for Display {
             Display::TableCaption => dest.write_str("table-caption"),
             Display::ListItem => dest.write_str("list-item"),
             _ => match (outside, inside) {
                 (DisplayOutside::Inline, DisplayInside::Flex) |
                 (DisplayOutside::Inline, DisplayInside::Grid) |
                 (DisplayOutside::Inline, DisplayInside::Table) => {
                     dest.write_str("inline-")?;
                     inside.to_css(dest)
-                }
-                (DisplayOutside::Block, DisplayInside::Ruby) => {
-                    dest.write_str("block ruby")
-                }
+                },
+                (DisplayOutside::Block, DisplayInside::Ruby) => dest.write_str("block ruby"),
                 (_, inside) => {
                     if self.is_list_item() {
                         if outside != DisplayOutside::Block {
                             outside.to_css(dest)?;
                             dest.write_str(" ")?;
                         }
                         if inside != DisplayInside::Flow {
                             inside.to_css(dest)?;
                             dest.write_str(" ")?;
                         }
                         dest.write_str("list-item")
                     } else {
                         inside.to_css(dest)
                     }
-                }
-            }
+                },
+            },
         }
     }
 }
 
 /// <display-inside> = flow | flow-root | table | flex | grid | ruby
 /// https://drafts.csswg.org/css-display/#typedef-display-inside
 #[cfg(feature = "gecko")]
 fn parse_display_inside<'i, 't>(
@@ -560,27 +555,26 @@ fn parse_display_inside_for_list_item<'i
 ) -> Result<DisplayInside, ParseError<'i>> {
     Ok(try_match_ident_ignore_ascii_case! { input,
         "flow" => DisplayInside::Flow,
         "flow-root" => DisplayInside::FlowRoot,
     })
 }
 /// Test a <display-inside> Result for same values as above.
 #[cfg(feature = "gecko")]
-fn is_valid_inside_for_list_item<'i>(
-    inside: &Result<DisplayInside, ParseError<'i>>,
-) -> bool {
-    matches!(inside, Ok(DisplayInside::Flow) | Ok(DisplayInside::FlowRoot))
+fn is_valid_inside_for_list_item<'i>(inside: &Result<DisplayInside, ParseError<'i>>) -> bool {
+    matches!(
+        inside,
+        Ok(DisplayInside::Flow) | Ok(DisplayInside::FlowRoot)
+    )
 }
 
 /// Parse `list-item`.
 #[cfg(feature = "gecko")]
-fn parse_list_item<'i, 't>(
-    input: &mut Parser<'i, 't>,
-) -> Result<(), ParseError<'i>> {
+fn parse_list_item<'i, 't>(input: &mut Parser<'i, 't>) -> Result<(), ParseError<'i>> {
     Ok(try_match_ident_ignore_ascii_case! { input,
         "list-item" => (),
     })
 }
 
 #[cfg(feature = "gecko")]
 impl Parse for Display {
     fn parse<'i, 't>(
@@ -612,25 +606,23 @@ impl Parse for Display {
                 };
                 if !got_list_item && is_valid_inside_for_list_item(&inside) {
                     got_list_item = input.try(parse_list_item).is_ok();
                 }
             }
         }
         if got_list_item || inside.is_ok() || outside.is_ok() {
             let inside = inside.unwrap_or(DisplayInside::Flow);
-            let outside = outside.unwrap_or(
-                match inside {
-                    // "If <display-outside> is omitted, the element’s outside display type
-                    // defaults to block — except for ruby, which defaults to inline."
-                    // https://drafts.csswg.org/css-display/#inside-model
-                    DisplayInside::Ruby => DisplayOutside::Inline,
-                    _ => DisplayOutside::Block,
-                }
-            );
+            let outside = outside.unwrap_or(match inside {
+                // "If <display-outside> is omitted, the element’s outside display type
+                // defaults to block — except for ruby, which defaults to inline."
+                // https://drafts.csswg.org/css-display/#inside-model
+                DisplayInside::Ruby => DisplayOutside::Inline,
+                _ => DisplayOutside::Block,
+            });
             return Ok(Display::from3(outside, inside, got_list_item));
         }
 
         // Now parse the single-keyword `display` values.
         Ok(try_match_ident_ignore_ascii_case! { input,
             "none" => Display::None,
             "contents" => Display::Contents,
             "inline-block" => Display::InlineBlock,
@@ -666,48 +658,49 @@ impl Parse for Display {
             "-moz-popup" if moz_display_values_enabled(context) => Display::MozPopup,
         })
     }
 }
 
 #[cfg(feature = "gecko")]
 impl SpecifiedValueInfo for Display {
     fn collect_completion_keywords(f: KeywordsCollectFn) {
-      f(&["block",
-          "contents",
-          "flex",
-          "flow-root",
-          "grid",
-          "inline",
-          "inline-block",
-          "inline-flex",
-          "inline-grid",
-          "inline-table",
-          "inline list-item",
-          "inline flow-root list-item",
-          "list-item",
-          "none",
-          "block ruby",
-          "ruby",
-          "ruby-base",
-          "ruby-base-container",
-          "ruby-text",
-          "ruby-text-container",
-          "table",
-          "table-caption",
-          "table-cell",
-          "table-column",
-          "table-column-group",
-          "table-footer-group",
-          "table-header-group",
-          "table-row",
-          "table-row-group",
-          "-webkit-box",
-          "-webkit-inline-box",
-      ]);
+        f(&[
+            "block",
+            "contents",
+            "flex",
+            "flow-root",
+            "grid",
+            "inline",
+            "inline-block",
+            "inline-flex",
+            "inline-grid",
+            "inline-table",
+            "inline list-item",
+            "inline flow-root list-item",
+            "list-item",
+            "none",
+            "block ruby",
+            "ruby",
+            "ruby-base",
+            "ruby-base-container",
+            "ruby-text",
+            "ruby-text-container",
+            "table",
+            "table-caption",
+            "table-cell",
+            "table-column",
+            "table-column-group",
+            "table-footer-group",
+            "table-header-group",
+            "table-row",
+            "table-row-group",
+            "-webkit-box",
+            "-webkit-inline-box",
+        ]);
     }
 }
 
 /// A specified value for the `vertical-align` property.
 pub type VerticalAlign = GenericVerticalAlign<LengthPercentage>;
 
 impl Parse for VerticalAlign {
     fn parse<'i, 't>(
--- a/servo/components/style/values/specified/grid.rs
+++ b/servo/components/style/values/specified/grid.rs
@@ -164,18 +164,17 @@ impl TrackRepeat<LengthPercentage, Integ
                         RepeatType::Fixed
                     };
 
                     let mut names = vec![];
                     let mut values = vec![];
                     let mut current_names;
 
                     loop {
-                        current_names =
-                            input.try(parse_line_names).unwrap_or_default();
+                        current_names = input.try(parse_line_names).unwrap_or_default();
                         if let Ok(track_size) = input.try(|i| TrackSize::parse(context, i)) {
                             if !track_size.is_fixed() {
                                 if is_auto {
                                     // should be <fixed-size> for <auto-repeat>
                                     return Err(input
                                         .new_custom_error(StyleParseErrorKind::UnspecifiedError));
                                 }
 
@@ -188,21 +187,17 @@ impl TrackRepeat<LengthPercentage, Integ
                             names.push(current_names);
                             if is_auto {
                                 // FIXME: In the older version of the spec
                                 // (https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-auto-repeat),
                                 // if the repeat type is `<auto-repeat>` we shouldn't try to parse more than
                                 // one `TrackSize`. But in current version of the spec, this is deprecated
                                 // but we are adding this for gecko parity. We should remove this when
                                 // gecko implements new spec.
-                                names.push(
-                                    input
-                                        .try(parse_line_names)
-                                        .unwrap_or_default()
-                                );
+                                names.push(input.try(parse_line_names).unwrap_or_default());
                                 break;
                             }
                         } else {
                             if values.is_empty() {
                                 // expecting at least one <track-size>
                                 return Err(
                                     input.new_custom_error(StyleParseErrorKind::UnspecifiedError)
                                 );
@@ -234,21 +229,17 @@ impl Parse for TrackList<LengthPercentag
         let mut names = vec![];
         let mut values = vec![];
 
         // Whether we've parsed an `<auto-repeat>` value.
         let mut auto_repeat_index = None;
         // assume that everything is <fixed-size>. This flag is useful when we encounter <auto-repeat>
         let mut at_least_one_not_fixed = false;
         loop {
-            current_names.extend_from_slice(
-                &mut input
-                    .try(parse_line_names)
-                    .unwrap_or_default()
-            );
+            current_names.extend_from_slice(&mut input.try(parse_line_names).unwrap_or_default());
             if let Ok(track_size) = input.try(|i| TrackSize::parse(context, i)) {
                 if !track_size.is_fixed() {
                     at_least_one_not_fixed = true;
                     if auto_repeat_index.is_some() {
                         // <auto-track-list> only accepts <fixed-size> and <fixed-repeat>
                         return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                     }
                 }
--- a/servo/components/style/values/specified/text.rs
+++ b/servo/components/style/values/specified/text.rs
@@ -7,17 +7,17 @@
 use crate::parser::{Parse, ParserContext};
 use crate::properties::longhands::writing_mode::computed_value::T as SpecifiedWritingMode;
 use crate::values::computed::text::LineHeight as ComputedLineHeight;
 use crate::values::computed::text::TextEmphasisStyle as ComputedTextEmphasisStyle;
 use crate::values::computed::text::TextOverflow as ComputedTextOverflow;
 use crate::values::computed::{Context, ToComputedValue};
 use crate::values::generics::text::InitialLetter as GenericInitialLetter;
 use crate::values::generics::text::LineHeight as GenericLineHeight;
-use crate::values::generics::text::{Spacing, GenericTextDecorationLength};
+use crate::values::generics::text::{GenericTextDecorationLength, Spacing};
 use crate::values::specified::length::NonNegativeLengthPercentage;
 use crate::values::specified::length::{FontRelativeLength, Length};
 use crate::values::specified::length::{LengthPercentage, NoCalcLength};
 use crate::values::specified::{AllowQuirks, Integer, NonNegativeNumber, Number};
 use cssparser::{Parser, Token};
 use selectors::parser::SelectorParseErrorKind;
 use std::fmt::{self, Write};
 use style_traits::values::SequenceWriter;
@@ -1048,11 +1048,11 @@ impl TextDecorationLength {
     #[inline]
     pub fn auto() -> Self {
         GenericTextDecorationLength::Auto
     }
 
     /// Whether this is the `Auto` value.
     #[inline]
     pub fn is_auto(&self) -> bool {
-        matches!(*self,  GenericTextDecorationLength::Auto)
+        matches!(*self, GenericTextDecorationLength::Auto)
     }
 }