servo: Merge #18179 - Automatically verify that derive() lists are alphabetically ordered #… (from davidcl:master); r=jdm
authorClément DAVID <c.david86@gmail.com>
Wed, 23 Aug 2017 17:18:31 -0500
changeset 376525 809640e1d6115fbecdea719f03a586d0062aa896
parent 376524 32d2d9a521d285a3eaa75470b959818458d17885
child 376526 f6f4c5e1b725e1e758a6cc1f69aca52d463be302
push id94111
push userarchaeopteryx@coole-files.de
push dateThu, 24 Aug 2017 11:31:42 +0000
treeherdermozilla-inbound@d6cb21ad4634 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs18179, 18172
milestone57.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 #18179 - Automatically verify that derive() lists are alphabetically ordered #… (from davidcl:master); r=jdm <!-- Please describe your changes on the following line: --> Automatically verify that derive() lists are alphabetically ordered #18172 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18172 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 474369618965569407d127b1e8c481e757cc59d3
servo/components/canvas_traits/canvas.rs
servo/components/compositing/compositor.rs
servo/components/compositing/windowing.rs
servo/components/config/prefs.rs
servo/components/devtools_traits/lib.rs
servo/components/gfx/display_list/mod.rs
servo/components/gfx/font.rs
servo/components/gfx/font_cache_thread.rs
servo/components/gfx/font_template.rs
servo/components/gfx/platform/freetype/font_template.rs
servo/components/gfx/platform/macos/font_template.rs
servo/components/gfx/platform/windows/font_template.rs
servo/components/gfx/text/glyph.rs
servo/components/gfx/text/util.rs
servo/components/gfx_traits/lib.rs
servo/components/layout/block.rs
servo/components/layout/display_list_builder.rs
servo/components/layout/floats.rs
servo/components/layout/flow.rs
servo/components/layout/flow_ref.rs
servo/components/layout/fragment.rs
servo/components/layout/inline.rs
servo/components/layout/model.rs
servo/components/layout/table.rs
servo/components/layout/table_cell.rs
servo/components/layout/table_row.rs
servo/components/layout/table_wrapper.rs
servo/components/layout/text.rs
servo/components/layout/traversal.rs
servo/components/layout_thread/dom_wrapper.rs
servo/components/msg/constellation_msg.rs
servo/components/net/fetch/methods.rs
servo/components/net_traits/blob_url_store.rs
servo/components/net_traits/image/base.rs
servo/components/net_traits/image_cache.rs
servo/components/net_traits/lib.rs
servo/components/net_traits/pub_domains.rs
servo/components/net_traits/request.rs
servo/components/net_traits/response.rs
servo/components/net_traits/storage_thread.rs
servo/components/profile_traits/time.rs
servo/components/range/lib.rs
servo/components/remutex/lib.rs
servo/components/script/body.rs
servo/components/script/build.rs
servo/components/script/document_loader.rs
servo/components/script/dom/abstractworker.rs
servo/components/script/dom/abstractworkerglobalscope.rs
servo/components/script/dom/bindings/callback.rs
servo/components/script/dom/bindings/conversions.rs
servo/components/script/dom/bindings/error.rs
servo/components/script/dom/bindings/interface.rs
servo/components/script/dom/bindings/iterable.rs
servo/components/script/dom/bindings/namespace.rs
servo/components/script/dom/bindings/num.rs
servo/components/script/dom/bindings/settings_stack.rs
servo/components/script/dom/bindings/str.rs
servo/components/script/dom/bindings/utils.rs
servo/components/script/dom/canvasgradient.rs
servo/components/script/dom/canvasrenderingcontext2d.rs
servo/components/script/dom/cssstyledeclaration.rs
servo/components/script/dom/customelementregistry.rs
servo/components/script/dom/document.rs
servo/components/script/dom/domexception.rs
servo/components/script/dom/element.rs
servo/components/script/dom/event.rs
servo/components/script/dom/eventsource.rs
servo/components/script/dom/eventtarget.rs
servo/components/script/dom/filereader.rs
servo/components/script/dom/headers.rs
servo/components/script/dom/htmlbuttonelement.rs
servo/components/script/dom/htmlcanvaselement.rs
servo/components/script/dom/htmlcollection.rs
servo/components/script/dom/htmldatalistelement.rs
servo/components/script/dom/htmlfieldsetelement.rs
servo/components/script/dom/htmlformelement.rs
servo/components/script/dom/htmlheadingelement.rs
servo/components/script/dom/htmliframeelement.rs
servo/components/script/dom/htmlimageelement.rs
servo/components/script/dom/htmlinputelement.rs
servo/components/script/dom/htmllinkelement.rs
servo/components/script/dom/htmlmediaelement.rs
servo/components/script/dom/htmlselectelement.rs
servo/components/script/dom/htmltableelement.rs
servo/components/script/dom/node.rs
servo/components/script/dom/nodelist.rs
servo/components/script/dom/paintworkletglobalscope.rs
servo/components/script/dom/serviceworkerglobalscope.rs
servo/components/script/dom/servoparser/async_html.rs
servo/components/script/dom/servoparser/mod.rs
servo/components/script/dom/testbinding.rs
servo/components/script/dom/validitystate.rs
servo/components/script/dom/vrdisplay.rs
servo/components/script/dom/webgl_extensions/extensions.rs
servo/components/script/dom/webgl_extensions/wrapper.rs
servo/components/script/dom/webgl_validations/types.rs
servo/components/script/dom/webglframebuffer.rs
servo/components/script/dom/webglshader.rs
servo/components/script/dom/webgltexture.rs
servo/components/script/dom/websocket.rs
servo/components/script/dom/window.rs
servo/components/script/dom/worklet.rs
servo/components/script/dom/xmlhttprequest.rs
servo/components/script/microtask.rs
servo/components/script/serviceworkerjob.rs
servo/components/script/task_source/dom_manipulation.rs
servo/components/script/task_source/performance_timeline.rs
servo/components/script/task_source/user_interaction.rs
servo/components/script/textinput.rs
servo/components/script/timers.rs
servo/components/script_layout_interface/lib.rs
servo/components/script_layout_interface/reporter.rs
servo/components/script_layout_interface/wrapper_traits.rs
servo/components/script_traits/lib.rs
servo/components/script_traits/script_msg.rs
servo/components/selectors/attr.rs
servo/components/selectors/builder.rs
servo/components/selectors/context.rs
servo/components/selectors/gecko_like_types.rs
servo/components/selectors/matching.rs
servo/components/selectors/parser.rs
servo/components/servo_arc/lib.rs
servo/components/style/animation.rs
servo/components/style/applicable_declarations.rs
servo/components/style/context.rs
servo/components/style/counter_style/mod.rs
servo/components/style/custom_properties.rs
servo/components/style/dom.rs
servo/components/style/font_face.rs
servo/components/style/font_metrics.rs
servo/components/style/gecko/data.rs
servo/components/style/gecko/media_queries.rs
servo/components/style/gecko/pseudo_element_definition.mako.rs
servo/components/style/gecko/selector_parser.rs
servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
servo/components/style/gecko_string_cache/mod.rs
servo/components/style/gecko_string_cache/namespace.rs
servo/components/style/invalidation/element/invalidator.rs
servo/components/style/invalidation/media_queries.rs
servo/components/style/invalidation/stylesheets.rs
servo/components/style/logical_geometry.rs
servo/components/style/matching.rs
servo/components/style/media_queries.rs
servo/components/style/properties/declaration_block.rs
servo/components/style/properties/helpers.mako.rs
servo/components/style/properties/helpers/animated_properties.mako.rs
servo/components/style/properties/longhand/background.mako.rs
servo/components/style/properties/longhand/border.mako.rs
servo/components/style/properties/longhand/box.mako.rs
servo/components/style/properties/longhand/counters.mako.rs
servo/components/style/properties/longhand/font.mako.rs
servo/components/style/properties/longhand/inherited_box.mako.rs
servo/components/style/properties/longhand/inherited_svg.mako.rs
servo/components/style/properties/longhand/inherited_text.mako.rs
servo/components/style/properties/longhand/list.mako.rs
servo/components/style/properties/longhand/pointing.mako.rs
servo/components/style/properties/longhand/position.mako.rs
servo/components/style/properties/longhand/table.mako.rs
servo/components/style/properties/longhand/text.mako.rs
servo/components/style/properties/longhand/ui.mako.rs
servo/components/style/properties/properties.mako.rs
servo/components/style/rule_tree/mod.rs
servo/components/style/selector_parser.rs
servo/components/style/servo/media_queries.rs
servo/components/style/servo/selector_parser.rs
servo/components/style/servo/url.rs
servo/components/style/stylesheets/keyframes_rule.rs
servo/components/style/stylesheets/mod.rs
servo/components/style/stylesheets/origin.rs
servo/components/style/stylesheets/rule_parser.rs
servo/components/style/stylesheets/stylesheet.rs
servo/components/style/stylist.rs
servo/components/style/timer.rs
servo/components/style/traversal.rs
servo/components/style/values/computed/align.rs
servo/components/style/values/computed/length.rs
servo/components/style/values/computed/mod.rs
servo/components/style/values/computed/time.rs
servo/components/style/values/generics/grid.rs
servo/components/style/values/generics/svg.rs
servo/components/style/values/mod.rs
servo/components/style/values/specified/align.rs
servo/components/style/values/specified/calc.rs
servo/components/style/values/specified/color.rs
servo/components/style/values/specified/grid.rs
servo/components/style/values/specified/length.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/time.rs
servo/components/style_traits/lib.rs
servo/components/style_traits/values.rs
servo/components/style_traits/viewport.rs
servo/components/url/lib.rs
servo/components/url/origin.rs
servo/python/tidy/servo_tidy/tidy.py
servo/python/tidy/servo_tidy_tests/rust_tidy.rs
servo/python/tidy/servo_tidy_tests/test_tidy.py
servo/servo-tidy.toml
--- a/servo/components/canvas_traits/canvas.rs
+++ b/servo/components/canvas_traits/canvas.rs
@@ -76,23 +76,23 @@ pub enum FromLayoutMsg {
     SendData(IpcSender<CanvasImageData>),
 }
 
 #[derive(Clone, Deserialize, Serialize)]
 pub enum FromScriptMsg {
     SendPixels(IpcSender<Option<Vec<u8>>>),
 }
 
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct CanvasGradientStop {
     pub offset: f64,
     pub color: RGBA,
 }
 
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct LinearGradientStyle {
     pub x0: f64,
     pub y0: f64,
     pub x1: f64,
     pub y1: f64,
     pub stops: Vec<CanvasGradientStop>
 }
 
@@ -104,17 +104,17 @@ impl LinearGradientStyle {
             y0: y0,
             x1: x1,
             y1: y1,
             stops: stops,
         }
     }
 }
 
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct RadialGradientStyle {
     pub x0: f64,
     pub y0: f64,
     pub r0: f64,
     pub x1: f64,
     pub y1: f64,
     pub r1: f64,
     pub stops: Vec<CanvasGradientStop>
@@ -159,17 +159,17 @@ impl SurfaceStyle {
 #[derive(Clone, Deserialize, Serialize)]
 pub enum FillOrStrokeStyle {
     Color(RGBA),
     LinearGradient(LinearGradientStyle),
     RadialGradient(RadialGradientStyle),
     Surface(SurfaceStyle),
 }
 
-#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum LineCapStyle {
     Butt = 0,
     Round = 1,
     Square = 2,
 }
 
 impl FromStr for LineCapStyle {
     type Err = ();
@@ -179,17 +179,17 @@ impl FromStr for LineCapStyle {
             "butt" => Ok(LineCapStyle::Butt),
             "round" => Ok(LineCapStyle::Round),
             "square" => Ok(LineCapStyle::Square),
             _ => Err(()),
         }
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum LineJoinStyle {
     Round = 0,
     Bevel = 1,
     Miter = 2,
 }
 
 impl FromStr for LineJoinStyle {
     type Err = ();
@@ -199,17 +199,17 @@ impl FromStr for LineJoinStyle {
             "round" => Ok(LineJoinStyle::Round),
             "bevel" => Ok(LineJoinStyle::Bevel),
             "miter" => Ok(LineJoinStyle::Miter),
             _ => Err(()),
         }
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
 pub enum RepetitionStyle {
     Repeat,
     RepeatX,
     RepeatY,
     NoRepeat,
 }
 
 impl FromStr for RepetitionStyle {
@@ -221,17 +221,17 @@ impl FromStr for RepetitionStyle {
             "repeat-x" => Ok(RepetitionStyle::RepeatX),
             "repeat-y" => Ok(RepetitionStyle::RepeatY),
             "no-repeat" => Ok(RepetitionStyle::NoRepeat),
             _ => Err(()),
         }
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum CompositionStyle {
     SrcIn,
     SrcOut,
     SrcOver,
     SrcAtop,
     DestIn,
     DestOut,
     DestOver,
@@ -275,17 +275,17 @@ impl CompositionStyle {
             CompositionStyle::DestAtop => "destination-atop",
             CompositionStyle::Copy     => "copy",
             CompositionStyle::Lighter  => "lighter",
             CompositionStyle::Xor      => "xor",
         }
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum BlendingStyle {
     Multiply,
     Screen,
     Overlay,
     Darken,
     Lighten,
     ColorDodge,
     ColorBurn,
@@ -341,17 +341,17 @@ impl BlendingStyle {
             BlendingStyle::Hue        => "hue",
             BlendingStyle::Saturation => "saturation",
             BlendingStyle::Color      => "color",
             BlendingStyle::Luminosity => "luminosity",
         }
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum CompositionOrBlending {
     Composition(CompositionStyle),
     Blending(BlendingStyle),
 }
 
 impl Default for CompositionOrBlending {
     fn default() -> CompositionOrBlending {
         CompositionOrBlending::Composition(CompositionStyle::SrcOver)
--- a/servo/components/compositing/compositor.rs
+++ b/servo/components/compositing/compositor.rs
@@ -63,37 +63,37 @@ impl ConvertPipelineIdFromWebRender for 
             namespace_id: PipelineNamespaceId(self.0),
             index: PipelineIndex(self.1),
         }
     }
 }
 
 /// Holds the state when running reftests that determines when it is
 /// safe to save the output image.
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 enum ReadyState {
     Unknown,
     WaitingForConstellationReply,
     ReadyToSaveImage,
 }
 
-#[derive(PartialEq, Eq, Debug, Copy, Clone)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 struct FrameTreeId(u32);
 
 impl FrameTreeId {
     pub fn next(&mut self) {
         self.0 += 1;
     }
 }
 
 /// One pixel in layer coordinate space.
 ///
 /// This unit corresponds to a "pixel" in layer coordinate space, which after scaling and
 /// transformation becomes a device pixel.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 enum LayerPixel {}
 
 /// NB: Never block on the constellation, because sometimes the constellation blocks on us.
 pub struct IOCompositor<Window: WindowMethods> {
     /// The application window.
     window: Rc<Window>,
 
     /// The port on which we receive messages.
@@ -190,37 +190,37 @@ pub struct IOCompositor<Window: WindowMe
     /// Map of the pending paint metrics per layout thread.
     /// The layout thread for each specific pipeline expects the compositor to
     /// paint frames with specific given IDs (epoch). Once the compositor paints
     /// these frames, it records the paint time for each of them and sends the
     /// metric to the corresponding layout thread.
     pending_paint_metrics: HashMap<PipelineId, Epoch>,
 }
 
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 struct ScrollZoomEvent {
     /// Change the pinch zoom level by this factor
     magnification: f32,
     /// Scroll by this offset, or to Start or End
     scroll_location: ScrollLocation,
     /// Apply changes to the frame at this location
     cursor: TypedPoint2D<i32, DevicePixel>,
     /// The scroll event phase.
     phase: ScrollEventPhase,
     /// The number of OS events that have been coalesced together into this one event.
     event_count: u32,
 }
 
-#[derive(PartialEq, Debug)]
+#[derive(Debug, PartialEq)]
 enum CompositionRequest {
     NoCompositingNecessary,
     CompositeNow(CompositingReason),
 }
 
-#[derive(Clone, Copy, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 enum ShutdownState {
     NotShuttingDown,
     ShuttingDown,
     FinishedShuttingDown,
 }
 
 struct PipelineDetails {
     /// The pipeline associated with this PipelineDetails object.
@@ -242,17 +242,17 @@ impl PipelineDetails {
             pipeline: None,
             animations_running: false,
             animation_callbacks_running: false,
             visible: true,
         }
     }
 }
 
-#[derive(Clone, Copy, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 enum CompositeTarget {
     /// Normal composition to a window
     Window,
 
     /// Compose as normal, but also return a PNG of the composed output
     WindowAndPng,
 
     /// Compose to a PNG, write it to disk, and then exit the browser (used for reftests)
@@ -1652,17 +1652,17 @@ impl<Window: WindowMethods> IOCompositor
 
     pub fn pinch_zoom_level(&self) -> f32 {
         // TODO(gw): Access via WR.
         1.0
     }
 }
 
 /// Why we performed a composite. This is used for debugging.
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum CompositingReason {
     /// We hit the delayed composition timeout. (See `delayed_composition.rs`.)
     DelayedCompositeTimeout,
     /// The window has been scrolled and we're starting the first recomposite.
     Scroll,
     /// A scroll has continued and we need to recomposite again.
     ContinueScroll,
     /// We're performing the single composite in headless mode.
--- a/servo/components/compositing/windowing.rs
+++ b/servo/components/compositing/windowing.rs
@@ -110,17 +110,17 @@ impl Debug for WindowEvent {
             WindowEvent::NewBrowser(..) => write!(f, "NewBrowser"),
             WindowEvent::CloseBrowser(..) => write!(f, "CloseBrowser"),
             WindowEvent::SelectBrowser(..) => write!(f, "SelectBrowser"),
             WindowEvent::ToggleWebRenderDebug(..) => write!(f, "ToggleWebRenderDebug"),
         }
     }
 }
 
-#[derive(Debug, Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum AnimationState {
     Idle,
     Animating,
 }
 
 pub trait WindowMethods {
     /// Returns the rendering area size in hardware pixels.
     fn framebuffer_size(&self) -> DeviceUintSize;
--- a/servo/components/config/prefs.rs
+++ b/servo/components/config/prefs.rs
@@ -20,17 +20,17 @@ lazy_static! {
         let defaults = default_prefs();
         if let Ok(prefs) = read_prefs() {
             defaults.extend(prefs);
         }
         defaults
     };
 }
 
-#[derive(PartialEq, Clone, Debug, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
 pub enum PrefValue {
     Boolean(bool),
     String(String),
     Number(f64),
     Missing
 }
 
 impl PrefValue {
--- a/servo/components/devtools_traits/lib.rs
+++ b/servo/components/devtools_traits/lib.rs
@@ -35,17 +35,17 @@ use time::Tm;
 // Information would be attached to NewGlobal to be received and show in devtools.
 // Extend these fields if we need more information.
 #[derive(Debug, Deserialize, Serialize)]
 pub struct DevtoolsPageInfo {
     pub title: String,
     pub url: ServoUrl,
 }
 
-#[derive(Debug, Deserialize, HeapSizeOf, Serialize, Clone)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub struct CSSError {
     pub filename: String,
     pub line: u32,
     pub column: u32,
     pub msg: String
 }
 
 /// Messages to instruct the devtools server to update its known actors/state
@@ -139,17 +139,17 @@ pub struct StartedTimelineMarker {
 pub struct TimelineMarker {
     pub name: String,
     pub start_time: PreciseTime,
     pub start_stack: Option<Vec<()>>,
     pub end_time: PreciseTime,
     pub end_stack: Option<Vec<()>>,
 }
 
-#[derive(Debug, PartialEq, Eq, Hash, Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub enum TimelineMarkerType {
     Reflow,
     DOMEvent,
 }
 
 /// The properties of a DOM node as computed by layout.
 #[derive(Debug, Deserialize, Serialize)]
 pub struct ComputedNodeLayout {
@@ -218,26 +218,26 @@ pub enum DevtoolScriptControlMsg {
 }
 
 #[derive(Debug, Deserialize, Serialize)]
 pub struct Modification {
     pub attributeName: String,
     pub newValue: Option<String>,
 }
 
-#[derive(Debug, Clone, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
 pub enum LogLevel {
     Log,
     Debug,
     Info,
     Warn,
     Error,
 }
 
-#[derive(Debug, Clone, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
 pub struct ConsoleMessage {
     pub message: String,
     pub logLevel: LogLevel,
     pub filename: String,
     pub lineNumber: usize,
     pub columnNumber: usize,
 }
 
@@ -337,23 +337,23 @@ impl StartedTimelineMarker {
 }
 
 /// A replacement for `time::PreciseTime` that isn't opaque, so we can serialize it.
 ///
 /// The reason why this doesn't go upstream is that `time` is slated to be part of Rust's standard
 /// library, which definitely can't have any dependencies on `serde`. But `serde` can't implement
 /// `Deserialize` and `Serialize` itself, because `time::PreciseTime` is opaque! A Catch-22. So I'm
 /// duplicating the definition here.
-#[derive(Debug, Copy, Clone, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
 pub struct PreciseTime(u64);
 
 impl PreciseTime {
     pub fn now() -> PreciseTime {
         PreciseTime(time::precise_time_ns())
     }
 
     pub fn to(&self, later: PreciseTime) -> Duration {
         Duration::nanoseconds((later.0 - self.0) as i64)
     }
 }
 
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub struct WorkerId(pub u32);
--- a/servo/components/gfx/display_list/mod.rs
+++ b/servo/components/gfx/display_list/mod.rs
@@ -37,17 +37,17 @@ use webrender_api::{self, ClipAndScrollI
 use webrender_api::{MixBlendMode, ScrollPolicy, ScrollSensitivity, TransformStyle};
 
 pub use style::dom::OpaqueNode;
 
 /// The factor that we multiply the blur radius by in order to inflate the boundaries of display
 /// items that involve a blur. This ensures that the display item boundaries include all the ink.
 pub static BLUR_INFLATION_FACTOR: i32 = 3;
 
-#[derive(HeapSizeOf, Deserialize, Serialize)]
+#[derive(Deserialize, HeapSizeOf, Serialize)]
 pub struct DisplayList {
     pub list: Vec<DisplayItem>,
 }
 
 struct ScrollOffsetLookup<'a> {
     parents: &'a mut HashMap<ClipId, ClipId>,
     calculated_total_offsets: ScrollOffsetMap,
     raw_offsets: &'a ScrollOffsetMap,
@@ -396,17 +396,17 @@ pub enum DisplayListSection {
 
 #[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
 pub enum StackingContextType {
     Real,
     PseudoPositioned,
     PseudoFloat,
 }
 
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 /// Represents one CSS stacking context, which may or may not have a hardware layer.
 pub struct StackingContext {
     /// The ID of this StackingContext for uniquely identifying it.
     pub id: StackingContextId,
 
     /// The type of this StackingContext. Used for collecting and sorting.
     pub context_type: StackingContextType,
 
@@ -551,24 +551,24 @@ impl fmt::Debug for StackingContext {
         write!(f, "{} at {:?} with overflow {:?}: {:?}",
                type_string,
                self.bounds,
                self.overflow,
                self.id)
     }
 }
 
-#[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub enum ScrollRootType {
     ScrollFrame(ScrollSensitivity),
     Clip,
 }
 
 /// Defines a stacking context.
-#[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub struct ScrollRoot {
     /// The WebRender clip id of this scroll root based on the source of this clip
     /// and information about the fragment.
     pub id: ClipId,
 
     /// The unique ID of the parent of this ScrollRoot.
     pub parent_id: ClipId,
 
@@ -666,31 +666,31 @@ impl BaseDisplayItem {
             clip_and_scroll_info: pipeline_id.root_clip_and_scroll_info(),
         }
     }
 }
 
 /// A clipping region for a display item. Currently, this can describe rectangles, rounded
 /// rectangles (for `border-radius`), or arbitrary intersections of the two. Arbitrary transforms
 /// are not supported because those are handled by the higher-level `StackingContext` abstraction.
-#[derive(Clone, PartialEq, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub struct ClippingRegion {
     /// The main rectangular region. This does not include any corners.
     pub main: Rect<Au>,
     /// Any complex regions.
     ///
     /// TODO(pcwalton): Atomically reference count these? Not sure if it's worth the trouble.
     /// Measure and follow up.
     pub complex: Vec<ComplexClippingRegion>,
 }
 
 /// A complex clipping region. These don't as easily admit arbitrary intersection operations, so
 /// they're stored in a list over to the side. Currently a complex clipping region is just a
 /// rounded rectangle, but the CSS WGs will probably make us throw more stuff in here eventually.
-#[derive(Clone, PartialEq, Debug, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub struct ComplexClippingRegion {
     /// The boundaries of the rectangle.
     pub rect: Rect<Au>,
     /// Border radii of this rectangle.
     pub radii: BorderRadii<Au>,
 }
 
 impl ClippingRegion {
@@ -850,37 +850,37 @@ impl ComplexClippingRegion {
         interior.origin.x <= other.rect.origin.x && interior.origin.y <= other.rect.origin.y &&
             interior.max_x() >= other.rect.max_x() && interior.max_y() >= other.rect.max_y()
     }
 }
 
 /// Metadata attached to each display item. This is useful for performing auxiliary threads with
 /// the display list involving hit testing: finding the originating DOM node and determining the
 /// cursor to use when the element is hovered over.
-#[derive(Clone, Copy, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
 pub struct DisplayItemMetadata {
     /// The DOM node from which this display item originated.
     pub node: OpaqueNode,
     /// The value of the `cursor` property when the mouse hovers over this display item. If `None`,
     /// this display item is ineligible for pointer events (`pointer-events: none`).
     pub pointing: Option<Cursor>,
 }
 
 /// Paints a solid color.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct SolidColorDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// The color.
     pub color: ColorF,
 }
 
 /// Paints text.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct TextDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// The text run.
     #[ignore_heap_size_of = "Because it is non-owning"]
     pub text_run: Arc<TextRun>,
 
@@ -892,25 +892,25 @@ pub struct TextDisplayItem {
 
     /// The position of the start of the baseline of this text.
     pub baseline_origin: Point2D<Au>,
 
     /// The orientation of the text: upright or sideways left/right.
     pub orientation: TextOrientation,
 }
 
-#[derive(Clone, Eq, PartialEq, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
 pub enum TextOrientation {
     Upright,
     SidewaysLeft,
     SidewaysRight,
 }
 
 /// Paints an image.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct ImageDisplayItem {
     pub base: BaseDisplayItem,
 
     pub webrender_image: WebRenderImageInfo,
 
     #[ignore_heap_size_of = "Because it is non-owning"]
     pub image_data: Option<Arc<IpcSharedMemory>>,
 
@@ -923,17 +923,17 @@ pub struct ImageDisplayItem {
     /// is tiled.
     pub tile_spacing: Size2D<Au>,
 
     /// The algorithm we should use to stretch the image. See `image_rendering` in CSS-IMAGES-3 §
     /// 5.3.
     pub image_rendering: image_rendering::T,
 }
 /// Paints an iframe.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct IframeDisplayItem {
     pub base: BaseDisplayItem,
     pub iframe: PipelineId,
 }
 
 /// Paints a gradient.
 #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct Gradient {
@@ -980,32 +980,32 @@ pub struct RadialGradientDisplayItem {
     /// Fields common to all display item.
     pub base: BaseDisplayItem,
 
     /// Contains all gradient data.
     pub gradient: RadialGradient,
 }
 
 /// A normal border, supporting CSS border styles.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct NormalBorder {
     /// Border colors.
     pub color: SideOffsets2D<ColorF>,
 
     /// Border styles.
     pub style: SideOffsets2D<border_style::T>,
 
     /// Border radii.
     ///
     /// TODO(pcwalton): Elliptical radii.
     pub radius: BorderRadii<Au>,
 }
 
 /// A border that is made of image segments.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct ImageBorder {
     /// The image this border uses, border-image-source.
     pub image: WebRenderImageInfo,
 
     /// How to slice the image, as per border-image-slice.
     pub slice: SideOffsets2D<u32>,
 
     /// Outsets for the border, as per border-image-outset.
@@ -1017,61 +1017,61 @@ pub struct ImageBorder {
     /// How to repeat or stretch horizontal edges (border-image-repeat).
     pub repeat_horizontal: webrender_api::RepeatMode,
 
     /// How to repeat or stretch vertical edges (border-image-repeat).
     pub repeat_vertical: webrender_api::RepeatMode,
 }
 
 /// A border that is made of linear gradient
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct GradientBorder {
     /// The gradient info that this border uses, border-image-source.
     pub gradient: Gradient,
 
     /// Outsets for the border, as per border-image-outset.
     pub outset: SideOffsets2D<f32>,
 }
 
 /// A border that is made of radial gradient
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct RadialGradientBorder {
     /// The gradient info that this border uses, border-image-source.
     pub gradient: RadialGradient,
 
     /// Outsets for the border, as per border-image-outset.
     pub outset: SideOffsets2D<f32>,
 }
 
 /// Specifies the type of border
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub enum BorderDetails {
     Normal(NormalBorder),
     Image(ImageBorder),
     Gradient(GradientBorder),
     RadialGradient(RadialGradientBorder),
 }
 
 /// Paints a border.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct BorderDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// Border widths.
     pub border_widths: SideOffsets2D<Au>,
 
     /// Details for specific border type
     pub details: BorderDetails,
 }
 
 /// Information about the border radii.
 ///
 /// TODO(pcwalton): Elliptical radii.
-#[derive(Clone, PartialEq, Debug, Copy, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub struct BorderRadii<T> {
     pub top_left: Size2D<T>,
     pub top_right: Size2D<T>,
     pub bottom_right: Size2D<T>,
     pub bottom_left: Size2D<T>,
 }
 
 impl<T> Default for BorderRadii<T> where T: Default, T: Clone {
@@ -1123,30 +1123,30 @@ impl<T> BorderRadii<T> where T: PartialE
             top_right: Size2D::new(value.clone(), value.clone()),
             bottom_right: Size2D::new(value.clone(), value.clone()),
             bottom_left: Size2D::new(value.clone(), value.clone()),
         }
     }
 }
 
 /// Paints a line segment.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct LineDisplayItem {
     pub base: BaseDisplayItem,
 
     /// The line segment color.
     pub color: ColorF,
 
     /// The line segment style.
     #[ignore_heap_size_of = "enum type in webrender"]
     pub style: webrender_api::LineStyle,
 }
 
 /// Paints a box shadow per CSS-BACKGROUNDS.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct BoxShadowDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// The dimensions of the box that we're placing a shadow around.
     pub box_bounds: Rect<Au>,
 
     /// The offset of this shadow from the box.
@@ -1166,68 +1166,68 @@ pub struct BoxShadowDisplayItem {
     /// TODO(pcwalton): Elliptical radii; different radii for each corner.
     pub border_radius: Au,
 
     /// How we should clip the result.
     pub clip_mode: BoxShadowClipMode,
 }
 
 /// Defines a text shadow that affects all items until the paired PopTextShadow.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct PushTextShadowDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// The offset of this shadow from the text.
     pub offset: Vector2D<Au>,
 
     /// The color of this shadow.
     pub color: ColorF,
 
     /// The blur radius for this shadow.
     pub blur_radius: Au,
 }
 
 /// Defines a text shadow that affects all items until the next PopTextShadow.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct PopTextShadowDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 }
 
 /// Defines a stacking context.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct PushStackingContextItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     pub stacking_context: StackingContext,
 }
 
 /// Defines a stacking context.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct PopStackingContextItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     pub stacking_context_id: StackingContextId,
 }
 
 /// Starts a group of items inside a particular scroll root.
-#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct DefineClipItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// The scroll root that this item starts.
     pub scroll_root: ScrollRoot,
 }
 
 /// How a box shadow should be clipped.
-#[derive(Clone, Copy, Debug, PartialEq, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum BoxShadowClipMode {
     /// No special clipping should occur. This is used for (shadowed) text decorations.
     None,
     /// The area inside `box_bounds` should be clipped out. Corresponds to the normal CSS
     /// `box-shadow`.
     Outset,
     /// The area outside `box_bounds` should be clipped out. Corresponds to the `inset` flag on CSS
     /// `box-shadow`.
@@ -1378,17 +1378,17 @@ impl fmt::Debug for DisplayItem {
                 DisplayItem::DefineClip(_) => "".to_owned(),
             },
             self.bounds(),
             self.base().local_clip
         )
     }
 }
 
-#[derive(Copy, Clone, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
 pub struct WebRenderImageInfo {
     pub width: u32,
     pub height: u32,
     pub format: PixelFormat,
     pub key: Option<webrender_api::ImageKey>,
 }
 
 impl WebRenderImageInfo {
--- a/servo/components/gfx/font.rs
+++ b/servo/components/gfx/font.rs
@@ -149,31 +149,31 @@ bitflags! {
         #[doc = "Text direction is right-to-left."]
         const RTL_FLAG = 0x08,
         #[doc = "Set if word-break is set to keep-all."]
         const KEEP_ALL_FLAG = 0x10,
     }
 }
 
 /// Various options that control text shaping.
-#[derive(Clone, Eq, PartialEq, Hash, Copy, Debug)]
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
 pub struct ShapingOptions {
     /// Spacing to add between each letter. Corresponds to the CSS 2.1 `letter-spacing` property.
     /// NB: You will probably want to set the `IGNORE_LIGATURES_SHAPING_FLAG` if this is non-null.
     pub letter_spacing: Option<Au>,
     /// Spacing to add between each word. Corresponds to the CSS 2.1 `word-spacing` property.
     pub word_spacing: (Au, NotNaN<f32>),
     /// The Unicode script property of the characters in this run.
     pub script: Script,
     /// Various flags.
     pub flags: ShapingFlags,
 }
 
 /// An entry in the shape cache.
-#[derive(Clone, Eq, PartialEq, Hash, Debug)]
+#[derive(Clone, Debug, Eq, Hash, PartialEq)]
 struct ShapeCacheEntry {
     text: String,
     options: ShapingOptions,
 }
 
 impl Font {
     pub fn shape_text(&mut self, text: &str, options: &ShapingOptions) -> Arc<GlyphStore> {
         let this = self as *const Font;
--- a/servo/components/gfx/font_cache_thread.rs
+++ b/servo/components/gfx/font_cache_thread.rs
@@ -28,17 +28,17 @@ use style::font_face::{EffectiveSources,
 use style::properties::longhands::font_family::computed_value::{FontFamily, FamilyName};
 use webrender_api;
 
 /// A list of font templates that make up a given font family.
 struct FontTemplates {
     templates: Vec<FontTemplate>,
 }
 
-#[derive(Serialize, Deserialize, Debug)]
+#[derive(Debug, Deserialize, Serialize)]
 pub struct FontTemplateInfo {
     pub font_template: Arc<FontTemplateData>,
     pub font_key: Option<webrender_api::FontKey>,
 }
 
 impl FontTemplates {
     fn new() -> FontTemplates {
         FontTemplates {
@@ -97,27 +97,27 @@ impl FontTemplates {
 
         if let Ok(template) = FontTemplate::new(identifier, maybe_data) {
             self.templates.push(template);
         }
     }
 }
 
 /// Commands that the FontContext sends to the font cache thread.
-#[derive(Deserialize, Serialize, Debug)]
+#[derive(Debug, Deserialize, Serialize)]
 pub enum Command {
     GetFontTemplate(FontFamily, FontTemplateDescriptor, IpcSender<Reply>),
     GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender<Reply>),
     AddWebFont(LowercaseString, EffectiveSources, IpcSender<()>),
     AddDownloadedWebFont(LowercaseString, ServoUrl, Vec<u8>, IpcSender<()>),
     Exit(IpcSender<()>),
 }
 
 /// Reply messages sent from the font cache thread to the FontContext caller.
-#[derive(Deserialize, Serialize, Debug)]
+#[derive(Debug, Deserialize, Serialize)]
 pub enum Reply {
     GetFontTemplateReply(Option<FontTemplateInfo>),
 }
 
 /// The font cache thread itself. It maintains a list of reference counted
 /// font templates that are currently in use.
 struct FontCache {
     port: IpcReceiver<Command>,
@@ -391,17 +391,17 @@ impl FontCache {
         }
 
         panic!("Unable to find any fonts that match (do you have fallback fonts installed?)");
     }
 }
 
 /// The public interface to the font cache thread, used exclusively by
 /// the per-thread/thread FontContext structures.
-#[derive(Clone, Deserialize, Serialize, Debug)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
 pub struct FontCacheThread {
     chan: IpcSender<Command>,
 }
 
 impl FontCacheThread {
     pub fn new(core_resource_thread: CoreResourceThread,
                webrender_api: Option<webrender_api::RenderApi>) -> FontCacheThread {
         let (chan, port) = ipc::channel().unwrap();
@@ -473,17 +473,17 @@ impl FontCacheThread {
     pub fn exit(&self) {
         let (response_chan, response_port) = ipc::channel().unwrap();
         self.chan.send(Command::Exit(response_chan)).expect("Couldn't send FontCacheThread exit message");
         response_port.recv().expect("Couldn't receive FontCacheThread reply");
     }
 }
 
 
-#[derive(Clone, Eq, PartialEq, Hash, Debug, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
 pub struct LowercaseString {
     inner: String,
 }
 
 impl LowercaseString {
     pub fn new(s: &str) -> LowercaseString {
         LowercaseString {
             inner: s.to_lowercase(),
--- a/servo/components/gfx/font_template.rs
+++ b/servo/components/gfx/font_template.rs
@@ -12,17 +12,17 @@ use std::io::Error as IoError;
 use std::sync::{Arc, Weak};
 use std::u32;
 use style::computed_values::{font_stretch, font_weight};
 
 /// Describes how to select a font from a given family. This is very basic at the moment and needs
 /// to be expanded or refactored when we support more of the font styling parameters.
 ///
 /// NB: If you change this, you will need to update `style::properties::compute_font_hash()`.
-#[derive(Clone, Copy, Eq, Hash, Deserialize, Serialize, Debug)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Serialize)]
 pub struct FontTemplateDescriptor {
     pub weight: font_weight::T,
     pub stretch: font_stretch::T,
     pub italic: bool,
 }
 
 impl FontTemplateDescriptor {
     #[inline]
--- a/servo/components/gfx/platform/freetype/font_template.rs
+++ b/servo/components/gfx/platform/freetype/font_template.rs
@@ -6,17 +6,17 @@ use servo_atoms::Atom;
 use std::fs::File;
 use std::io::{Read, Error};
 use webrender_api::NativeFontHandle;
 
 /// Platform specific font representation for Linux.
 /// The identifier is an absolute path, and the bytes
 /// field is the loaded data that can be passed to
 /// freetype and azure directly.
-#[derive(Deserialize, Serialize, Debug)]
+#[derive(Debug, Deserialize, Serialize)]
 pub struct FontTemplateData {
     pub bytes: Vec<u8>,
     pub identifier: Atom,
 }
 
 impl FontTemplateData {
     pub fn new(identifier: Atom, font_data: Option<Vec<u8>>) -> Result<FontTemplateData, Error> {
         let bytes = match font_data {
--- a/servo/components/gfx/platform/macos/font_template.rs
+++ b/servo/components/gfx/platform/macos/font_template.rs
@@ -19,17 +19,17 @@ use std::io::{Read, Error as IoError};
 use std::ops::Deref;
 use std::sync::Mutex;
 use webrender_api::NativeFontHandle;
 
 /// Platform specific font representation for mac.
 /// The identifier is a PostScript font name. The
 /// CTFont object is cached here for use by the
 /// paint functions that create CGFont references.
-#[derive(Deserialize, Serialize, Debug)]
+#[derive(Debug, Deserialize, Serialize)]
 pub struct FontTemplateData {
     /// The `CTFont` object, if present. This is cached here so that we don't have to keep creating
     /// `CTFont` instances over and over. It can always be recreated from the `identifier` and/or
     /// `font_data` fields.
     ///
     /// When sending a `FontTemplateData` instance across processes, this will be cleared out on
     /// the other side, because `CTFont` instances cannot be sent across processes. This is
     /// harmless, however, because it can always be recreated.
--- a/servo/components/gfx/platform/windows/font_template.rs
+++ b/servo/components/gfx/platform/windows/font_template.rs
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use platform::windows::font_list::{descriptor_from_atom, font_from_atom};
 use servo_atoms::Atom;
 use std::io;
 use webrender_api::NativeFontHandle;
 
-#[derive(Deserialize, Serialize, Debug)]
+#[derive(Debug, Deserialize, Serialize)]
 pub struct FontTemplateData {
     pub bytes: Option<Vec<u8>>,
     pub identifier: Atom,
 }
 
 impl FontTemplateData {
     pub fn new(identifier: Atom,
                font_data: Option<Vec<u8>>) -> Result<FontTemplateData, io::Error> {
--- a/servo/components/gfx/text/glyph.rs
+++ b/servo/components/gfx/text/glyph.rs
@@ -16,17 +16,17 @@ pub use gfx_traits::ByteIndex;
 /// GlyphEntry is a port of Gecko's CompressedGlyph scheme for storing glyph data compactly.
 ///
 /// In the common case (reasonable glyph advances, no offsets from the font em-box, and one glyph
 /// per character), we pack glyph advance, glyph id, and some flags into a single u32.
 ///
 /// In the uncommon case (multiple glyphs per unicode character, large glyph index/advance, or
 /// glyph offsets), we pack the glyph count into GlyphEntry, and store the other glyph information
 /// in DetailedGlyphStore.
-#[derive(Clone, Debug, Copy, Deserialize, Serialize, PartialEq)]
+#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
 pub struct GlyphEntry {
     value: u32,
 }
 
 impl GlyphEntry {
     fn new(value: u32) -> GlyphEntry {
         GlyphEntry {
             value: value,
@@ -142,17 +142,17 @@ impl GlyphEntry {
     #[inline(always)]
     fn has_flag(&self, flag: u32) -> bool {
         (self.value & flag) != 0
     }
 }
 
 // Stores data for a detailed glyph, in the case that several glyphs
 // correspond to one character, or the glyph's data couldn't be packed.
-#[derive(Clone, Debug, Copy, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
 struct DetailedGlyph {
     id: GlyphId,
     // glyph's advance, in the text's direction (LTR or RTL)
     advance: Au,
     // glyph's offset from the font's em-box (from top-left)
     offset: Point2D<Au>,
 }
 
@@ -161,17 +161,17 @@ impl DetailedGlyph {
         DetailedGlyph {
             id: id,
             advance: advance,
             offset: offset,
         }
     }
 }
 
-#[derive(PartialEq, Clone, Eq, Debug, Copy, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
 struct DetailedGlyphRecord {
     // source string offset/GlyphEntry offset in the TextRun
     entry_offset: ByteIndex,
     // offset into the detailed glyphs buffer
     detail_offset: usize,
 }
 
 impl PartialOrd for DetailedGlyphRecord {
@@ -303,17 +303,17 @@ impl<'a> DetailedGlyphStore {
         mem::swap(&mut self.detail_lookup, &mut sorted_records);
 
         self.lookup_is_sorted = true;
     }
 }
 
 // This struct is used by GlyphStore clients to provide new glyph data.
 // It should be allocated on the stack and passed by reference to GlyphStore.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct GlyphData {
     id: GlyphId,
     advance: Au,
     offset: Point2D<Au>,
     cluster_start: bool,
     ligature_start: bool,
 }
 
@@ -334,17 +334,17 @@ impl GlyphData {
         }
     }
 }
 
 // This enum is a proxy that's provided to GlyphStore clients when iterating
 // through glyphs (either for a particular TextRun offset, or all glyphs).
 // Rather than eagerly assembling and copying glyph data, it only retrieves
 // values as they are needed from the GlyphStore, using provided offsets.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub enum GlyphInfo<'a> {
     Simple(&'a GlyphStore, ByteIndex),
     Detail(&'a GlyphStore, ByteIndex, u16),
 }
 
 impl<'a> GlyphInfo<'a> {
     pub fn id(self) -> GlyphId {
         match self {
--- a/servo/components/gfx/text/util.rs
+++ b/servo/components/gfx/text/util.rs
@@ -1,13 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#[derive(PartialEq, Eq, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum CompressionMode {
     CompressNone,
     CompressWhitespace,
     CompressWhitespaceNewline,
     DiscardNewline
 }
 
 // ported from Gecko's nsTextFrameUtils::TransformText.
--- a/servo/components/gfx_traits/lib.rs
+++ b/servo/components/gfx_traits/lib.rs
@@ -13,17 +13,17 @@ extern crate heapsize;
 #[macro_use] extern crate serde;
 
 pub mod print_tree;
 
 use range::RangeIndex;
 use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
 
 /// A newtype struct for denoting the age of messages; prevents race conditions.
-#[derive(PartialEq, Eq, Debug, Copy, Clone, PartialOrd, Ord, Deserialize, Serialize, Hash)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct Epoch(pub u32);
 
 impl Epoch {
     pub fn next(&mut self) {
         self.0 += 1;
     }
 }
 
@@ -57,17 +57,17 @@ int_range_index! {
     struct ByteIndex(isize)
 }
 
 /// The type of fragment that a stacking context represents.
 ///
 /// This can only ever grow to maximum 4 entries. That's because we cram the value of this enum
 /// into the lower 2 bits of the `StackingContextId`, which otherwise contains a 32-bit-aligned
 /// heap address.
-#[derive(Clone, Debug, PartialEq, Eq, Copy, Hash, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub enum FragmentType {
     /// A StackingContext for the fragment body itself.
     FragmentBody,
     /// A StackingContext created to contain ::before pseudo-element content.
     BeforePseudoContent,
     /// A StackingContext created to contain ::after pseudo-element content.
     AfterPseudoContent,
 }
--- a/servo/components/layout/block.rs
+++ b/servo/components/layout/block.rs
@@ -81,17 +81,17 @@ impl FloatedBlockInfo {
             containing_inline_size: Au(0),
             float_ceiling: Au(0),
             float_kind: float_kind,
         }
     }
 }
 
 /// The solutions for the block-size-and-margins constraint equation.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 struct BSizeConstraintSolution {
     block_start: Au,
     block_size: Au,
     margin_block_start: Au,
     margin_block_end: Au
 }
 
 impl BSizeConstraintSolution {
@@ -2191,17 +2191,17 @@ impl fmt::Debug for BlockFlow {
                "{:?}({:x}) {:?}",
                self.class(),
                self.base.debug_id(),
                self.base)
     }
 }
 
 /// The inputs for the inline-sizes-and-margins constraint equation.
-#[derive(Debug, Copy, Clone)]
+#[derive(Clone, Copy, Debug)]
 pub struct ISizeConstraintInput {
     pub computed_inline_size: MaybeAuto,
     pub inline_start_margin: MaybeAuto,
     pub inline_end_margin: MaybeAuto,
     pub inline_start: MaybeAuto,
     pub inline_end: MaybeAuto,
     pub text_align: text_align::T,
     pub available_inline_size: Au,
@@ -2224,17 +2224,17 @@ impl ISizeConstraintInput {
             inline_end: inline_end,
             text_align: text_align,
             available_inline_size: available_inline_size,
         }
     }
 }
 
 /// The solutions for the inline-size-and-margins constraint equation.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct ISizeConstraintSolution {
     pub inline_start: Au,
     pub inline_size: Au,
     pub margin_inline_start: Au,
     pub margin_inline_end: Au
 }
 
 impl ISizeConstraintSolution {
@@ -3081,14 +3081,14 @@ impl ISizeAndMarginsComputer for InlineF
         let fragment = block.fragment();
         ISizeConstraintSolution::new(fragment.border_box.size.inline,
                                      fragment.margin.inline_start,
                                      fragment.margin.inline_end)
     }
 }
 
 /// A stacking context, a pseudo-stacking context, or a non-stacking context.
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 pub enum BlockStackingContextType {
     NonstackingContext,
     PseudoStackingContext,
     StackingContext,
 }
--- a/servo/components/layout/display_list_builder.rs
+++ b/servo/components/layout/display_list_builder.rs
@@ -2910,17 +2910,17 @@ impl ComputedValuesCursorUtility for Com
             (pointer_events::T::none, _) => None,
             (pointer_events::T::auto, cursor::Keyword::Auto) => Some(default_cursor),
             (pointer_events::T::auto, cursor::Keyword::Cursor(cursor)) => Some(cursor),
         }
     }
 }
 
 // A helper data structure for gradients.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 struct StopRun {
     start_offset: f32,
     end_offset: f32,
     start_index: usize,
     stop_count: usize,
 }
 
 fn position_to_offset(position: LengthOrPercentage, total_length: Au) -> f32 {
@@ -2948,24 +2948,24 @@ pub trait ToGfxColor {
 
 impl ToGfxColor for RGBA {
     fn to_gfx_color(&self) -> ColorF {
         ColorF::new(self.red_f32(), self.green_f32(), self.blue_f32(), self.alpha_f32())
     }
 }
 
 /// Describes how to paint the borders.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub enum BorderPaintingMode<'a> {
     /// Paint borders separately (`border-collapse: separate`).
     Separate,
     /// Paint collapsed borders.
     Collapse(&'a CollapsedBordersForCell),
     /// Paint no borders.
     Hidden,
 }
 
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 pub enum StackingContextCreationMode {
     Normal,
     PseudoPositioned,
     PseudoFloat,
 }
--- a/servo/components/layout/floats.rs
+++ b/servo/components/layout/floats.rs
@@ -8,34 +8,34 @@ use flow::{self, CLEARS_LEFT, CLEARS_RIG
 use persistent_list::PersistentList;
 use std::cmp::{max, min};
 use std::fmt;
 use style::computed_values::float;
 use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
 use style::values::computed::LengthOrPercentageOrAuto;
 
 /// The kind of float: left or right.
-#[derive(Clone, Serialize, Debug, Copy)]
+#[derive(Clone, Copy, Debug, Serialize)]
 pub enum FloatKind {
     Left,
     Right
 }
 
 impl FloatKind {
     pub fn from_property(property: float::T) -> Option<FloatKind> {
         match property {
             float::T::none => None,
             float::T::left => Some(FloatKind::Left),
             float::T::right => Some(FloatKind::Right),
         }
     }
 }
 
 /// The kind of clearance: left, right, or both.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub enum ClearType {
     Left,
     Right,
     Both,
 }
 
 /// Information about a single float.
 #[derive(Clone, Copy)]
@@ -426,17 +426,17 @@ impl Floats {
 /// The speculated inline sizes of floats flowing through or around a flow (depending on whether
 /// the flow is a block formatting context). These speculations are always *upper bounds*; the
 /// actual inline sizes might be less. Note that this implies that a speculated value of zero is a
 /// guarantee that there will be no floats on that side.
 ///
 /// This is used for two purposes: (a) determining whether we can lay out blocks in parallel; (b)
 /// guessing the inline-sizes of block formatting contexts in an effort to lay them out in
 /// parallel.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct SpeculatedFloatPlacement {
     /// The estimated inline size (an upper bound) of the left floats flowing through this flow.
     pub left: Au,
     /// The estimated inline size (an upper bound) of the right floats flowing through this flow.
     pub right: Au,
 }
 
 impl fmt::Debug for SpeculatedFloatPlacement {
--- a/servo/components/layout/flow.rs
+++ b/servo/components/layout/flow.rs
@@ -554,17 +554,17 @@ pub trait MutableOwnedFlowUtils {
     ///         <span style="position: relative">
     ///             <span style="position: absolute; ..."></span>
     ///         </span>
     ///     </div>
     fn take_applicable_absolute_descendants(&mut self,
                                             absolute_descendants: &mut AbsoluteDescendants);
 }
 
-#[derive(Copy, Clone, Serialize, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq, Serialize)]
 pub enum FlowClass {
     Block,
     Inline,
     ListItem,
     TableWrapper,
     Table,
     TableColGroup,
     TableRowGroup,
@@ -766,17 +766,17 @@ impl<'a> Iterator for AbsoluteDescendant
         self.iter.next().map(|info| FlowRef::deref_mut(&mut info.flow))
     }
 }
 
 pub type AbsoluteDescendantOffsetIter<'a> = Zip<AbsoluteDescendantIter<'a>, IterMut<'a, Au>>;
 
 /// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
 /// confused with absolutely-positioned flows) that is computed during block-size assignment.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct EarlyAbsolutePositionInfo {
     /// The size of the containing block for relatively-positioned descendants.
     pub relative_containing_block_size: LogicalSize<Au>,
 
     /// The writing mode for `relative_containing_block_size`.
     pub relative_containing_block_mode: WritingMode,
 }
 
@@ -788,33 +788,33 @@ impl EarlyAbsolutePositionInfo {
             relative_containing_block_size: LogicalSize::zero(writing_mode),
             relative_containing_block_mode: writing_mode,
         }
     }
 }
 
 /// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
 /// confused with absolutely-positioned flows) that is computed during final position assignment.
-#[derive(Serialize, Copy, Clone)]
+#[derive(Clone, Copy, Serialize)]
 pub struct LateAbsolutePositionInfo {
     /// The position of the absolute containing block relative to the nearest ancestor stacking
     /// context. If the absolute containing block establishes the stacking context for this flow,
     /// and this flow is not itself absolutely-positioned, then this is (0, 0).
     pub stacking_relative_position_of_absolute_containing_block: Point2D<Au>,
 }
 
 impl LateAbsolutePositionInfo {
     pub fn new() -> LateAbsolutePositionInfo {
         LateAbsolutePositionInfo {
             stacking_relative_position_of_absolute_containing_block: Point2D::zero(),
         }
     }
 }
 
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct FragmentationContext {
     pub available_block_size: Au,
     pub this_fragment_is_empty: bool,
 }
 
 /// Data common to all flows.
 pub struct BaseFlow {
     pub restyle_damage: RestyleDamage,
@@ -1407,17 +1407,17 @@ impl ContainingBlockLink {
                 }
             }
         }
     }
 }
 
 /// A wrapper for the pointer address of a flow. These pointer addresses may only be compared for
 /// equality with other such pointer addresses, never dereferenced.
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub struct OpaqueFlow(pub usize);
 
 impl OpaqueFlow {
     #[allow(unsafe_code)]
     pub fn from_flow(flow: &Flow) -> OpaqueFlow {
         unsafe {
             let object = mem::transmute::<&Flow, raw::TraitObject>(flow);
             OpaqueFlow(object.data as usize)
--- a/servo/components/layout/flow_ref.rs
+++ b/servo/components/layout/flow_ref.rs
@@ -8,17 +8,17 @@
 //! be superfluous. This design is largely duplicating logic of Arc<T> and
 //! Weak<T>; please see comments there for details.
 
 
 use flow::Flow;
 use std::ops::Deref;
 use std::sync::{Arc, Weak};
 
-#[derive(Clone,Debug)]
+#[derive(Clone, Debug)]
 pub struct FlowRef(Arc<Flow>);
 
 impl Deref for FlowRef {
     type Target = Flow;
     fn deref(&self) -> &Flow {
         self.0.deref()
     }
 }
@@ -50,17 +50,17 @@ impl FlowRef {
     /// Use Arc::get_mut instead when possible (e.g. on an Arc that was just created).
     #[allow(unsafe_code)]
     pub fn deref_mut(this: &mut FlowRef) -> &mut Flow {
         let ptr: *const Flow = &*this.0;
         unsafe { &mut *(ptr as *mut Flow) }
     }
 }
 
-#[derive(Clone,Debug)]
+#[derive(Clone, Debug)]
 pub struct WeakFlowRef(Weak<Flow>);
 
 impl WeakFlowRef {
     pub fn upgrade(&self) -> Option<FlowRef> {
         self.0.upgrade().map(FlowRef)
     }
 }
 
--- a/servo/components/layout/fragment.rs
+++ b/servo/components/layout/fragment.rs
@@ -569,17 +569,17 @@ impl ScannedTextFragmentInfo {
 
     pub fn selected(&self) -> bool {
         self.flags.contains(SELECTED)
     }
 }
 
 /// Describes how to split a fragment. This is used during line breaking as part of the return
 /// value of `find_split_info_for_inline_size()`.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub struct SplitInfo {
     // TODO(bjz): this should only need to be a single character index, but both values are
     // currently needed for splitting in the `inline::try_append_*` functions.
     pub range: Range<ByteIndex>,
     pub inline_size: Au,
 }
 
 impl SplitInfo {
@@ -628,17 +628,17 @@ impl UnscannedTextFragmentInfo {
         UnscannedTextFragmentInfo {
             text: text.into_boxed_str(),
             selection: selection,
         }
     }
 }
 
 /// A fragment that represents a table column.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct TableColumnFragmentInfo {
     /// the number of columns a <col> element should span
     pub span: u32,
 }
 
 impl TableColumnFragmentInfo {
     /// Create the information specific to an table column fragment.
     pub fn new<N: ThreadSafeLayoutNode>(node: &N) -> TableColumnFragmentInfo {
@@ -3044,17 +3044,17 @@ pub trait FragmentBorderBoxIterator {
 
     /// Returns true if this fragment must be processed in-order. If this returns false,
     /// we skip the operation for this fragment, but continue processing siblings.
     fn should_process(&mut self, fragment: &Fragment) -> bool;
 }
 
 /// The coordinate system used in `stacking_relative_border_box()`. See the documentation of that
 /// method for details.
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 pub enum CoordinateSystem {
     /// The border box returned is relative to the fragment's parent stacking context.
     Parent,
     /// The border box returned is relative to the fragment's own stacking context, if applicable.
     Own,
 }
 
 pub struct InlineStyleIterator<'a> {
@@ -3089,17 +3089,17 @@ impl<'a> InlineStyleIterator<'a> {
         InlineStyleIterator {
             fragment: fragment,
             inline_style_index: 0,
             primary_style_yielded: false,
         }
     }
 }
 
-#[derive(Copy, Clone, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum WhitespaceStrippingResult {
     RetainFragment,
     FragmentContainedOnlyBidiControlCharacters,
     FragmentContainedOnlyWhitespace,
 }
 
 impl WhitespaceStrippingResult {
     fn from_unscanned_text_fragment_info(info: &UnscannedTextFragmentInfo)
@@ -3111,17 +3111,17 @@ impl WhitespaceStrippingResult {
         } else {
             WhitespaceStrippingResult::RetainFragment
         }
     }
 }
 
 /// The overflow area. We need two different notions of overflow: paint overflow and scrollable
 /// overflow.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct Overflow {
     pub scroll: Rect<Au>,
     pub paint: Rect<Au>,
 }
 
 impl Overflow {
     pub fn new() -> Overflow {
         Overflow {
@@ -3158,17 +3158,17 @@ bitflags! {
         /// Whether this fragment represents the generated text from a text-overflow clip.
         const IS_ELLIPSIS = 0b0000_0100,
     }
 }
 
 /// Specified distances from the margin edge of a block to its content in the inline direction.
 /// These are returned by `guess_inline_content_edge_offsets()` and are used in the float placement
 /// speculation logic.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct SpeculatedInlineContentEdgeOffsets {
     pub start: Au,
     pub end: Au,
 }
 
 #[cfg(not(debug_assertions))]
 #[derive(Clone)]
 struct DebugId;
--- a/servo/components/layout/inline.rs
+++ b/servo/components/layout/inline.rs
@@ -58,17 +58,17 @@ use unicode_bidi as bidi;
 /// serve as the starting point, but the current design doesn't make it
 /// hard to try out that alternative.
 ///
 /// Line fragments also contain some metadata used during line breaking. The
 /// green zone is the area that the line can expand to before it collides
 /// with a float or a horizontal wall of the containing block. The block-start
 /// inline-start corner of the green zone is the same as that of the line, but
 /// the green zone can be taller and wider than the line itself.
-#[derive(Serialize, Debug, Clone)]
+#[derive(Clone, Debug, Serialize)]
 pub struct Line {
     /// A range of line indices that describe line breaks.
     ///
     /// For example, consider the following HTML and rendered element with
     /// linebreaks:
     ///
     /// ~~~html
     /// <span>I <span>like truffles, <img></span> yes I do.</span>
@@ -818,17 +818,17 @@ impl LineBreaker {
 
     /// Returns true if the pending line is empty and false otherwise.
     fn pending_line_is_empty(&self) -> bool {
         self.pending_line.range.length() == FragmentIndex(0)
     }
 }
 
 /// Represents a list of inline fragments, including element ranges.
-#[derive(Serialize, Clone)]
+#[derive(Clone, Serialize)]
 pub struct InlineFragments {
     /// The fragments themselves.
     pub fragments: Vec<Fragment>,
 }
 
 impl InlineFragments {
     /// Creates an empty set of inline fragments.
     pub fn new() -> InlineFragments {
@@ -1859,23 +1859,23 @@ impl InlineMetrics {
     }
 
     /// Returns the sum of the space needed above and below the baseline.
     fn space_needed(&self) -> Au {
         self.space_above_baseline + self.space_below_baseline
     }
 }
 
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 enum LineFlushMode {
     No,
     Flush,
 }
 
-#[derive(Copy, Clone, Debug, Serialize)]
+#[derive(Clone, Copy, Debug, Serialize)]
 pub struct LineMetrics {
     pub space_above_baseline: Au,
     pub space_below_baseline: Au,
 }
 
 impl LineMetrics {
     pub fn new(space_above_baseline: Au, space_below_baseline: Au) -> LineMetrics {
         LineMetrics {
--- a/servo/components/layout/model.rs
+++ b/servo/components/layout/model.rs
@@ -13,17 +13,17 @@ use std::cmp::{max, min};
 use std::fmt;
 use style::computed_values::transform::ComputedMatrix;
 use style::logical_geometry::{LogicalMargin, WritingMode};
 use style::properties::ComputedValues;
 use style::values::computed::{BorderCornerRadius, LengthOrPercentageOrAuto};
 use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone};
 
 /// A collapsible margin. See CSS 2.1 § 8.3.1.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct AdjoiningMargins {
     /// The value of the greatest positive margin.
     pub most_positive: Au,
 
     /// The actual value (not the absolute value) of the negative margin with the largest absolute
     /// value. Since this is not the absolute value, this is always zero or negative.
     pub most_negative: Au,
 }
@@ -56,17 +56,17 @@ impl AdjoiningMargins {
     }
 
     pub fn collapse(&self) -> Au {
         self.most_positive + self.most_negative
     }
 }
 
 /// Represents the block-start and block-end margins of a flow with collapsible margins. See CSS 2.1 § 8.3.1.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub enum CollapsibleMargins {
     /// Margins may not collapse with this flow.
     None(Au, Au),
 
     /// Both the block-start and block-end margins (specified here in that order) may collapse, but the
     /// margins do not collapse through this flow.
     Collapse(AdjoiningMargins, AdjoiningMargins),
 
@@ -290,26 +290,26 @@ impl MarginCollapseInfo {
              CollapsibleMargins::CollapseThrough(block_end)) => {
                 self.margin_in.union(block_end);
                 Au(0)
             }
         }
     }
 }
 
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub enum MarginCollapseState {
     /// We are accumulating margin on the logical top of this flow.
     AccumulatingCollapsibleTopMargin,
     /// We are accumulating margin between two blocks.
     AccumulatingMarginIn,
 }
 
 /// Intrinsic inline-sizes, which consist of minimum and preferred.
-#[derive(Serialize, Copy, Clone)]
+#[derive(Clone, Copy, Serialize)]
 pub struct IntrinsicISizes {
     /// The *minimum inline-size* of the content.
     pub minimum_inline_size: Au,
     /// The *preferred inline-size* of the content.
     pub preferred_inline_size: Au,
 }
 
 impl fmt::Debug for IntrinsicISizes {
@@ -390,17 +390,17 @@ impl IntrinsicISizesContribution {
         self.content_intrinsic_sizes.minimum_inline_size =
             max(self.content_intrinsic_sizes.minimum_inline_size, sizes.minimum_inline_size);
         self.content_intrinsic_sizes.preferred_inline_size =
             max(self.content_intrinsic_sizes.preferred_inline_size, sizes.preferred_inline_size)
     }
 }
 
 /// Useful helper data type when computing values for blocks and positioned elements.
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum MaybeAuto {
     Auto,
     Specified(Au),
 }
 
 impl MaybeAuto {
     #[inline]
     pub fn from_style(length: LengthOrPercentageOrAuto, containing_length: Au)
--- a/servo/components/layout/table.rs
+++ b/servo/components/layout/table.rs
@@ -583,17 +583,17 @@ impl ISizeAndMarginsComputer for Interna
 /// specific width constraint. For instance, one cell might say that it wants to be 100 pixels wide
 /// in the inline direction and another cell might say that it wants to take up 20% of the inline-
 /// size of the table. Now because we bubble up these constraints during the bubble-inline-sizes
 /// phase of layout, we don't know yet how wide the table is ultimately going to be in the inline
 /// direction. As we need to pick the maximum width of all cells for a column (in this case, the
 /// maximum of 100 pixels and 20% of the table), the preceding constraint means that we must
 /// potentially store both a specified width *and* a specified percentage, so that the inline-size
 /// assignment phase of layout will know which one to pick.
-#[derive(Clone, Serialize, Debug, Copy)]
+#[derive(Clone, Copy, Debug, Serialize)]
 pub struct ColumnIntrinsicInlineSize {
     /// The preferred intrinsic inline size.
     pub preferred: Au,
     /// The largest specified size of this column as a length.
     pub minimum_length: Au,
     /// The largest specified size of this column as a percentage (`width` property).
     pub percentage: CSSFloat,
     /// Whether the column inline size is *constrained* per INTRINSIC § 4.1.
@@ -620,17 +620,17 @@ impl ColumnIntrinsicInlineSize {
         }
     }
 }
 
 /// The actual inline size for each column.
 ///
 /// TODO(pcwalton): There will probably be some `border-collapse`-related info in here too
 /// eventually.
-#[derive(Serialize, Clone, Copy, Debug)]
+#[derive(Clone, Copy, Debug, Serialize)]
 pub struct ColumnComputedInlineSize {
     /// The computed size of this inline column.
     pub size: Au,
 }
 
 pub trait VecExt<T> {
     fn push_or_set(&mut self, index: usize, value: T) -> &mut T;
     fn get_mut_or_push(&mut self, index: usize, zero: T) -> &mut T;
--- a/servo/components/layout/table_cell.rs
+++ b/servo/components/layout/table_cell.rs
@@ -300,17 +300,17 @@ impl Flow for TableCellFlow {
 }
 
 impl fmt::Debug for TableCellFlow {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "TableCellFlow: {:?}", self.block_flow)
     }
 }
 
-#[derive(Copy, Clone, Debug, Serialize)]
+#[derive(Clone, Copy, Debug, Serialize)]
 pub struct CollapsedBordersForCell {
     pub inline_start_border: CollapsedBorder,
     pub inline_end_border: CollapsedBorder,
     pub block_start_border: CollapsedBorder,
     pub block_end_border: CollapsedBorder,
     pub inline_start_width: Au,
     pub inline_end_width: Au,
     pub block_start_width: Au,
--- a/servo/components/layout/table_row.rs
+++ b/servo/components/layout/table_row.rs
@@ -68,17 +68,17 @@ pub struct TableRowFlow {
 
 impl Serialize for TableRowFlow {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         self.block_flow.serialize(serializer)
     }
 }
 
 /// Information about the column inline size and span for each cell.
-#[derive(Serialize, Copy, Clone)]
+#[derive(Clone, Copy, Serialize)]
 pub struct CellIntrinsicInlineSize {
     /// Inline sizes that this cell contributes to the column.
     pub column_size: ColumnIntrinsicInlineSize,
     /// The column span of this cell.
     pub column_span: u32,
     /// The row span of this cell.
     pub row_span: u32,
 }
@@ -566,17 +566,17 @@ impl CollapsedBorderSpacingForRow {
             inline: Vec::new(),
             block_start: Au(0),
             block_end: Au(0),
         }
     }
 }
 
 /// All aspects of a border that can collapse with adjacent borders. See CSS 2.1 § 17.6.2.1.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct CollapsedBorder {
     /// The style of the border.
     pub style: border_top_style::T,
     /// The width of the border.
     pub width: Au,
     /// The color of the border.
     pub color: Color,
     /// The type of item that this border comes from.
@@ -591,17 +591,17 @@ impl Serialize for CollapsedBorder {
 
 /// Where a border style comes from.
 ///
 /// The integer values here correspond to the border conflict resolution rules in CSS 2.1 §
 /// 17.6.2.1. Higher values override lower values.
 // FIXME(#8586): FromTableRow, FromTableRowGroup, FromTableColumn,
 // FromTableColumnGroup are unused
 #[allow(dead_code)]
-#[derive(Copy, Clone, Debug, PartialEq, Serialize)]
+#[derive(Clone, Copy, Debug, PartialEq, Serialize)]
 pub enum CollapsedBorderProvenance {
     FromPreviousTableCell = 6,
     FromNextTableCell = 5,
     FromTableRow = 4,
     FromTableRowGroup = 3,
     FromTableColumn = 2,
     FromTableColumnGroup = 1,
     FromTable = 0,
@@ -901,17 +901,17 @@ fn set_inline_position_of_child_flow(
         *inline_end_margin_edge += column_inline_size;
     } else {
         // Columns begin from the inline-start edge.
         kid_base.position.start.i = *inline_start_margin_edge;
         *inline_start_margin_edge += column_inline_size;
     }
 }
 
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct BorderCollapseInfoForChildTableCell<'a> {
     collapsed_borders_for_row: &'a CollapsedBordersForRow,
     collapsed_border_spacing_for_row: &'a CollapsedBorderSpacingForRow,
 }
 
 /// Performs border-collapse in the inline direction for all the cells' inside borders in the
 /// inline-direction cells and propagates the outside borders (the far left and right) up to the
 /// table row. This is done eagerly here so that at least the inline inside border collapse
--- a/servo/components/layout/table_wrapper.rs
+++ b/servo/components/layout/table_wrapper.rs
@@ -30,17 +30,17 @@ use std::ops::Add;
 use style::computed_values::{border_collapse, position, table_layout};
 use style::context::SharedStyleContext;
 use style::logical_geometry::{LogicalRect, LogicalSize};
 use style::properties::ComputedValues;
 use style::values::CSSFloat;
 use style::values::computed::LengthOrPercentageOrAuto;
 use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
 
-#[derive(Copy, Clone, Serialize, Debug)]
+#[derive(Clone, Copy, Debug, Serialize)]
 pub enum TableLayout {
     Fixed,
     Auto
 }
 
 /// A table wrapper flow based on a block formatting context.
 #[derive(Serialize)]
 pub struct TableWrapperFlow {
@@ -610,17 +610,17 @@ impl<'a> Add for &'a AutoLayoutCandidate
             minimum_specified_guess: self.minimum_specified_guess + other.minimum_specified_guess,
             preferred_guess: self.preferred_guess + other.preferred_guess,
         }
     }
 }
 
 /// The `CSSFloat` member specifies the weight of the smaller of the two guesses, on a scale from
 /// 0.0 to 1.0.
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 enum SelectedAutoLayoutCandidateGuess {
     UseMinimumGuess,
     InterpolateBetweenMinimumGuessAndMinimumPercentageGuess(CSSFloat),
     InterpolateBetweenMinimumPercentageGuessAndMinimumSpecifiedGuess(CSSFloat),
     InterpolateBetweenMinimumSpecifiedGuessAndPreferredGuess(CSSFloat),
     UsePreferredGuessAndDistributeExcessInlineSize,
 }
 
--- a/servo/components/layout/text.rs
+++ b/servo/components/layout/text.rs
@@ -557,17 +557,17 @@ impl RunInfo {
             }
         }
         list.push(self);
     }
 }
 
 /// A mapping from a portion of an unscanned text fragment to the text run we're going to create
 /// for it.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 struct RunMapping {
     /// The range of byte indices within the text fragment.
     byte_range: Range<usize>,
     /// The index of the unscanned text fragment that this mapping corresponds to.
     old_fragment_index: usize,
     /// The index of the text run we're going to create.
     text_run_index: usize,
     /// Is the text in this fragment selected?
--- a/servo/components/layout/traversal.rs
+++ b/servo/components/layout/traversal.rs
@@ -238,17 +238,17 @@ impl<'a> PostorderFlowTraversal for Bubb
 
     #[inline]
     fn should_process(&self, flow: &mut Flow) -> bool {
         flow::base(flow).restyle_damage.contains(BUBBLE_ISIZES)
     }
 }
 
 /// The assign-inline-sizes traversal. In Gecko this corresponds to `Reflow`.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct AssignISizes<'a> {
     pub layout_context: &'a LayoutContext<'a>,
 }
 
 impl<'a> PreorderFlowTraversal for AssignISizes<'a> {
     #[inline]
     fn process(&self, flow: &mut Flow) {
         flow.assign_inline_sizes(self.layout_context);
@@ -258,17 +258,17 @@ impl<'a> PreorderFlowTraversal for Assig
     fn should_process(&self, flow: &mut Flow) -> bool {
         flow::base(flow).restyle_damage.intersects(REFLOW_OUT_OF_FLOW | REFLOW)
     }
 }
 
 /// The assign-block-sizes-and-store-overflow traversal, the last (and most expensive) part of
 /// layout computation. Determines the final block-sizes for all layout objects and computes
 /// positions. In Gecko this corresponds to `Reflow`.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct AssignBSizes<'a> {
     pub layout_context: &'a LayoutContext<'a>,
 }
 
 impl<'a> PostorderFlowTraversal for AssignBSizes<'a> {
     #[inline]
     fn process(&self, flow: &mut Flow) {
         // Can't do anything with anything that floats might flow through until we reach their
--- a/servo/components/layout_thread/dom_wrapper.rs
+++ b/servo/components/layout_thread/dom_wrapper.rs
@@ -80,17 +80,17 @@ use style::shared_lock::{SharedRwLock as
 use style::str::is_whitespace;
 
 pub unsafe fn drop_style_and_layout_data(data: OpaqueStyleAndLayoutData) {
     let ptr: *mut StyleData = data.ptr.get();
     let non_opaque: *mut StyleAndLayoutData = ptr as *mut _;
     let _ = Box::from_raw(non_opaque);
 }
 
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct ServoLayoutNode<'a> {
     /// The wrapped node.
     node: LayoutJS<Node>,
 
     /// Being chained to a PhantomData prevents `LayoutNode`s from escaping.
     chain: PhantomData<&'a ()>,
 }
 
@@ -324,17 +324,17 @@ impl<'ln> ServoLayoutNode<'ln> {
     /// Returns the interior of this node as a `LayoutJS`. This is highly unsafe for layout to
     /// call and as such is marked `unsafe`.
     pub unsafe fn get_jsmanaged(&self) -> &LayoutJS<Node> {
         &self.node
     }
 }
 
 // A wrapper around documents that ensures ayout can only ever access safe properties.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct ServoLayoutDocument<'ld> {
     document: LayoutJS<Document>,
     chain: PhantomData<&'ld ()>,
 }
 
 impl<'ld> ServoLayoutDocument<'ld> {
     fn as_node(&self) -> ServoLayoutNode<'ld> {
         ServoLayoutNode::from_layout_js(self.document.upcast())
@@ -369,17 +369,17 @@ impl<'ld> ServoLayoutDocument<'ld> {
         ServoLayoutDocument {
             document: doc,
             chain: PhantomData,
         }
     }
 }
 
 /// A wrapper around elements that ensures layout can only ever access safe properties.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct ServoLayoutElement<'le> {
     element: LayoutJS<Element>,
     chain: PhantomData<&'le ()>,
 }
 
 impl<'le> fmt::Debug for ServoLayoutElement<'le> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "<{}", self.element.local_name())?;
@@ -805,17 +805,17 @@ impl<'le> ::selectors::Element for Servo
 
     fn is_html_element_in_html_document(&self) -> bool {
         unsafe {
             self.element.html_element_in_html_document_for_layout()
         }
     }
 }
 
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct ServoThreadSafeLayoutNode<'ln> {
     /// The wrapped node.
     node: ServoLayoutNode<'ln>,
 
     /// The pseudo-element type, with (optionally)
     /// a specified display value to override the stylesheet.
     pseudo: PseudoElementType<Option<display::T>>,
 }
@@ -1098,17 +1098,17 @@ impl<ConcreteNode> Iterator for ThreadSa
             }
 
         }
     }
 }
 
 /// A wrapper around elements that ensures layout can only
 /// ever access safe properties and cannot race on elements.
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct ServoThreadSafeLayoutElement<'le> {
     element: ServoLayoutElement<'le>,
 
     /// The pseudo-element type, with (optionally)
     /// a specified display value to override the stylesheet.
     pseudo: PseudoElementType<Option<display::T>>,
 }
 
--- a/servo/components/msg/constellation_msg.rs
+++ b/servo/components/msg/constellation_msg.rs
@@ -4,25 +4,25 @@
 
 //! The high-level interface from script to constellation. Using this abstract interface helps
 //! reduce coupling between these two components.
 
 use std::cell::Cell;
 use std::fmt;
 use webrender_api;
 
-#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
 pub enum KeyState {
     Pressed,
     Released,
     Repeated,
 }
 
 //N.B. Based on the glutin key enum
-#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
 pub enum Key {
     Space,
     Apostrophe,
     Comma,
     Minus,
     Period,
     Slash,
     Num0,
@@ -151,17 +151,17 @@ bitflags! {
         const NONE = 0x00,
         const SHIFT = 0x01,
         const CONTROL = 0x02,
         const ALT = 0x04,
         const SUPER = 0x08,
     }
 }
 
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
 pub enum TraversalDirection {
     Forward(usize),
     Back(usize),
 }
 
 /// Each pipeline ID needs to be unique. However, it also needs to be possible to
 /// generate the pipeline ID from an iframe element (this simplifies a lot of other
 /// code that makes use of pipeline IDs).
@@ -212,23 +212,23 @@ impl PipelineNamespace {
             namespace_id: self.id,
             index: BrowsingContextIndex(self.next_index()),
         }
     }
 }
 
 thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = Cell::new(None));
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct PipelineNamespaceId(pub u32);
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct PipelineIndex(pub u32);
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct PipelineId {
     pub namespace_id: PipelineNamespaceId,
     pub index: PipelineIndex
 }
 
 impl PipelineId {
     pub fn new() -> PipelineId {
         PIPELINE_NAMESPACE.with(|tls| {
@@ -257,20 +257,20 @@ impl PipelineId {
 impl fmt::Display for PipelineId {
     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
         let PipelineNamespaceId(namespace_id) = self.namespace_id;
         let PipelineIndex(index) = self.index;
         write!(fmt, "({},{})", namespace_id, index)
     }
 }
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct BrowsingContextIndex(pub u32);
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct BrowsingContextId {
     pub namespace_id: PipelineNamespaceId,
     pub index: BrowsingContextIndex
 }
 
 impl BrowsingContextId {
     pub fn new() -> BrowsingContextId {
         PIPELINE_NAMESPACE.with(|tls| {
@@ -287,17 +287,17 @@ impl fmt::Display for BrowsingContextId 
         let PipelineNamespaceId(namespace_id) = self.namespace_id;
         let BrowsingContextIndex(index) = self.index;
         write!(fmt, "({},{})", namespace_id, index)
     }
 }
 
 thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrowsingContextId>> = Cell::new(None));
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct TopLevelBrowsingContextId(BrowsingContextId);
 
 impl TopLevelBrowsingContextId {
     pub fn new() -> TopLevelBrowsingContextId {
         TopLevelBrowsingContextId(BrowsingContextId::new())
     }
     /// Each script and layout thread should have the top-level browsing context id installed,
     /// since it is used by crash reporting.
@@ -337,14 +337,14 @@ impl PartialEq<BrowsingContextId> for To
 // We provide ids just for unit testing.
 pub const TEST_NAMESPACE: PipelineNamespaceId = PipelineNamespaceId(1234);
 pub const TEST_PIPELINE_INDEX: PipelineIndex = PipelineIndex(5678);
 pub const TEST_PIPELINE_ID: PipelineId = PipelineId { namespace_id: TEST_NAMESPACE, index: TEST_PIPELINE_INDEX };
 pub const TEST_BROWSING_CONTEXT_INDEX: BrowsingContextIndex = BrowsingContextIndex(8765);
 pub const TEST_BROWSING_CONTEXT_ID: BrowsingContextId =
     BrowsingContextId { namespace_id: TEST_NAMESPACE, index: TEST_BROWSING_CONTEXT_INDEX };
 
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub enum FrameType {
     IFrame,
     MozBrowserIFrame,
 }
 
--- a/servo/components/net/fetch/methods.rs
+++ b/servo/components/net/fetch/methods.rs
@@ -531,17 +531,17 @@ fn is_null_body_status(status: &Option<S
 /// https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-nosniff?
 pub fn should_be_blocked_due_to_nosniff(request_type: Type, response_headers: &Headers) -> bool {
     /// https://fetch.spec.whatwg.org/#x-content-type-options-header
     /// This is needed to parse `X-Content-Type-Options` according to spec,
     /// which requires that we inspect only the first value.
     ///
     /// A [unit-like struct](https://doc.rust-lang.org/book/structs.html#unit-like-structs)
     /// is sufficient since a valid header implies that we use `nosniff`.
-    #[derive(Debug, Clone, Copy)]
+    #[derive(Clone, Copy, Debug)]
     struct XContentTypeOptions;
 
     impl Header for XContentTypeOptions {
         fn header_name() -> &'static str {
             "X-Content-Type-Options"
         }
 
         /// https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-nosniff%3F #2
--- a/servo/components/net_traits/blob_url_store.rs
+++ b/servo/components/net_traits/blob_url_store.rs
@@ -4,30 +4,30 @@
 
 use filemanager_thread::FileOrigin;
 use servo_url::ServoUrl;
 use std::str::FromStr;
 use url::Url;
 use uuid::Uuid;
 
 /// Errors returned to Blob URL Store request
-#[derive(Clone, Debug, Serialize, Deserialize)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
 pub enum BlobURLStoreError {
     /// Invalid File UUID
     InvalidFileID,
     /// Invalid URL origin
     InvalidOrigin,
     /// Invalid entry content
     InvalidEntry,
     /// External error, from like file system, I/O etc.
     External(String),
 }
 
 /// Standalone blob buffer object
-#[derive(Clone, Debug, Serialize, Deserialize)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
 pub struct BlobBuf {
     pub filename: Option<String>,
     /// MIME type string
     pub type_string: String,
     /// Size of content in bytes
     pub size: u64,
     /// Content of blob
     pub bytes: Vec<u8>,
--- a/servo/components/net_traits/image/base.rs
+++ b/servo/components/net_traits/image/base.rs
@@ -2,29 +2,29 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use ipc_channel::ipc::IpcSharedMemory;
 use piston_image::{self, DynamicImage, ImageFormat};
 use std::fmt;
 use webrender_api;
 
-#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
 pub enum PixelFormat {
     /// Luminance channel only
     K8,
     /// Luminance + alpha
     KA8,
     /// RGB, 8 bits per channel
     RGB8,
     /// RGB + alpha, 8 bits per channel
     BGRA8,
 }
 
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct Image {
     pub width: u32,
     pub height: u32,
     pub format: PixelFormat,
     #[ignore_heap_size_of = "Defined in ipc-channel"]
     pub bytes: IpcSharedMemory,
     #[ignore_heap_size_of = "Defined in webrender_api"]
     pub id: Option<webrender_api::ImageKey>,
@@ -32,17 +32,17 @@ pub struct Image {
 
 impl fmt::Debug for Image {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "Image {{ width: {}, height: {}, format: {:?}, ..., id: {:?} }}",
                self.width, self.height, self.format, self.id)
     }
 }
 
-#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
 pub struct ImageMetadata {
     pub width: u32,
     pub height: u32,
 }
 
 // FIXME: Images must not be copied every frame. Instead we should atomically
 // reference count them.
 
--- a/servo/components/net_traits/image_cache.rs
+++ b/servo/components/net_traits/image_cache.rs
@@ -11,24 +11,24 @@ use webrender_api;
 
 // ======================================================================
 // Aux structs and enums.
 // ======================================================================
 
 /// Whether a consumer is in a position to request images or not. This can occur
 /// when animations are being processed by the layout thread while the script
 /// thread is executing in parallel.
-#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
 pub enum CanRequestImages {
     No,
     Yes,
 }
 
 /// Indicating either entire image or just metadata availability
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub enum ImageOrMetadataAvailable {
     ImageAvailable(Arc<Image>, ServoUrl),
     MetadataAvailable(ImageMetadata),
 }
 
 /// This is optionally passed to the image cache when requesting
 /// and image, and returned to the specified event loop when the
 /// image load completes. It is typically used to trigger a reflow
@@ -55,47 +55,47 @@ impl ImageResponder {
         let _ = self.sender.send(PendingImageResponse {
             response: response,
             id: self.id,
         });
     }
 }
 
 /// The returned image.
-#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub enum ImageResponse {
     /// The requested image was loaded.
     Loaded(Arc<Image>, ServoUrl),
     /// The request image metadata was loaded.
     MetadataLoaded(ImageMetadata),
     /// The requested image failed to load, so a placeholder was loaded instead.
     PlaceholderLoaded(Arc<Image>, ServoUrl),
     /// Neither the requested image nor the placeholder could be loaded.
     None,
 }
 
 /// The current state of an image in the cache.
-#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
 pub enum ImageState {
     Pending(PendingImageId),
     LoadError,
     NotRequested(PendingImageId),
 }
 
 /// The unique id for an image that has previously been requested.
-#[derive(Copy, Clone, PartialEq, Eq, Deserialize, Serialize, HeapSizeOf, Hash, Debug)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub struct PendingImageId(pub u64);
 
 #[derive(Debug, Deserialize, Serialize)]
 pub struct PendingImageResponse {
     pub response: ImageResponse,
     pub id: PendingImageId,
 }
 
-#[derive(Copy, Clone, PartialEq, Hash, Eq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, Eq, Hash, PartialEq, Serialize)]
 pub enum UsePlaceholder {
     No,
     Yes,
 }
 
 // ======================================================================
 // ImageCache public API.
 // ======================================================================
--- a/servo/components/net_traits/lib.rs
+++ b/servo/components/net_traits/lib.rs
@@ -57,30 +57,30 @@ pub mod storage_thread;
 /// However, image handling is generally very integrated with the network stack (especially where
 /// caching is involved) and as a result it must live in here.
 pub mod image {
     pub mod base;
 }
 
 /// A loading context, for context-specific sniffing, as defined in
 /// https://mimesniff.spec.whatwg.org/#context-specific-sniffing
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub enum LoadContext {
     Browsing,
     Image,
     AudioVideo,
     Plugin,
     Style,
     Script,
     Font,
     TextTrack,
     CacheManifest,
 }
 
-#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub struct CustomResponse {
     #[ignore_heap_size_of = "Defined in hyper"]
     #[serde(deserialize_with = "::hyper_serde::deserialize",
             serialize_with = "::hyper_serde::serialize")]
     pub headers: Headers,
     #[ignore_heap_size_of = "Defined in hyper"]
     #[serde(deserialize_with = "::hyper_serde::deserialize",
             serialize_with = "::hyper_serde::serialize")]
@@ -180,25 +180,25 @@ pub trait FetchTaskTarget {
     fn process_response_chunk(&mut self, chunk: Vec<u8>);
 
     /// https://fetch.spec.whatwg.org/#process-response-end-of-file
     ///
     /// Fired when the response is fully fetched
     fn process_response_eof(&mut self, response: &Response);
 }
 
-#[derive(Clone, Serialize, Deserialize)]
+#[derive(Clone, Deserialize, Serialize)]
 pub enum FilteredMetadata {
     Basic(Metadata),
     Cors(Metadata),
     Opaque,
     OpaqueRedirect
 }
 
-#[derive(Clone, Serialize, Deserialize)]
+#[derive(Clone, Deserialize, Serialize)]
 pub enum FetchMetadata {
     Unfiltered(Metadata),
     Filtered {
         filtered: FilteredMetadata,
         unsafe_: Metadata,
     },
 }
 
@@ -271,17 +271,17 @@ pub trait IpcSend<T>
     fn sender(&self) -> IpcSender<T>;
 }
 
 // FIXME: Originally we will construct an Arc<ResourceThread> from ResourceThread
 // in script_thread to avoid some performance pitfall. Now we decide to deal with
 // the "Arc" hack implicitly in future.
 // See discussion: http://logs.glob.uno/?c=mozilla%23servo&s=16+May+2016&e=16+May+2016#c430412
 // See also: https://github.com/servo/servo/blob/735480/components/script/script_thread.rs#L313
-#[derive(Clone, Serialize, Deserialize)]
+#[derive(Clone, Deserialize, Serialize)]
 pub struct ResourceThreads {
     core_thread: CoreResourceThread,
     storage_thread: IpcSender<StorageThreadMsg>,
 }
 
 impl ResourceThreads {
     pub fn new(c: CoreResourceThread, s: IpcSender<StorageThreadMsg>) -> ResourceThreads {
         ResourceThreads {
@@ -313,23 +313,23 @@ impl IpcSend<StorageThreadMsg> for Resou
 
 // Ignore the sub-fields
 impl HeapSizeOf for ResourceThreads {
     fn heap_size_of_children(&self) -> usize {
         0
     }
 }
 
-#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
 pub enum IncludeSubdomains {
     Included,
     NotIncluded,
 }
 
-#[derive(HeapSizeOf, Deserialize, Serialize)]
+#[derive(Deserialize, HeapSizeOf, Serialize)]
 pub enum MessageData {
     Text(String),
     Binary(Vec<u8>),
 }
 
 #[derive(Deserialize, Serialize)]
 pub enum WebSocketDomAction {
     SendMessage(MessageData),
@@ -392,26 +392,26 @@ pub fn fetch_async<F>(request: RequestIn
     where F: Fn(FetchResponseMsg) + Send + 'static,
 {
     let (action_sender, action_receiver) = ipc::channel().unwrap();
     ROUTER.add_route(action_receiver.to_opaque(),
                      box move |message| f(message.to().unwrap()));
     core_resource_thread.send(CoreResourceMsg::Fetch(request, action_sender)).unwrap();
 }
 
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct ResourceCorsData {
     /// CORS Preflight flag
     pub preflight: bool,
     /// Origin of CORS Request
     pub origin: ServoUrl,
 }
 
 /// Metadata about a loaded resource, such as is obtained from HTTP headers.
-#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct Metadata {
     /// Final URL after redirects.
     pub final_url: ServoUrl,
 
     /// Location URL from the response headers.
     pub location_url: Option<Result<ServoUrl, String>>,
 
     #[ignore_heap_size_of = "Defined in hyper"]
@@ -470,17 +470,17 @@ impl Metadata {
                     self.charset = Some(v.to_string());
                 }
             }
         }
     }
 }
 
 /// The creator of a given cookie
-#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
 pub enum CookieSource {
     /// An HTTP API
     HTTP,
     /// A non-HTTP API
     NonHTTP,
 }
 
 /// Convenience function for synchronously loading a whole resource.
@@ -506,21 +506,21 @@ pub fn load_whole_resource(request: Requ
             FetchResponseMsg::ProcessResponseEOF(Ok(())) => return Ok((metadata.unwrap(), buf)),
             FetchResponseMsg::ProcessResponse(Err(e)) |
             FetchResponseMsg::ProcessResponseEOF(Err(e)) => return Err(e),
         }
     }
 }
 
 /// An unique identifier to keep track of each load message in the resource handler
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub struct ResourceId(pub u32);
 
 /// Network errors that have to be exported out of the loaders
-#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
 pub enum NetworkError {
     /// Could be any of the internal errors, like unsupported scheme, connection errors, etc.
     Internal(String),
     LoadCancelled,
     /// SSL validation error that has to be handled in the HTML parser
     SslValidation(ServoUrl, String),
 }
 
--- a/servo/components/net_traits/pub_domains.rs
+++ b/servo/components/net_traits/pub_domains.rs
@@ -15,17 +15,17 @@
 //! those cases are not present.
 
 use servo_config::resource_files::read_resource_file;
 use servo_url::{Host, ImmutableOrigin, ServoUrl};
 use std::collections::HashSet;
 use std::iter::FromIterator;
 use std::str::from_utf8;
 
-#[derive(Clone,Debug)]
+#[derive(Clone, Debug)]
 pub struct PubDomainRules {
     rules: HashSet<String>,
     wildcards: HashSet<String>,
     exceptions: HashSet<String>,
 }
 
 lazy_static! {
     static ref PUB_DOMAINS: PubDomainRules = load_pub_domains();
--- a/servo/components/net_traits/request.rs
+++ b/servo/components/net_traits/request.rs
@@ -5,40 +5,40 @@
 use ReferrerPolicy;
 use hyper::header::Headers;
 use hyper::method::Method;
 use msg::constellation_msg::PipelineId;
 use servo_url::{ImmutableOrigin, ServoUrl};
 use std::default::Default;
 
 /// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator)
-#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum Initiator {
     None,
     Download,
     ImageSet,
     Manifest,
     XSLT,
 }
 
 /// A request [type](https://fetch.spec.whatwg.org/#concept-request-type)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum Type {
     None,
     Audio,
     Font,
     Image,
     Script,
     Style,
     Track,
     Video,
 }
 
 /// A request [destination](https://fetch.spec.whatwg.org/#concept-request-destination)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum Destination {
     None,
     Document,
     Embed,
     Font,
     Image,
     Manifest,
     Media,
@@ -48,99 +48,99 @@ pub enum Destination {
     ServiceWorker,
     SharedWorker,
     Style,
     Worker,
     XSLT,
 }
 
 /// A request [origin](https://fetch.spec.whatwg.org/#concept-request-origin)
-#[derive(Clone, PartialEq, Debug, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum Origin {
     Client,
     Origin(ImmutableOrigin),
 }
 
 /// A [referer](https://fetch.spec.whatwg.org/#concept-request-referrer)
-#[derive(Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum Referrer {
     NoReferrer,
     /// Default referrer if nothing is specified
     Client,
     ReferrerUrl(ServoUrl),
 }
 
 /// A [request mode](https://fetch.spec.whatwg.org/#concept-request-mode)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum RequestMode {
     Navigate,
     SameOrigin,
     NoCors,
     CorsMode,
     WebSocket
 }
 
 /// Request [credentials mode](https://fetch.spec.whatwg.org/#concept-request-credentials-mode)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum CredentialsMode {
     Omit,
     CredentialsSameOrigin,
     Include,
 }
 
 /// [Cache mode](https://fetch.spec.whatwg.org/#concept-request-cache-mode)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum CacheMode {
     Default,
     NoStore,
     Reload,
     NoCache,
     ForceCache,
     OnlyIfCached,
 }
 
 /// [Service-workers mode](https://fetch.spec.whatwg.org/#request-service-workers-mode)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum ServiceWorkersMode {
     All,
     Foreign,
     None,
 }
 
 /// [Redirect mode](https://fetch.spec.whatwg.org/#concept-request-redirect-mode)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum RedirectMode {
     Follow,
     Error,
     Manual,
 }
 
 /// [Response tainting](https://fetch.spec.whatwg.org/#concept-request-response-tainting)
-#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum ResponseTainting {
     Basic,
     CorsTainting,
     Opaque,
 }
 
 /// [Window](https://fetch.spec.whatwg.org/#concept-request-window)
-#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum Window {
     NoWindow,
     Client, // TODO: Environmental settings object
 }
 
 /// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous)
-#[derive(Copy, Clone, PartialEq, Serialize, Deserialize)]
+#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
 pub enum CorsSettings {
     Anonymous,
     UseCredentials,
 }
 
-#[derive(Serialize, Deserialize, Clone, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct RequestInit {
     #[serde(deserialize_with = "::hyper_serde::deserialize",
             serialize_with = "::hyper_serde::serialize")]
     #[ignore_heap_size_of = "Defined in hyper"]
     pub method: Method,
     pub url: ServoUrl,
     #[serde(deserialize_with = "::hyper_serde::deserialize",
             serialize_with = "::hyper_serde::serialize")]
--- a/servo/components/net_traits/response.rs
+++ b/servo/components/net_traits/response.rs
@@ -8,37 +8,37 @@ use {FetchMetadata, FilteredMetadata, Me
 use hyper::header::{AccessControlExposeHeaders, ContentType, Headers};
 use hyper::status::StatusCode;
 use hyper_serde::Serde;
 use servo_url::ServoUrl;
 use std::ascii::AsciiExt;
 use std::sync::{Arc, Mutex};
 
 /// [Response type](https://fetch.spec.whatwg.org/#concept-response-type)
-#[derive(Clone, PartialEq, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum ResponseType {
     Basic,
     Cors,
     Default,
     Error(NetworkError),
     Opaque,
     OpaqueRedirect,
 }
 
 /// [Response termination reason](https://fetch.spec.whatwg.org/#concept-response-termination-reason)
-#[derive(Debug, Clone, Copy, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub enum TerminationReason {
     EndUserAbort,
     Fatal,
     Timeout,
 }
 
 /// The response body can still be pushed to after fetch
 /// This provides a way to store unfinished response bodies
-#[derive(Clone, Debug, PartialEq, HeapSizeOf)]
+#[derive(Clone, Debug, HeapSizeOf, PartialEq)]
 pub enum ResponseBody {
     Empty, // XXXManishearth is this necessary, or is Done(vec![]) enough?
     Receiving(Vec<u8>),
     Done(Vec<u8>),
 }
 
 impl ResponseBody {
     pub fn is_done(&self) -> bool {
@@ -47,51 +47,51 @@ impl ResponseBody {
             ResponseBody::Empty |
             ResponseBody::Receiving(..) => false,
         }
     }
 }
 
 
 /// [Cache state](https://fetch.spec.whatwg.org/#concept-response-cache-state)
-#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub enum CacheState {
     None,
     Local,
     Validated,
     Partial,
 }
 
 /// [Https state](https://fetch.spec.whatwg.org/#concept-response-https-state)
-#[derive(Debug, Clone, Copy, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub enum HttpsState {
     None,
     Deprecated,
     Modern,
 }
 
 pub enum ResponseMsg {
     Chunk(Vec<u8>),
     Finished,
     Errored,
 }
 
-#[derive(Serialize, Deserialize, Clone, HeapSizeOf)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
 pub struct ResponseInit {
     pub url: ServoUrl,
     #[serde(deserialize_with = "::hyper_serde::deserialize",
             serialize_with = "::hyper_serde::serialize")]
     #[ignore_heap_size_of = "Defined in hyper"]
     pub headers: Headers,
     pub referrer: Option<ServoUrl>,
     pub location_url: Option<Result<ServoUrl, String>>,
 }
 
 /// A [Response](https://fetch.spec.whatwg.org/#concept-response) as defined by the Fetch spec
-#[derive(Debug, Clone, HeapSizeOf)]
+#[derive(Clone, Debug, HeapSizeOf)]
 pub struct Response {
     pub response_type: ResponseType,
     pub termination_reason: Option<TerminationReason>,
     url: Option<ServoUrl>,
     pub url_list: Vec<ServoUrl>,
     /// `None` can be considered a StatusCode of `0`.
     #[ignore_heap_size_of = "Defined in hyper"]
     pub status: Option<StatusCode>,
--- a/servo/components/net_traits/storage_thread.rs
+++ b/servo/components/net_traits/storage_thread.rs
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use ipc_channel::ipc::IpcSender;
 use servo_url::ServoUrl;
 
-#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
 pub enum StorageType {
     Session,
     Local,
 }
 
 /// Request operations on the storage data associated with a particular url
 #[derive(Deserialize, Serialize)]
 pub enum StorageThreadMsg {
--- a/servo/components/profile_traits/time.rs
+++ b/servo/components/profile_traits/time.rs
@@ -5,17 +5,17 @@
 extern crate time as std_time;
 
 use energy::read_energy_uj;
 use ipc_channel::ipc::IpcSender;
 use self::std_time::precise_time_ns;
 use servo_config::opts;
 use signpost;
 
-#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Debug, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
 pub struct TimerMetadata {
     pub url:         String,
     pub iframe:      TimerMetadataFrameType,
     pub incremental: TimerMetadataReflowType,
 }
 
 #[derive(Clone, Deserialize, Serialize)]
 pub struct ProfilerChan(pub IpcSender<ProfilerMsg>);
@@ -34,17 +34,17 @@ pub enum ProfilerMsg {
     Time((ProfilerCategory, Option<TimerMetadata>), (u64, u64), (u64, u64)),
     /// Message used to force print the profiling metrics
     Print,
     /// Tells the profiler to shut down.
     Exit(IpcSender<()>),
 }
 
 #[repr(u32)]
-#[derive(PartialEq, Clone, Copy, PartialOrd, Eq, Ord, Deserialize, Serialize, Debug, Hash)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
 pub enum ProfilerCategory {
     Compositing = 0x00,
     LayoutPerform = 0x10,
     LayoutStyleRecalc = 0x11,
     LayoutTextShaping = 0x12,
     LayoutRestyleDamagePropagation = 0x13,
     LayoutNonIncrementalReset = 0x14,
     LayoutSelectorMatch = 0x15,
@@ -90,23 +90,23 @@ pub enum ProfilerCategory {
     ScriptExitFullscreen = 0x78,
     ScriptWebVREvent = 0x79,
     ScriptWorkletEvent = 0x7a,
     TimeToFirstPaint = 0x80,
     TimeToFirstContentfulPaint = 0x81,
     ApplicationHeartbeat = 0x90,
 }
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
 pub enum TimerMetadataFrameType {
     RootWindow,
     IFrame,
 }
 
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
 pub enum TimerMetadataReflowType {
     Incremental,
     FirstReflow,
 }
 
 pub fn profile<T, F>(category: ProfilerCategory,
                      meta: Option<TimerMetadata>,
                      profiler_chan: ProfilerChan,
--- a/servo/components/range/lib.rs
+++ b/servo/components/range/lib.rs
@@ -73,17 +73,17 @@ impl RangeIndex for usize {
     #[inline]
     fn get(self) -> usize { self }
 }
 
 /// Implements a range index type with operator overloads
 #[macro_export]
 macro_rules! int_range_index {
     ($(#[$attr:meta])* struct $Self_:ident($T:ty)) => (
-        #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Copy)]
+        #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
         $(#[$attr])*
         pub struct $Self_(pub $T);
 
         impl $Self_ {
             #[inline]
             pub fn to_usize(self) -> usize {
                 self.get() as usize
             }
--- a/servo/components/remutex/lib.rs
+++ b/servo/components/remutex/lib.rs
@@ -21,17 +21,17 @@ use std::cell::{Cell, UnsafeCell};
 use std::ops::Deref;
 use std::sync::{LockResult, Mutex, MutexGuard, PoisonError, TryLockError, TryLockResult};
 use std::sync::atomic::{AtomicUsize, Ordering};
 
 /// A type for thread ids.
 
 // TODO: can we use the thread-id crate for this?
 
-#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
+#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
 pub struct ThreadId(NonZero<usize>);
 
 lazy_static!{ static ref THREAD_COUNT: AtomicUsize = AtomicUsize::new(1); }
 
 impl ThreadId {
     #[allow(unsafe_code)]
     fn new() -> ThreadId {
         let number = THREAD_COUNT.fetch_add(1, Ordering::SeqCst);
--- a/servo/components/script/body.rs
+++ b/servo/components/script/body.rs
@@ -17,17 +17,17 @@ use js::jsapi::JS_ParseJSON;
 use js::jsapi::Value as JSValue;
 use js::jsval::UndefinedValue;
 use mime::{Mime, TopLevel, SubLevel};
 use std::cell::Ref;
 use std::rc::Rc;
 use std::str;
 use url::form_urlencoded;
 
-#[derive(Copy, Clone, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
 pub enum BodyType {
     Blob,
     FormData,
     Json,
     Text
 }
 
 pub enum FetchedData {
--- a/servo/components/script/build.rs
+++ b/servo/components/script/build.rs
@@ -54,17 +54,17 @@ fn main() {
     }
     let phf = PathBuf::from(env::var("OUT_DIR").unwrap()).join("InterfaceObjectMapPhf.rs");
     let mut phf = File::create(&phf).unwrap();
     write!(&mut phf, "pub static MAP: phf::Map<&'static [u8], unsafe fn(*mut JSContext, HandleObject)> = ").unwrap();
     map.build(&mut phf).unwrap();
     write!(&mut phf, ";\n").unwrap();
 }
 
-#[derive(Eq, PartialEq, Hash)]
+#[derive(Eq, Hash, PartialEq)]
 struct Bytes<'a>(&'a str);
 
 impl<'a> fmt::Debug for Bytes<'a> {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         formatter.write_str("b\"")?;
         formatter.write_str(self.0)?;
         formatter.write_str("\" as &'static [u8]")
     }
--- a/servo/components/script/document_loader.rs
+++ b/servo/components/script/document_loader.rs
@@ -8,17 +8,17 @@
 use dom::bindings::js::JS;
 use dom::document::Document;
 use ipc_channel::ipc::IpcSender;
 use net_traits::{CoreResourceMsg, FetchResponseMsg, ResourceThreads, IpcSend};
 use net_traits::request::RequestInit;
 use servo_url::ServoUrl;
 use std::thread;
 
-#[derive(JSTraceable, PartialEq, Clone, Debug, HeapSizeOf)]
+#[derive(Clone, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum LoadType {
     Image(ServoUrl),
     Script(ServoUrl),
     Subframe(ServoUrl),
     Stylesheet(ServoUrl),
     PageSource(ServoUrl),
     Media(ServoUrl),
 }
@@ -34,17 +34,17 @@ impl LoadType {
             LoadType::PageSource(ref url) => url,
         }
     }
 }
 
 /// Canary value ensuring that manually added blocking loads (ie. ones that weren't
 /// created via DocumentLoader::fetch_async) are always removed by the time
 /// that the owner is destroyed.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 #[must_root]
 pub struct LoadBlocker {
     /// The document whose load event is blocked by this object existing.
     doc: JS<Document>,
     /// The load that is blocking the document's load event.
     load: Option<LoadType>,
 }
 
@@ -75,17 +75,17 @@ impl LoadBlocker {
 impl Drop for LoadBlocker {
     fn drop(&mut self) {
         if !thread::panicking() {
             debug_assert!(self.load.is_none());
         }
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct DocumentLoader {
     resource_threads: ResourceThreads,
     blocking_loads: Vec<LoadType>,
     events_inhibited: bool,
 }
 
 impl DocumentLoader {
     pub fn new(existing: &DocumentLoader) -> DocumentLoader {
--- a/servo/components/script/dom/abstractworker.rs
+++ b/servo/components/script/dom/abstractworker.rs
@@ -24,17 +24,17 @@ pub struct SimpleWorkerErrorHandler<T: D
 impl<T: DomObject> SimpleWorkerErrorHandler<T> {
     pub fn new(addr: Trusted<T>) -> SimpleWorkerErrorHandler<T> {
         SimpleWorkerErrorHandler {
             addr: addr
         }
     }
 }
 
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct SharedRt {
     rt: *mut JSRuntime
 }
 
 impl SharedRt {
     pub fn new(rt: &Runtime) -> SharedRt {
         SharedRt {
             rt: rt.rt()
--- a/servo/components/script/dom/abstractworkerglobalscope.rs
+++ b/servo/components/script/dom/abstractworkerglobalscope.rs
@@ -7,17 +7,17 @@ use dom::bindings::refcounted::Trusted;
 use dom::bindings::reflector::DomObject;
 use dom::bindings::trace::JSTraceable;
 use script_runtime::{ScriptChan, CommonScriptMsg, ScriptPort};
 use std::sync::mpsc::{Receiver, Sender};
 
 /// A ScriptChan that can be cloned freely and will silently send a TrustedWorkerAddress with
 /// common event loop messages. While this SendableWorkerScriptChan is alive, the associated
 /// Worker object will remain alive.
-#[derive(JSTraceable, Clone)]
+#[derive(Clone, JSTraceable)]
 pub struct SendableWorkerScriptChan<T: DomObject> {
     pub sender: Sender<(Trusted<T>, CommonScriptMsg)>,
     pub worker: Trusted<T>,
 }
 
 impl<T: JSTraceable + DomObject + 'static> ScriptChan for SendableWorkerScriptChan<T> {
     fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
         self.sender.send((self.worker.clone(), msg)).map_err(|_| ())
@@ -29,17 +29,17 @@ impl<T: JSTraceable + DomObject + 'stati
             worker: self.worker.clone(),
         }
     }
 }
 
 /// A ScriptChan that can be cloned freely and will silently send a TrustedWorkerAddress with
 /// worker event loop messages. While this SendableWorkerScriptChan is alive, the associated
 /// Worker object will remain alive.
-#[derive(JSTraceable, Clone)]
+#[derive(Clone, JSTraceable)]
 pub struct WorkerThreadWorkerChan<T: DomObject> {
     pub sender: Sender<(Trusted<T>, WorkerScriptMsg)>,
     pub worker: Trusted<T>,
 }
 
 impl<T: JSTraceable + DomObject + 'static> ScriptChan for WorkerThreadWorkerChan<T> {
     fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
         self.sender
--- a/servo/components/script/dom/bindings/callback.rs
+++ b/servo/components/script/dom/bindings/callback.rs
@@ -20,17 +20,17 @@ use js::rust::Runtime;
 use std::default::Default;
 use std::ffi::CString;
 use std::mem::drop;
 use std::ops::Deref;
 use std::ptr;
 use std::rc::Rc;
 
 /// The exception handling used for a call.
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 pub enum ExceptionHandling {
     /// Report any exception and don't throw it to the caller code.
     Report,
     /// Throw any exception to the caller code.
     Rethrow,
 }
 
 /// A common base class for representing IDL callback function and
--- a/servo/components/script/dom/bindings/conversions.rs
+++ b/servo/components/script/dom/bindings/conversions.rs
@@ -165,17 +165,17 @@ pub unsafe fn jsid_to_string(cx: *mut JS
 // http://heycam.github.io/webidl/#es-USVString
 impl ToJSValConvertible for USVString {
     unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {
         self.0.to_jsval(cx, rval);
     }
 }
 
 /// Behavior for stringification of `JSVal`s.
-#[derive(PartialEq, Clone)]
+#[derive(Clone, PartialEq)]
 pub enum StringificationBehavior {
     /// Convert `null` to the string `"null"`.
     Default,
     /// Convert `null` to the empty string.
     Empty,
 }
 
 // https://heycam.github.io/webidl/#es-DOMString
--- a/servo/components/script/dom/bindings/error.rs
+++ b/servo/components/script/dom/bindings/error.rs
@@ -20,17 +20,17 @@ use js::jsapi::JS_GetPendingException;
 use js::jsapi::JS_IsExceptionPending;
 use js::jsapi::JS_SetPendingException;
 use js::jsapi::MutableHandleValue;
 use js::jsval::UndefinedValue;
 use libc::c_uint;
 use std::slice::from_raw_parts;
 
 /// DOM exceptions that can be thrown by a native DOM method.
-#[derive(Debug, Clone, HeapSizeOf)]
+#[derive(Clone, Debug, HeapSizeOf)]
 pub enum Error {
     /// IndexSizeError DOMException
     IndexSize,
     /// NotFoundError DOMException
     NotFound,
     /// HierarchyRequestError DOMException
     HierarchyRequest,
     /// WrongDocumentError DOMException
--- a/servo/components/script/dom/bindings/interface.rs
+++ b/servo/components/script/dom/bindings/interface.rs
@@ -103,17 +103,17 @@ use js::jsapi::{MutableHandleValue, Obje
 use js::jsapi::{TrueHandleValue, Value};
 use js::jsval::{JSVal, PrivateValue};
 use js::rust::{define_methods, define_properties, get_object_class};
 use libc;
 use script_thread::ScriptThread;
 use std::ptr;
 
 /// The class of a non-callback interface object.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct NonCallbackInterfaceObjectClass {
     /// The SpiderMonkey Class structure.
     pub class: Class,
     /// The prototype id of that interface, used in the hasInstance hook.
     pub proto_id: PrototypeList::ID,
     /// The prototype depth of that interface, used in the hasInstance hook.
     pub proto_depth: u16,
     /// The string representation of the object.
--- a/servo/components/script/dom/bindings/iterable.rs
+++ b/servo/components/script/dom/bindings/iterable.rs
@@ -17,17 +17,17 @@ use dom::globalscope::GlobalScope;
 use dom_struct::dom_struct;
 use js::conversions::ToJSValConvertible;
 use js::jsapi::{HandleValue, Heap, JSContext, JSObject, MutableHandleObject};
 use js::jsval::UndefinedValue;
 use std::cell::Cell;
 use std::ptr;
 
 /// The values that an iterator will iterate over.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub enum IteratorType {
     /// The keys of the iterable object.
     Keys,
     /// The values of the iterable object.
     Values,
     /// The keys and values of the iterable object combined.
     Entries,
 }
--- a/servo/components/script/dom/bindings/namespace.rs
+++ b/servo/components/script/dom/bindings/namespace.rs
@@ -6,17 +6,17 @@
 
 use dom::bindings::guard::Guard;
 use dom::bindings::interface::{create_object, define_on_global_object};
 use js::jsapi::{HandleObject, JSClass, JSContext, JSFunctionSpec, MutableHandleObject};
 use libc;
 use std::ptr;
 
 /// The class of a namespace object.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct NamespaceObjectClass(JSClass);
 
 unsafe impl Sync for NamespaceObjectClass {}
 
 impl NamespaceObjectClass {
     /// Create a new `NamespaceObjectClass` structure.
     pub const unsafe fn new(name: &'static [u8]) -> Self {
         NamespaceObjectClass(JSClass {
--- a/servo/components/script/dom/bindings/num.rs
+++ b/servo/components/script/dom/bindings/num.rs
@@ -4,17 +4,17 @@
 
 //! The `Finite<T>` struct.
 
 use heapsize::HeapSizeOf;
 use num_traits::Float;
 use std::ops::Deref;
 
 /// Encapsulates the IDL restricted float type.
-#[derive(JSTraceable, Clone, Copy, Eq, PartialEq)]
+#[derive(Clone, Copy, Eq, JSTraceable, PartialEq)]
 pub struct Finite<T: Float>(T);
 
 impl<T: Float> Finite<T> {
     /// Create a new `Finite<T: Float>` safely.
     pub fn new(value: T) -> Option<Finite<T>> {
         if value.is_finite() {
             Some(Finite(value))
         } else {
--- a/servo/components/script/dom/bindings/settings_stack.rs
+++ b/servo/components/script/dom/bindings/settings_stack.rs
@@ -10,17 +10,17 @@ use js::jsapi::HideScriptedCaller;
 use js::jsapi::JSTracer;
 use js::jsapi::UnhideScriptedCaller;
 use js::rust::Runtime;
 use std::cell::RefCell;
 use std::thread;
 
 thread_local!(static STACK: RefCell<Vec<StackEntry>> = RefCell::new(Vec::new()));
 
-#[derive(PartialEq, Eq, Debug, JSTraceable)]
+#[derive(Debug, Eq, JSTraceable, PartialEq)]
 enum StackEntryKind {
     Incumbent,
     Entry,
 }
 
 #[allow(unrooted_must_root)]
 #[derive(JSTraceable)]
 struct StackEntry {
--- a/servo/components/script/dom/bindings/str.rs
+++ b/servo/components/script/dom/bindings/str.rs
@@ -13,17 +13,17 @@ use std::fmt;
 use std::hash::{Hash, Hasher};
 use std::marker::PhantomData;
 use std::ops;
 use std::ops::{Deref, DerefMut};
 use std::str;
 use std::str::{Bytes, FromStr};
 
 /// Encapsulates the IDL `ByteString` type.
-#[derive(JSTraceable, Clone, Eq, PartialEq, HeapSizeOf, Debug)]
+#[derive(Clone, Debug, Eq, HeapSizeOf, JSTraceable, PartialEq)]
 pub struct ByteString(Vec<u8>);
 
 impl ByteString {
     /// Creates a new `ByteString`.
     pub fn new(value: Vec<u8>) -> ByteString {
         ByteString(value)
     }
 
--- a/servo/components/script/dom/bindings/utils.rs
+++ b/servo/components/script/dom/bindings/utils.rs
@@ -42,17 +42,17 @@ pub struct WindowProxyHandler(pub *const
 
 impl HeapSizeOf for WindowProxyHandler {
     fn heap_size_of_children(&self) -> usize {
         // FIXME(#6907) this is a pointer to memory allocated by `new` in NewProxyHandler in rust-mozjs.
         0
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 /// Static data associated with a global object.
 pub struct GlobalStaticData {
     /// The WindowProxy proxy handler for this global.
     pub windowproxy_handler: WindowProxyHandler,
 }
 
 impl GlobalStaticData {
     /// Creates a new GlobalStaticData.
@@ -74,17 +74,17 @@ pub const DOM_PROTOTYPE_SLOT: u32 = js::
 /// The flag set on the `JSClass`es for DOM global objects.
 // NOTE: This is baked into the Ion JIT as 0 in codegen for LGetDOMProperty and
 // LSetDOMProperty. Those constants need to be changed accordingly if this value
 // changes.
 pub const JSCLASS_DOM_GLOBAL: u32 = js::JSCLASS_USERBIT1;
 
 
 /// The struct that holds inheritance information for DOM object reflectors.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub struct DOMClass {
     /// A list of interfaces that this object implements, in order of decreasing
     /// derivedness.
     pub interface_chain: [PrototypeList::ID; MAX_PROTO_CHAIN_LENGTH],
 
     /// The type ID of that interface.
     pub type_id: TopTypeId,
 
--- a/servo/components/script/dom/canvasgradient.rs
+++ b/servo/components/script/dom/canvasgradient.rs
@@ -19,17 +19,17 @@ use dom_struct::dom_struct;
 // https://html.spec.whatwg.org/multipage/#canvasgradient
 #[dom_struct]
 pub struct CanvasGradient {
     reflector_: Reflector,
     style: CanvasGradientStyle,
     stops: DOMRefCell<Vec<CanvasGradientStop>>,
 }
 
-#[derive(JSTraceable, Clone, HeapSizeOf)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub enum CanvasGradientStyle {
     Linear(LinearGradientStyle),
     Radial(RadialGradientStyle),
 }
 
 impl CanvasGradient {
     fn new_inherited(style: CanvasGradientStyle) -> CanvasGradient {
         CanvasGradient {
--- a/servo/components/script/dom/canvasrenderingcontext2d.rs
+++ b/servo/components/script/dom/canvasrenderingcontext2d.rs
@@ -46,17 +46,17 @@ use script_traits::ScriptMsg;
 use servo_url::ServoUrl;
 use std::{cmp, fmt, mem};
 use std::cell::Cell;
 use std::str::FromStr;
 use std::sync::Arc;
 use unpremultiplytable::UNPREMULTIPLY_TABLE;
 
 #[must_root]
-#[derive(JSTraceable, Clone, HeapSizeOf)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 #[allow(dead_code)]
 enum CanvasFillOrStrokeStyle {
     Color(RGBA),
     Gradient(JS<CanvasGradient>),
     Pattern(JS<CanvasPattern>),
 }
 
 // https://html.spec.whatwg.org/multipage/#canvasrenderingcontext2d
@@ -76,17 +76,17 @@ pub struct CanvasRenderingContext2D {
     /// Needed because of https://github.com/servo/servo/issues/17625
     base_url: ServoUrl,
     state: DOMRefCell<CanvasContextState>,
     saved_states: DOMRefCell<Vec<CanvasContextState>>,
     origin_clean: Cell<bool>,
 }
 
 #[must_root]
-#[derive(JSTraceable, Clone, HeapSizeOf)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 struct CanvasContextState {
     global_alpha: f64,
     global_composition: CompositionOrBlending,
     image_smoothing_enabled: bool,
     fill_style: CanvasFillOrStrokeStyle,
     stroke_style: CanvasFillOrStrokeStyle,
     line_width: f64,
     line_cap: LineCapStyle,
--- a/servo/components/script/dom/cssstyledeclaration.rs
+++ b/servo/components/script/dom/cssstyledeclaration.rs
@@ -149,17 +149,17 @@ impl CSSStyleOwner {
             CSSStyleOwner::Element(ref el) => window_from_node(&**el).Document().base_url(),
             CSSStyleOwner::CSSRule(ref rule, _) => {
                 (*rule.parent_stylesheet().style_stylesheet().contents.url_data.read()).clone()
             }
         }
     }
 }
 
-#[derive(PartialEq, HeapSizeOf)]
+#[derive(HeapSizeOf, PartialEq)]
 pub enum CSSModificationAccess {
     ReadWrite,
     Readonly,
 }
 
 macro_rules! css_properties(
     ( $([$getter:ident, $setter:ident, $id:expr],)* ) => (
         $(
--- a/servo/components/script/dom/customelementregistry.rs
+++ b/servo/components/script/dom/customelementregistry.rs
@@ -367,39 +367,39 @@ impl CustomElementRegistryMethods for Cu
             promise
         });
 
         // Step 6
         promise
     }
 }
 
-#[derive(HeapSizeOf, JSTraceable, Clone)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub struct LifecycleCallbacks {
     #[ignore_heap_size_of = "Rc"]
     connected_callback: Option<Rc<Function>>,
 
     #[ignore_heap_size_of = "Rc"]
     disconnected_callback: Option<Rc<Function>>,
 
     #[ignore_heap_size_of = "Rc"]
     adopted_callback: Option<Rc<Function>>,
 
     #[ignore_heap_size_of = "Rc"]
     attribute_changed_callback: Option<Rc<Function>>,
 }
 
-#[derive(HeapSizeOf, JSTraceable, Clone)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub enum ConstructionStackEntry {
     Element(Root<Element>),
     AlreadyConstructedMarker,
 }
 
 /// https://html.spec.whatwg.org/multipage/#custom-element-definition
-#[derive(HeapSizeOf, JSTraceable, Clone)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub struct CustomElementDefinition {
     pub name: LocalName,
 
     pub local_name: LocalName,
 
     #[ignore_heap_size_of = "Rc"]
     pub constructor: Rc<Function>,
 
@@ -615,17 +615,17 @@ impl CustomElementReaction {
 pub enum CallbackReaction {
     Connected,
     Disconnected,
     Adopted(Root<Document>, Root<Document>),
     AttributeChanged(LocalName, Option<DOMString>, Option<DOMString>, Namespace),
 }
 
 /// https://html.spec.whatwg.org/multipage/#processing-the-backup-element-queue
-#[derive(HeapSizeOf, JSTraceable, Eq, PartialEq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, HeapSizeOf, JSTraceable, PartialEq)]
 enum BackupElementQueueFlag {
     Processing,
     NotProcessing,
 }
 
 /// https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack
 #[derive(HeapSizeOf, JSTraceable)]
 #[must_root]
--- a/servo/components/script/dom/document.rs
+++ b/servo/components/script/dom/document.rs
@@ -188,17 +188,17 @@ impl PendingRestyle {
         PendingRestyle {
             snapshot: None,
             hint: RestyleHint::empty(),
             damage: RestyleDamage::empty(),
         }
     }
 }
 
-#[derive(Clone, JSTraceable, HeapSizeOf)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 #[must_root]
 struct StyleSheetInDocument {
     #[ignore_heap_size_of = "Arc"]
     sheet: Arc<Stylesheet>,
     owner: JS<Element>,
 }
 
 impl PartialEq for StyleSheetInDocument {
@@ -348,66 +348,66 @@ pub struct Document {
     /// Map from ID to set of form control elements that have that ID as
     /// their 'form' content attribute. Used to reset form controls
     /// whenever any element with the same ID as the form attribute
     /// is inserted or removed from the document.
     /// See https://html.spec.whatwg.org/multipage/#form-owner
     form_id_listener_map: DOMRefCell<HashMap<Atom, HashSet<JS<Element>>>>,
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct ImagesFilter;
 impl CollectionFilter for ImagesFilter {
     fn filter(&self, elem: &Element, _root: &Node) -> bool {
         elem.is::<HTMLImageElement>()
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct EmbedsFilter;
 impl CollectionFilter for EmbedsFilter {
     fn filter(&self, elem: &Element, _root: &Node) -> bool {
         elem.is::<HTMLEmbedElement>()
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct LinksFilter;
 impl CollectionFilter for LinksFilter {
     fn filter(&self, elem: &Element, _root: &Node) -> bool {
         (elem.is::<HTMLAnchorElement>() || elem.is::<HTMLAreaElement>()) &&
         elem.has_attribute(&local_name!("href"))
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct FormsFilter;
 impl CollectionFilter for FormsFilter {
     fn filter(&self, elem: &Element, _root: &Node) -> bool {
         elem.is::<HTMLFormElement>()
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct ScriptsFilter;
 impl CollectionFilter for ScriptsFilter {
     fn filter(&self, elem: &Element, _root: &Node) -> bool {
         elem.is::<HTMLScriptElement>()
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct AnchorsFilter;
 impl CollectionFilter for AnchorsFilter {
     fn filter(&self, elem: &Element, _root: &Node) -> bool {
         elem.is::<HTMLAnchorElement>() && elem.has_attribute(&local_name!("href"))
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct AppletsFilter;
 impl CollectionFilter for AppletsFilter {
     fn filter(&self, elem: &Element, _root: &Node) -> bool {
         elem.is::<HTMLAppletElement>()
     }
 }
 
 impl Document {
@@ -2022,17 +2022,17 @@ impl Document {
     }
 
     fn send_to_constellation(&self, msg: ScriptMsg) {
         let global_scope = self.window.upcast::<GlobalScope>();
         global_scope.script_to_constellation_chan().send(msg).unwrap();
     }
 }
 
-#[derive(PartialEq, HeapSizeOf)]
+#[derive(HeapSizeOf, PartialEq)]
 pub enum DocumentSource {
     FromParser,
     NotFromParser,
 }
 
 #[allow(unsafe_code)]
 pub trait LayoutDocumentHelpers {
     unsafe fn is_html_document_for_layout(&self) -> bool;
@@ -2136,17 +2136,17 @@ fn get_registrable_domain_suffix_of_or_i
 /// https://url.spec.whatwg.org/#network-scheme
 fn url_has_network_scheme(url: &ServoUrl) -> bool {
     match url.scheme() {
         "ftp" | "http" | "https" => true,
         _ => false,
     }
 }
 
-#[derive(Copy, Clone, HeapSizeOf, JSTraceable, PartialEq, Eq)]
+#[derive(Clone, Copy, Eq, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum HasBrowsingContext {
     No,
     Yes,
 }
 
 impl Document {
     pub fn new_inherited(window: &Window,
                          has_browsing_context: HasBrowsingContext,
@@ -3508,17 +3508,17 @@ impl DocumentMethods for Document {
     // https://html.spec.whatwg.org/multipage/#dom-document-fgcolor
     fn SetFgColor(&self, value: DOMString) {
         self.set_body_attribute(&local_name!("text"), value)
     }
 
     #[allow(unsafe_code)]
     // https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
     unsafe fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonZero<*mut JSObject>> {
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct NamedElementFilter {
             name: Atom,
         }
         impl CollectionFilter for NamedElementFilter {
             fn filter(&self, elem: &Element, _root: &Node) -> bool {
                 filter_by_name(&self.name, elem.upcast())
             }
         }
@@ -4028,17 +4028,17 @@ impl Runnable for DocumentProgressHandle
             if let Some(fragment) = document.url().fragment() {
                 document.check_and_scroll_fragment(fragment);
             }
         }
     }
 }
 
 /// Specifies the type of focus event that is sent to a pipeline
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 pub enum FocusType {
     Element,    // The first focus message - focus the element itself
     Parent,     // Focusing a parent element (an iframe)
 }
 
 /// Focus events
 pub enum FocusEventType {
     Focus,      // Element gained focus. Doesn't bubble.
@@ -4046,17 +4046,17 @@ pub enum FocusEventType {
 }
 
 /// A fake `requestAnimationFrame()` callback—"fake" because it is not triggered by the video
 /// refresh but rather a simple timer.
 ///
 /// If the page is observed to be using `requestAnimationFrame()` for non-animation purposes (i.e.
 /// without mutating the DOM), then we fall back to simple timeouts to save energy over video
 /// refresh.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct FakeRequestAnimationFrameCallback {
     /// The document.
     #[ignore_heap_size_of = "non-owning"]
     document: Trusted<Document>,
 }
 
 impl FakeRequestAnimationFrameCallback {
     pub fn invoke(self) {
--- a/servo/components/script/dom/domexception.rs
+++ b/servo/components/script/dom/domexception.rs
@@ -7,17 +7,17 @@ use dom::bindings::codegen::Bindings::DO
 use dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
 use dom::bindings::js::Root;
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::bindings::str::DOMString;
 use dom::globalscope::GlobalScope;
 use dom_struct::dom_struct;
 
 #[repr(u16)]
-#[derive(JSTraceable, Copy, Clone, Debug, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable)]
 pub enum DOMErrorName {
     IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR,
     HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR,
     WrongDocumentError = DOMExceptionConstants::WRONG_DOCUMENT_ERR,
     InvalidCharacterError = DOMExceptionConstants::INVALID_CHARACTER_ERR,
     NoModificationAllowedError = DOMExceptionConstants::NO_MODIFICATION_ALLOWED_ERR,
     NotFoundError = DOMExceptionConstants::NOT_FOUND_ERR,
     NotSupportedError = DOMExceptionConstants::NOT_SUPPORTED_ERR,
--- a/servo/components/script/dom/element.rs
+++ b/servo/components/script/dom/element.rs
@@ -165,29 +165,29 @@ impl fmt::Debug for Element {
 }
 
 impl fmt::Debug for Root<Element> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         (**self).fmt(f)
     }
 }
 
-#[derive(PartialEq, HeapSizeOf)]
+#[derive(HeapSizeOf, PartialEq)]
 pub enum ElementCreator {
     ParserCreated(u64),
     ScriptCreated,
 }
 
 pub enum CustomElementCreationMode {
     Synchronous,
     Asynchronous,
 }
 
 /// https://dom.spec.whatwg.org/#concept-element-custom-element-state
-#[derive(Clone, Copy, PartialEq, Eq, HeapSizeOf, JSTraceable)]
+#[derive(Clone, Copy, Eq, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum CustomElementState {
     Undefined,
     Failed,
     Uncustomized,
     Custom,
 }
 
 impl ElementCreator {
@@ -2976,17 +2976,17 @@ impl<'a> AttributeMutation<'a> {
             AttributeMutation::Removed => None,
         }
     }
 }
 
 /// A holder for an element's "tag name", which will be lazily
 /// resolved and cached. Should be reset when the document
 /// owner changes.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct TagName {
     ptr: DOMRefCell<Option<LocalName>>,
 }
 
 impl TagName {
     fn new() -> TagName {
         TagName { ptr: DOMRefCell::new(None) }
     }
--- a/servo/components/script/dom/event.rs
+++ b/servo/components/script/dom/event.rs
@@ -289,17 +289,17 @@ impl EventMethods for Event {
     }
 
     // https://dom.spec.whatwg.org/#dom-event-istrusted
     fn IsTrusted(&self) -> bool {
         self.trusted.get()
     }
 }
 
-#[derive(PartialEq, HeapSizeOf, Copy, Clone)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum EventBubbles {
     Bubbles,
     DoesNotBubble
 }
 
 impl From<bool> for EventBubbles {
     fn from(boolean: bool) -> Self {
         match boolean {
@@ -313,17 +313,17 @@ impl From<EventBubbles> for bool {
     fn from(bubbles: EventBubbles) -> Self {
         match bubbles {
             EventBubbles::Bubbles => true,
             EventBubbles::DoesNotBubble => false
         }
     }
 }
 
-#[derive(PartialEq, HeapSizeOf, Copy, Clone)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum EventCancelable {
     Cancelable,
     NotCancelable
 }
 
 impl From<bool> for EventCancelable {
     fn from(boolean: bool) -> Self {
         match boolean {
@@ -337,17 +337,17 @@ impl From<EventCancelable> for bool {
     fn from(bubbles: EventCancelable) -> Self {
         match bubbles {
             EventCancelable::Cancelable => true,
             EventCancelable::NotCancelable => false
         }
     }
 }
 
-#[derive(JSTraceable, Copy, Clone, Debug, PartialEq, Eq)]
+#[derive(Clone, Copy, Debug, Eq, JSTraceable, PartialEq)]
 #[repr(u16)]
 #[derive(HeapSizeOf)]
 pub enum EventPhase {
     None      = EventConstants::NONE,
     Capturing = EventConstants::CAPTURING_PHASE,
     AtTarget  = EventConstants::AT_TARGET,
     Bubbling  = EventConstants::BUBBLING_PHASE,
 }
@@ -358,17 +358,17 @@ pub enum EventPhase {
 /// states, we also need something to stop the event from being handled again (without cancelling
 /// the event entirely). For example, an Up/Down `KeyEvent` inside a `textarea` element will
 /// trigger the cursor to go up/down if the text inside the element spans multiple lines. This enum
 /// helps us to prevent such events from being [sent to the constellation][msg] where it will be
 /// handled once again for page scrolling (which is definitely not what we'd want).
 ///
 /// [msg]: https://doc.servo.org/script_traits/enum.ConstellationMsg.html#variant.KeyEvent
 ///
-#[derive(JSTraceable, HeapSizeOf, Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum EventDefault {
     /// The default action of the event is allowed (constructor's default)
     Allowed,
     /// The default action has been prevented by calling `PreventDefault`
     Prevented,
     /// The event has been handled somewhere in the DOM, and it should be prevented from being
     /// re-handled elsewhere. This doesn't affect the judgement of `DefaultPrevented`
     Handled,
--- a/servo/components/script/dom/eventsource.rs
+++ b/servo/components/script/dom/eventsource.rs
@@ -38,20 +38,20 @@ use std::sync::{Arc, Mutex};
 use task_source::TaskSource;
 use timers::OneshotTimerCallback;
 use utf8;
 
 header! { (LastEventId, "Last-Event-ID") => [String] }
 
 const DEFAULT_RECONNECTION_TIME: u64 = 5000;
 
-#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 struct GenerationId(u32);
 
-#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 /// https://html.spec.whatwg.org/multipage/#dom-eventsource-readystate
 enum ReadyState {
     Connecting = 0,
     Open = 1,
     Closed = 2
 }
 
 #[dom_struct]
@@ -530,17 +530,17 @@ impl Runnable for ReestablishConnectionR
         let callback = OneshotTimerCallback::EventSourceTimeout(EventSourceTimeoutCallback {
             event_source: self.event_source.clone(),
             action_sender: self.action_sender.clone()
         });
         let _ = event_source.global().schedule_callback(callback, duration);
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct EventSourceTimeoutCallback {
     #[ignore_heap_size_of = "Because it is non-owning"]
     event_source: Trusted<EventSource>,
     #[ignore_heap_size_of = "Because it is non-owning"]
     action_sender: ipc::IpcSender<FetchResponseMsg>,
 }
 
 impl EventSourceTimeoutCallback {
--- a/servo/components/script/dom/eventtarget.rs
+++ b/servo/components/script/dom/eventtarget.rs
@@ -39,49 +39,49 @@ use std::collections::hash_map::Entry::{
 use std::default::Default;
 use std::ffi::CString;
 use std::hash::BuildHasherDefault;
 use std::mem;
 use std::ops::{Deref, DerefMut};
 use std::ptr;
 use std::rc::Rc;
 
-#[derive(PartialEq, Clone, JSTraceable)]
+#[derive(Clone, JSTraceable, PartialEq)]
 pub enum CommonEventHandler {
     EventHandler(Rc<EventHandlerNonNull>),
     ErrorEventHandler(Rc<OnErrorEventHandlerNonNull>),
     BeforeUnloadEventHandler(Rc<OnBeforeUnloadEventHandlerNonNull>),
 }
 
 impl CommonEventHandler {
     fn parent(&self) -> &CallbackFunction {
         match *self {
             CommonEventHandler::EventHandler(ref handler) => &handler.parent,
             CommonEventHandler::ErrorEventHandler(ref handler) => &handler.parent,
             CommonEventHandler::BeforeUnloadEventHandler(ref handler) => &handler.parent,
         }
     }
 }
 
-#[derive(JSTraceable, Copy, Clone, PartialEq, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum ListenerPhase {
     Capturing,
     Bubbling,
 }
 
 /// https://html.spec.whatwg.org/multipage/#internal-raw-uncompiled-handler
-#[derive(JSTraceable, Clone, PartialEq)]
+#[derive(Clone, JSTraceable, PartialEq)]
 struct InternalRawUncompiledHandler {
     source: DOMString,
     url: ServoUrl,
     line: usize,
 }
 
 /// A representation of an event handler, either compiled or uncompiled raw source, or null.
-#[derive(JSTraceable, PartialEq, Clone)]
+#[derive(Clone, JSTraceable, PartialEq)]
 enum InlineEventListener {
     Uncompiled(InternalRawUncompiledHandler),
     Compiled(CommonEventHandler),
     Null,
 }
 
 impl InlineEventListener {
     /// Get a compiled representation of this event handler, compiling it from its
@@ -101,17 +101,17 @@ impl InlineEventListener {
             InlineEventListener::Compiled(handler) => {
                 *self = InlineEventListener::Compiled(handler.clone());
                 Some(handler)
             }
         }
     }
 }
 
-#[derive(JSTraceable, Clone, PartialEq)]
+#[derive(Clone, JSTraceable, PartialEq)]
 enum EventListenerType {
     Additive(Rc<EventListener>),
     Inline(InlineEventListener),
 }
 
 impl HeapSizeOf for EventListenerType {
     fn heap_size_of_children(&self) -> usize {
         // FIXME: Rc<T> isn't HeapSizeOf and we can't ignore it due to #6870 and #6871
@@ -223,17 +223,17 @@ impl CompiledEventListener {
 
 #[derive(Clone, DenyPublicFields, HeapSizeOf, JSTraceable, PartialEq)]
 /// A listener in a collection of event listeners.
 struct EventListenerEntry {
     phase: ListenerPhase,
     listener: EventListenerType
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 /// A mix of potentially uncompiled and compiled event listeners of the same type.
 struct EventListeners(Vec<EventListenerEntry>);
 
 impl Deref for EventListeners {
     type Target = Vec<EventListenerEntry>;
     fn deref(&self) -> &Vec<EventListenerEntry> {
         &self.0
     }
--- a/servo/components/script/dom/filereader.rs
+++ b/servo/components/script/dom/filereader.rs
@@ -34,17 +34,17 @@ use script_thread::RunnableWrapper;
 use servo_atoms::Atom;
 use std::cell::Cell;
 use std::ptr;
 use std::sync::Arc;
 use std::thread;
 use task_source::TaskSource;
 use task_source::file_reading::{FileReadingTaskSource, FileReadingRunnable, FileReadingTask};
 
-#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum FileReaderFunction {
     ReadAsText,
     ReadAsDataUrl,
     ReadAsArrayBuffer,
 }
 
 pub type TrustedFileReader = Trusted<FileReader>;
 
@@ -61,21 +61,21 @@ impl ReadMetaData {
         ReadMetaData {
             blobtype: blobtype,
             label: label,
             function: function,
         }
     }
 }
 
-#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub struct GenerationId(u32);
 
 #[repr(u16)]
-#[derive(Copy, Clone, Debug, PartialEq, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum FileReaderReadyState {
     Empty = FileReaderConstants::EMPTY,
     Loading = FileReaderConstants::LOADING,
     Done = FileReaderConstants::DONE,
 }
 
 #[derive(HeapSizeOf, JSTraceable)]
 pub enum FileReaderResult {
--- a/servo/components/script/dom/headers.rs
+++ b/servo/components/script/dom/headers.rs
@@ -21,17 +21,17 @@ use std::str;
 pub struct Headers {
     reflector_: Reflector,
     guard: Cell<Guard>,
     #[ignore_heap_size_of = "Defined in hyper"]
     header_list: DOMRefCell<HyperHeaders>
 }
 
 // https://fetch.spec.whatwg.org/#concept-headers-guard
-#[derive(Copy, Clone, JSTraceable, HeapSizeOf, PartialEq)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum Guard {
     Immutable,
     Request,
     RequestNoCors,
     Response,
     None,
 }
 
--- a/servo/components/script/dom/htmlbuttonelement.rs
+++ b/servo/components/script/dom/htmlbuttonelement.rs
@@ -24,17 +24,17 @@ use dom::validation::Validatable;
 use dom::validitystate::{ValidityState, ValidationFlags};
 use dom::virtualmethods::VirtualMethods;
 use dom_struct::dom_struct;
 use html5ever::{LocalName, Prefix};
 use std::cell::Cell;
 use std::default::Default;
 use style::element_state::*;
 
-#[derive(JSTraceable, PartialEq, Copy, Clone)]
+#[derive(Clone, Copy, JSTraceable, PartialEq)]
 #[derive(HeapSizeOf)]
 enum ButtonType {
     Submit,
     Reset,
     Button,
     Menu
 }
 
--- a/servo/components/script/dom/htmlcanvaselement.rs
+++ b/servo/components/script/dom/htmlcanvaselement.rs
@@ -37,17 +37,17 @@ use offscreen_gl_context::GLContextAttri
 use script_layout_interface::{HTMLCanvasData, HTMLCanvasDataSource};
 use std::iter::repeat;
 use style::attr::{AttrValue, LengthOrPercentageOrAuto};
 
 const DEFAULT_WIDTH: u32 = 300;
 const DEFAULT_HEIGHT: u32 = 150;
 
 #[must_root]
-#[derive(JSTraceable, Clone, HeapSizeOf)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub enum CanvasContext {
     Context2d(JS<CanvasRenderingContext2D>),
     WebGL(JS<WebGLRenderingContext>),
 }
 
 #[dom_struct]
 pub struct HTMLCanvasElement {
     htmlelement: HTMLElement,
--- a/servo/components/script/dom/htmlcollection.rs
+++ b/servo/components/script/dom/htmlcollection.rs
@@ -21,17 +21,17 @@ use style::str::split_html_space_chars;
 
 pub trait CollectionFilter : JSTraceable {
     fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool;
 }
 
 // An optional u32, using maxint to represent None.
 // It would be nicer just to use Option<u32> for this, but that would produce word
 // alignment issues since Option<u32> uses 33 bits.
-#[derive(Clone, Copy, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
 struct OptionU32 {
     bits: u32,
 }
 
 impl OptionU32 {
     fn to_option(self) -> Option<u32> {
         if self.bits == u32::max_value() {
             None
@@ -114,27 +114,27 @@ impl HTMLCollection {
         }
     }
 
     // https://dom.spec.whatwg.org/#concept-getelementsbytagname
     pub fn by_qualified_name(window: &Window, root: &Node, qualified_name: LocalName)
                              -> Root<HTMLCollection> {
         // case 1
         if qualified_name == local_name!("*") {
-            #[derive(JSTraceable, HeapSizeOf)]
+            #[derive(HeapSizeOf, JSTraceable)]
             struct AllFilter;
             impl CollectionFilter for AllFilter {
                 fn filter(&self, _elem: &Element, _root: &Node) -> bool {
                     true
                 }
             }
             return HTMLCollection::create(window, root, box AllFilter);
         }
 
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct HtmlDocumentFilter {
             qualified_name: LocalName,
             ascii_lower_qualified_name: LocalName,
         }
         impl CollectionFilter for HtmlDocumentFilter {
             fn filter(&self, elem: &Element, root: &Node) -> bool {
                 if root.is_in_html_doc() && elem.namespace() == &ns!(html) {    // case 2
                     HTMLCollection::match_element(elem, &self.ascii_lower_qualified_name)
@@ -164,17 +164,17 @@ impl HTMLCollection {
                           maybe_ns: Option<DOMString>) -> Root<HTMLCollection> {
         let local = LocalName::from(tag);
         let ns = namespace_from_domstring(maybe_ns);
         let qname = QualName::new(None, ns, local);
         HTMLCollection::by_qual_tag_name(window, root, qname)
     }
 
     pub fn by_qual_tag_name(window: &Window, root: &Node, qname: QualName) -> Root<HTMLCollection> {
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct TagNameNSFilter {
             qname: QualName
         }
         impl CollectionFilter for TagNameNSFilter {
             fn filter(&self, elem: &Element, _root: &Node) -> bool {
                     ((self.qname.ns == namespace_url!("*")) || (self.qname.ns == *elem.namespace())) &&
                     ((self.qname.local == local_name!("*")) || (self.qname.local == *elem.local_name()))
             }
@@ -188,17 +188,17 @@ impl HTMLCollection {
     pub fn by_class_name(window: &Window, root: &Node, classes: DOMString)
                          -> Root<HTMLCollection> {
         let class_atoms = split_html_space_chars(&classes).map(Atom::from).collect();
         HTMLCollection::by_atomic_class_name(window, root, class_atoms)
     }
 
     pub fn by_atomic_class_name(window: &Window, root: &Node, classes: Vec<Atom>)
                          -> Root<HTMLCollection> {
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct ClassNameFilter {
             classes: Vec<Atom>
         }
         impl CollectionFilter for ClassNameFilter {
             fn filter(&self, elem: &Element, _root: &Node) -> bool {
                 let case_sensitivity = document_from_node(elem)
                     .quirks_mode()
                     .classes_and_ids_case_sensitivity();
@@ -207,17 +207,17 @@ impl HTMLCollection {
         }
         let filter = ClassNameFilter {
             classes: classes
         };
         HTMLCollection::create(window, root, box filter)
     }
 
     pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> {
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct ElementChildFilter;
         impl CollectionFilter for ElementChildFilter {
             fn filter(&self, elem: &Element, root: &Node) -> bool {
                 root.is_parent_of(elem.upcast())
             }
         }
         HTMLCollection::create(window, root, box ElementChildFilter)
     }
--- a/servo/components/script/dom/htmldatalistelement.rs
+++ b/servo/components/script/dom/htmldatalistelement.rs
@@ -38,17 +38,17 @@ impl HTMLDataListElement {
                            document,
                            HTMLDataListElementBinding::Wrap)
     }
 }
 
 impl HTMLDataListElementMethods for HTMLDataListElement {
     // https://html.spec.whatwg.org/multipage/#dom-datalist-options
     fn Options(&self) -> Root<HTMLCollection> {
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct HTMLDataListOptionsFilter;
         impl CollectionFilter for HTMLDataListOptionsFilter {
             fn filter(&self, elem: &Element, _root: &Node) -> bool {
                 elem.is::<HTMLOptionElement>()
             }
         }
         let filter = box HTMLDataListOptionsFilter;
         let window = window_from_node(self);
--- a/servo/components/script/dom/htmlfieldsetelement.rs
+++ b/servo/components/script/dom/htmlfieldsetelement.rs
@@ -47,17 +47,17 @@ impl HTMLFieldSetElement {
                            document,
                            HTMLFieldSetElementBinding::Wrap)
     }
 }
 
 impl HTMLFieldSetElementMethods for HTMLFieldSetElement {
     // https://html.spec.whatwg.org/multipage/#dom-fieldset-elements
     fn Elements(&self) -> Root<HTMLCollection> {
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct ElementsFilter;
         impl CollectionFilter for ElementsFilter {
             fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool {
                 elem.downcast::<HTMLElement>()
                     .map_or(false, HTMLElement::is_listed_element)
             }
         }
         let filter = box ElementsFilter;
--- a/servo/components/script/dom/htmlformelement.rs
+++ b/servo/components/script/dom/htmlformelement.rs
@@ -54,17 +54,17 @@ use script_traits::LoadData;
 use servo_rand::random;
 use std::borrow::ToOwned;
 use std::cell::Cell;
 use std::sync::mpsc::Sender;
 use style::attr::AttrValue;
 use style::str::split_html_space_chars;
 use task_source::TaskSource;
 
-#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub struct GenerationId(u32);
 
 #[dom_struct]
 pub struct HTMLFormElement {
     htmlelement: HTMLElement,
     marked_for_reset: Cell<bool>,
     elements: MutNullableJS<HTMLFormControlsCollection>,
     generation_id: Cell<GenerationId>,
@@ -167,17 +167,17 @@ impl HTMLFormElementMethods for HTMLForm
     }
 
     // https://html.spec.whatwg.org/multipage/#dom-form-elements
     fn Elements(&self) -> Root<HTMLFormControlsCollection> {
         if let Some(elements) = self.elements.get() {
             return elements;
         }
 
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct ElementsFilter {
             form: Root<HTMLFormElement>
         }
         impl CollectionFilter for ElementsFilter {
             fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool {
                 let form_owner = match elem.upcast::<Node>().type_id() {
                     NodeTypeId::Element(ElementTypeId::HTMLElement(t)) => {
                         match t {
@@ -236,23 +236,23 @@ impl HTMLFormElementMethods for HTMLForm
 
     // https://html.spec.whatwg.org/multipage/#dom-form-item
     fn IndexedGetter(&self, index: u32) -> Option<Root<Element>> {
         let elements = self.Elements();
         elements.IndexedGetter(index)
     }
 }
 
-#[derive(Copy, Clone, HeapSizeOf, PartialEq)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum SubmittedFrom {
     FromForm,
     NotFromForm
 }
 
-#[derive(Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf)]
 pub enum ResetFrom {
     FromForm,
     NotFromForm
 }
 
 
 impl HTMLFormElement {
     // https://html.spec.whatwg.org/multipage/#picking-an-encoding-for-the-form
@@ -669,24 +669,24 @@ impl HTMLFormElement {
     fn remove_control<T: ?Sized + FormControl>(&self, control: &T) {
         let control = control.to_element();
         let mut controls = self.controls.borrow_mut();
         controls.iter().position(|c| c.r() == control)
                        .map(|idx| controls.remove(idx));
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf, Clone)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub enum FormDatumValue {
     #[allow(dead_code)]
     File(Root<File>),
     String(DOMString)
 }
 
-#[derive(HeapSizeOf, JSTraceable, Clone)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub struct FormDatum {
     pub ty: DOMString,
     pub name: DOMString,
     pub value: FormDatumValue
 }
 
 impl FormDatum {
     pub fn replace_value(&self, charset: &str) -> String {
@@ -696,24 +696,24 @@ impl FormDatum {
 
         match self.value {
             FormDatumValue::File(ref f) => String::from(f.name().clone()),
             FormDatumValue::String(ref s) => String::from(s.clone()),
         }
     }
 }
 
-#[derive(Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf)]
 pub enum FormEncType {
     TextPlainEncoded,
     UrlEncoded,
     FormDataEncoded
 }
 
-#[derive(Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf)]
 pub enum FormMethod {
     FormGet,
     FormPost,
     FormDialog
 }
 
 #[derive(HeapSizeOf)]
 #[allow(dead_code)]
@@ -754,17 +754,17 @@ impl FormSubmittableElement {
         else if let Some(input) = element.downcast::<HTMLTextAreaElement>() {
             FormSubmittableElement::TextAreaElement(Root::from_ref(&input))
         } else {
             unreachable!()
         }
     }
 }
 
-#[derive(Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf)]
 pub enum FormSubmitter<'a> {
     FormElement(&'a HTMLFormElement),
     InputElement(&'a HTMLInputElement),
     ButtonElement(&'a HTMLButtonElement)
     // TODO: image submit, etc etc
 }
 
 impl<'a> FormSubmitter<'a> {
--- a/servo/components/script/dom/htmlheadingelement.rs
+++ b/servo/components/script/dom/htmlheadingelement.rs
@@ -5,17 +5,17 @@
 use dom::bindings::codegen::Bindings::HTMLHeadingElementBinding;
 use dom::bindings::js::Root;
 use dom::document::Document;
 use dom::htmlelement::HTMLElement;
 use dom::node::Node;
 use dom_struct::dom_struct;
 use html5ever::{LocalName, Prefix};
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub enum HeadingLevel {
     Heading1,
     Heading2,
     Heading3,
     Heading4,
     Heading5,
     Heading6,
 }
--- a/servo/components/script/dom/htmliframeelement.rs
+++ b/servo/components/script/dom/htmliframeelement.rs
@@ -52,17 +52,17 @@ use servo_config::prefs::PREFS;
 use servo_config::servo_version;
 use servo_url::ServoUrl;
 use std::cell::Cell;
 use style::attr::{AttrValue, LengthOrPercentageOrAuto};
 use style::context::ReflowGoal;
 use task_source::TaskSource;
 
 bitflags! {
-    #[derive(JSTraceable, HeapSizeOf)]
+    #[derive(HeapSizeOf, JSTraceable)]
     flags SandboxAllowance: u8 {
         const ALLOW_NOTHING = 0x00,
         const ALLOW_SAME_ORIGIN = 0x01,
         const ALLOW_TOP_NAVIGATION = 0x02,
         const ALLOW_FORMS = 0x04,
         const ALLOW_SCRIPTS = 0x08,
         const ALLOW_POINTER_LOCK = 0x10,
         const ALLOW_POPUPS = 0x20
--- a/servo/components/script/dom/htmlimageelement.rs
+++ b/servo/components/script/dom/htmlimageelement.rs
@@ -53,30 +53,30 @@ use servo_url::ServoUrl;
 use servo_url::origin::ImmutableOrigin;
 use std::cell::{Cell, RefMut};
 use std::default::Default;
 use std::i32;
 use std::sync::{Arc, Mutex};
 use style::attr::{AttrValue, LengthOrPercentageOrAuto};
 use task_source::TaskSource;
 
-#[derive(Clone, Copy, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
 #[allow(dead_code)]
 enum State {
     Unavailable,
     PartiallyAvailable,
     CompletelyAvailable,
     Broken,
 }
-#[derive(Copy, Clone, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
 enum ImageRequestPhase {
     Pending,
     Current
 }
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 #[must_root]
 struct ImageRequest {
     state: State,
     parsed_url: Option<ServoUrl>,
     source_url: Option<DOMString>,
     blocker: Option<LoadBlocker>,
     #[ignore_heap_size_of = "Arc"]
     image: Option<Arc<Image>>,
@@ -710,17 +710,17 @@ impl HTMLImageElement {
         match self.current_request.borrow_mut().final_url {
             Some(ref url) => Some(url.origin()),
             None => None
         }
     }
 
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub enum ImageElementMicrotask {
     StableStateUpdateImageDataTask {
         elem: Root<HTMLImageElement>,
         generation: u32,
     }
 }
 
 impl MicrotaskRunnable for ImageElementMicrotask {
--- a/servo/components/script/dom/htmlinputelement.rs
+++ b/servo/components/script/dom/htmlinputelement.rs
@@ -55,17 +55,17 @@ use style::str::split_commas;
 use textinput::{SelectionDirection, TextInput};
 use textinput::KeyReaction::{DispatchInput, Nothing, RedrawSelection, TriggerDefaultAction};
 use textinput::Lines::Single;
 
 const DEFAULT_SUBMIT_VALUE: &'static str = "Submit";
 const DEFAULT_RESET_VALUE: &'static str = "Reset";
 const PASSWORD_REPLACEMENT_CHAR: char = '●';
 
-#[derive(JSTraceable, PartialEq, Copy, Clone)]
+#[derive(Clone, Copy, JSTraceable, PartialEq)]
 #[allow(dead_code)]
 #[derive(HeapSizeOf)]
 enum InputType {
     InputSubmit,
     InputReset,
     InputButton,
     InputText,
     InputFile,
--- a/servo/components/script/dom/htmllinkelement.rs
+++ b/servo/components/script/dom/htmllinkelement.rs
@@ -33,17 +33,17 @@ use std::default::Default;
 use style::attr::AttrValue;
 use style::media_queries::parse_media_query_list;
 use style::parser::ParserContext as CssParserContext;
 use style::str::HTML_SPACE_CHARACTERS;
 use style::stylesheets::{CssRuleType, Stylesheet};
 use style_traits::PARSING_MODE_DEFAULT;
 use stylesheet_loader::{StylesheetLoader, StylesheetContextSource, StylesheetOwner};
 
-#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub struct RequestGenerationId(u32);
 
 impl RequestGenerationId {
     fn increment(self) -> RequestGenerationId {
         RequestGenerationId(self.0 + 1)
     }
 }
 
--- a/servo/components/script/dom/htmlmediaelement.rs
+++ b/servo/components/script/dom/htmlmediaelement.rs
@@ -196,17 +196,17 @@ impl HTMLMediaElementContext {
                 elem.change_ready_state(HAVE_METADATA);
                 self.have_metadata = true;
             }
             _ => {}
         }
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct VideoMedia {
     format: String,
     #[ignore_heap_size_of = "defined in time"]
     duration: Duration,
     width: u32,
     height: u32,
     video: String,
     audio: Option<String>,
@@ -789,17 +789,17 @@ impl VirtualMethods for HTMLMediaElement
             let task = MediaElementMicrotask::PauseIfNotInDocumentTask {
                 elem: Root::from_ref(self)
             };
             ScriptThread::await_stable_state(Microtask::MediaElement(task));
         }
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub enum MediaElementMicrotask {
     ResourceSelectionTask {
         elem: Root<HTMLMediaElement>,
         base_url: ServoUrl
     },
     PauseIfNotInDocumentTask {
         elem: Root<HTMLMediaElement>,
     }
--- a/servo/components/script/dom/htmlselectelement.rs
+++ b/servo/components/script/dom/htmlselectelement.rs
@@ -32,17 +32,17 @@ use dom::validitystate::{ValidityState, 
 use dom::virtualmethods::VirtualMethods;
 use dom_struct::dom_struct;
 use html5ever::{LocalName, Prefix};
 use std::default::Default;
 use std::iter;
 use style::attr::AttrValue;
 use style::element_state::*;
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct OptionsFilter;
 impl CollectionFilter for OptionsFilter {
     fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool {
         if !elem.is::<HTMLOptionElement>() {
             return false;
         }
 
         let node = elem.upcast::<Node>();
--- a/servo/components/script/dom/htmltableelement.rs
+++ b/servo/components/script/dom/htmltableelement.rs
@@ -31,17 +31,17 @@ use style::attr::{AttrValue, LengthOrPer
 pub struct HTMLTableElement {
     htmlelement: HTMLElement,
     border: Cell<Option<u32>>,
     cellspacing: Cell<Option<u32>>,
     tbodies: MutNullableJS<HTMLCollection>,
 }
 
 #[allow(unrooted_must_root)]
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct TableRowFilter {
     sections: Vec<JS<Node>>,
 }
 
 impl CollectionFilter for TableRowFilter {
     fn filter(&self, elem: &Element, root: &Node) -> bool {
         elem.is::<HTMLTableRowElement>() &&
             (root.is_parent_of(elem.upcast())
--- a/servo/components/script/dom/node.rs
+++ b/servo/components/script/dom/node.rs
@@ -144,17 +144,17 @@ pub struct Node {
     /// Registered observers for this node.
     mutation_observers: DOMRefCell<Vec<RegisteredObserver>>,
 
     unique_id: UniqueId,
 }
 
 bitflags! {
     #[doc = "Flags for node items."]
-    #[derive(JSTraceable, HeapSizeOf)]
+    #[derive(HeapSizeOf, JSTraceable)]
     pub flags NodeFlags: u16 {
         #[doc = "Specifies whether this node is in a document."]
         const IS_IN_DOC = 1 << 0,
 
         #[doc = "Specifies whether this node needs style recalc on next reflow."]
         const HAS_DIRTY_DESCENDANTS = 1 << 1,
         // TODO: find a better place to keep this (#4105)
         // https://critic.hoppipolla.co.uk/showcomment?chain=8873
@@ -198,17 +198,17 @@ impl Drop for Node {
     fn drop(&mut self) {
         self.style_and_layout_data.get().map(|d| self.dispose(d));
     }
 }
 
 /// suppress observers flag
 /// https://dom.spec.whatwg.org/#concept-node-insert
 /// https://dom.spec.whatwg.org/#concept-node-remove
-#[derive(Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf)]
 enum SuppressObserver {
     Suppressed,
     Unsuppressed
 }
 
 impl Node {
     /// Sends the style and layout data, if any, back to the layout thread to be destroyed.
     pub fn dispose(&self, data: OpaqueStyleAndLayoutData) {
@@ -1363,17 +1363,17 @@ impl Iterator for TreeIterator {
             return Some(current);
         };
 
         self.next_skipping_children_impl(current)
     }
 }
 
 /// Specifies whether children must be recursively cloned or not.
-#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum CloneChildrenFlag {
     CloneChildren,
     DoNotCloneChildren
 }
 
 fn as_uintptr<T>(t: &T) -> uintptr_t { t as *const T as uintptr_t }
 
 impl Node {
@@ -2526,17 +2526,17 @@ impl VirtualMethods for Node {
     // https://dom.spec.whatwg.org/#concept-node-remove
     fn unbind_from_tree(&self, context: &UnbindContext) {
         self.super_type().unwrap().unbind_from_tree(context);
         self.ranges.drain_to_parent(context, self);
     }
 }
 
 /// A summary of the changes that happened to a node.
-#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
 pub enum NodeDamage {
     /// The node's `style` attribute changed.
     NodeStyleDamaged,
     /// Other parts of a node changed; attributes, text content, etc.
     OtherNodeDamage,
 }
 
 pub enum ChildrenMutation<'a> {
--- a/servo/components/script/dom/nodelist.rs
+++ b/servo/components/script/dom/nodelist.rs
@@ -7,17 +7,17 @@ use dom::bindings::codegen::Bindings::No
 use dom::bindings::codegen::Bindings::NodeListBinding::NodeListMethods;
 use dom::bindings::js::{JS, MutNullableJS, Root, RootedReference};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::node::{ChildrenMutation, Node};
 use dom::window::Window;
 use dom_struct::dom_struct;
 use std::cell::Cell;
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 #[must_root]
 pub enum NodeListType {
     Simple(Vec<JS<Node>>),
     Children(ChildrenList),
 }
 
 // https://dom.spec.whatwg.org/#interface-nodelist
 #[dom_struct]
@@ -104,17 +104,17 @@ impl NodeList {
     }
 
     pub fn iter<'a>(&'a self) -> impl Iterator<Item=Root<Node>> + 'a {
         let len = self.Length();
         (0..len).flat_map(move |i| self.Item(i))
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 #[must_root]
 pub struct ChildrenList {
     node: JS<Node>,
     #[ignore_heap_size_of = "Defined in rust-mozjs"]
     last_visited: MutNullableJS<Node>,
     last_index: Cell<u32>,
 }
 
--- a/servo/components/script/dom/paintworkletglobalscope.rs
+++ b/servo/components/script/dom/paintworkletglobalscope.rs
@@ -462,17 +462,17 @@ pub enum PaintWorkletTask {
                                  Vec<(Atom, String)>,
                                  Vec<String>),
 }
 
 /// A paint definition
 /// https://drafts.css-houdini.org/css-paint-api/#paint-definition
 /// This type is dangerous, because it contains uboxed `Heap<JSVal>` values,
 /// which can't be moved.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 #[must_root]
 struct PaintDefinition {
     class_constructor: Heap<JSVal>,
     paint_function: Heap<JSVal>,
     constructor_valid_flag: Cell<bool>,
     context_alpha_flag: bool,
     // TODO: this should be a list of CSS syntaxes.
     input_arguments_len: usize,
--- a/servo/components/script/dom/serviceworkerglobalscope.rs
+++ b/servo/components/script/dom/serviceworkerglobalscope.rs
@@ -45,17 +45,17 @@ pub enum ServiceWorkerScriptMsg {
 }
 
 pub enum MixedMessage {
     FromServiceWorker(ServiceWorkerScriptMsg),
     FromDevtools(DevtoolScriptControlMsg),
     FromTimeoutThread(())
 }
 
-#[derive(JSTraceable, Clone)]
+#[derive(Clone, JSTraceable)]
 pub struct ServiceWorkerChan {
     pub sender: Sender<ServiceWorkerScriptMsg>
 }
 
 impl ScriptChan for ServiceWorkerChan {
     fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
         self.sender
             .send(ServiceWorkerScriptMsg::CommonWorker(WorkerScriptMsg::Common(msg)))
--- a/servo/components/script/dom/servoparser/async_html.rs
+++ b/servo/components/script/dom/servoparser/async_html.rs
@@ -490,17 +490,17 @@ fn run(sink: Sink,
                 sender.send(ToTokenizerMsg::End).unwrap();
                 break;
             },
             ToHtmlTokenizerMsg::SetPlainTextState => html_tokenizer.set_plaintext_state()
         };
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf, Default)]
+#[derive(Default, HeapSizeOf, JSTraceable)]
 struct ParseNodeData {
     contents: Option<ParseNode>,
     is_integration_point: bool,
 }
 
 pub struct Sink {
     current_line: u64,
     parse_node_data: HashMap<ParseNodeId, ParseNodeData>,
--- a/servo/components/script/dom/servoparser/mod.rs
+++ b/servo/components/script/dom/servoparser/mod.rs
@@ -733,17 +733,17 @@ fn insert(parent: &Node, reference_child
             } else {
                 let text = Text::new(String::from(t).into(), &parent.owner_doc());
                 parent.InsertBefore(text.upcast(), reference_child).unwrap();
             }
         },
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 #[must_root]
 pub struct Sink {
     base_url: ServoUrl,
     document: JS<Document>,
     current_line: u64,
     script: MutNullableJS<HTMLScriptElement>,
 }
 
--- a/servo/components/script/dom/testbinding.rs
+++ b/servo/components/script/dom/testbinding.rs
@@ -718,17 +718,17 @@ impl TestBindingMethods for TestBinding 
         let global = self.global();
         let handler = PromiseNativeHandler::new(&global,
                                                 resolve.map(SimpleHandler::new),
                                                 reject.map(SimpleHandler::new));
         let p = Promise::new(&global);
         p.append_native_handler(&handler);
         return p;
 
-        #[derive(JSTraceable, HeapSizeOf)]
+        #[derive(HeapSizeOf, JSTraceable)]
         struct SimpleHandler {
             #[ignore_heap_size_of = "Rc has unclear ownership semantics"]
             handler: Rc<SimpleCallback>,
         }
         impl SimpleHandler {
             fn new(callback: Rc<SimpleCallback>) -> Box<Callback> {
                 box SimpleHandler { handler: callback }
             }
@@ -799,17 +799,17 @@ impl TestBinding {
 }
 
 #[allow(unsafe_code)]
 impl TestBinding {
     pub unsafe fn condition_satisfied(_: *mut JSContext, _: HandleObject) -> bool { true }
     pub unsafe fn condition_unsatisfied(_: *mut JSContext, _: HandleObject) -> bool { false }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct TestBindingCallback {
     #[ignore_heap_size_of = "unclear ownership semantics"]
     promise: TrustedPromise,
     value: DOMString,
 }
 
 impl TestBindingCallback {
     #[allow(unrooted_must_root)]
--- a/servo/components/script/dom/validitystate.rs
+++ b/servo/components/script/dom/validitystate.rs
@@ -6,17 +6,17 @@ use dom::bindings::codegen::Bindings::Va
 use dom::bindings::codegen::Bindings::ValidityStateBinding::ValidityStateMethods;
 use dom::bindings::js::{JS, Root};
 use dom::bindings::reflector::{Reflector, reflect_dom_object};
 use dom::element::Element;
 use dom::window::Window;
 use dom_struct::dom_struct;
 
 // https://html.spec.whatwg.org/multipage/#validity-states
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 #[allow(dead_code)]
 pub enum ValidityStatus {
     ValueMissing,
     TypeMismatch,
     PatternMismatch,
     TooLong,
     TooShort,
     RangeUnderflow,
--- a/servo/components/script/dom/vrdisplay.rs
+++ b/servo/components/script/dom/vrdisplay.rs
@@ -74,17 +74,17 @@ pub struct VRDisplay {
     paused: Cell<bool>,
     stopped_on_pause: Cell<bool>,
 }
 
 unsafe_no_jsmanaged_fields!(WebVRDisplayData);
 unsafe_no_jsmanaged_fields!(WebVRFrameData);
 unsafe_no_jsmanaged_fields!(WebVRLayer);
 
-#[derive(Clone, Copy, PartialEq, Eq, HeapSizeOf)]
+#[derive(Clone, Copy, Eq, HeapSizeOf, PartialEq)]
 enum VRFrameDataStatus {
     Waiting,
     Synced,
     Exit
 }
 
 unsafe_no_jsmanaged_fields!(VRFrameDataStatus);
 
--- a/servo/components/script/dom/webgl_extensions/extensions.rs
+++ b/servo/components/script/dom/webgl_extensions/extensions.rs
@@ -39,17 +39,17 @@ const DEFAULT_NOT_FILTERABLE_TEX_TYPES: 
 // Param names that are implemented for getParameter WebGL function
 // but must trigger a InvalidEnum error until the related WebGL Extensions are enabled.
 // Example: https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/
 const DEFAULT_DISABLED_GET_PARAMETER_NAMES: [GLenum; 1] = [
     OESStandardDerivativesConstants::FRAGMENT_SHADER_DERIVATIVE_HINT_OES
 ];
 
 /// WebGL features that are enabled/disabled by WebGL Extensions.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct WebGLExtensionFeatures {
     gl_extensions: HashSet<String>,
     disabled_tex_types: HashSet<GLenum>,
     not_filterable_tex_types: HashSet<GLenum>,
     effective_tex_internal_formats: HashMap<TexFormatType, u32>,
     query_parameter_handlers: HashMap<GLenum, WebGLQueryParameterHandler>,
     /// WebGL Hint() targets enabled by extensions.
     hint_targets: HashSet<GLenum>,
@@ -68,17 +68,17 @@ impl Default for WebGLExtensionFeatures 
             hint_targets: HashSet::new(),
             disabled_get_parameter_names: DEFAULT_DISABLED_GET_PARAMETER_NAMES.iter().cloned().collect(),
         }
     }
 }
 
 /// Handles the list of implemented, supported and enabled WebGL extensions.
 #[must_root]
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct WebGLExtensions {
     extensions: DOMRefCell<HashMap<String, Box<WebGLExtensionWrapper>>>,
     features: DOMRefCell<WebGLExtensionFeatures>,
 }
 
 impl WebGLExtensions {
     pub fn new() -> WebGLExtensions {
         Self {
@@ -218,17 +218,17 @@ impl WebGLExtensions {
         self.register::<ext::oestexturefloatlinear::OESTextureFloatLinear>();
         self.register::<ext::oestexturehalffloat::OESTextureHalfFloat>();
         self.register::<ext::oestexturehalffloatlinear::OESTextureHalfFloatLinear>();
         self.register::<ext::oesvertexarrayobject::OESVertexArrayObject>();
     }
 }
 
 // Helper structs
-#[derive(JSTraceable, HeapSizeOf, PartialEq, Eq, Hash)]
+#[derive(Eq, Hash, HeapSizeOf, JSTraceable, PartialEq)]
 struct TexFormatType(u32, u32);
 
 type WebGLQueryParameterFunc = Fn(*mut JSContext, &WebGLRenderingContext)
                                -> Result<JSVal, WebGLError>;
 
 #[derive(HeapSizeOf)]
 struct WebGLQueryParameterHandler {
     #[ignore_heap_size_of = "Closures are hard"]
--- a/servo/components/script/dom/webgl_extensions/wrapper.rs
+++ b/servo/components/script/dom/webgl_extensions/wrapper.rs
@@ -22,17 +22,17 @@ pub trait WebGLExtensionWrapper: JSTrace
     fn is_supported(&self, &WebGLExtensions) -> bool;
     fn is_enabled(&self) -> bool;
     fn enable(&self, ext: &WebGLExtensions);
     fn name(&self) -> &'static str;
     fn as_any(&self) -> &Any;
 }
 
 #[must_root]
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct TypedWebGLExtensionWrapper<T: WebGLExtension> {
     extension: MutNullableJS<T::Extension>
 }
 
 /// Typed WebGL Extension implementation.
 /// Exposes the exact MutNullableJS<DOMObject> type defined by the extension.
 impl<T: WebGLExtension> TypedWebGLExtensionWrapper<T> {
     pub fn new() -> TypedWebGLExtensionWrapper<T> {
--- a/servo/components/script/dom/webgl_validations/types.rs
+++ b/servo/components/script/dom/webgl_validations/types.rs
@@ -4,17 +4,17 @@
 
 use dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants;
 use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
 
 /// This macro creates type-safe wrappers for WebGL types, associating variants
 /// with gl constants.
 macro_rules! type_safe_wrapper {
     ($name: ident, $($variant:ident => $mod:ident::$constant:ident, )+) => {
-        #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, JSTraceable, HeapSizeOf)]
+        #[derive(Clone, Copy, Debug, Eq, Hash, HeapSizeOf, JSTraceable, PartialEq)]
         #[repr(u32)]
         pub enum $name {
             $(
                 $variant = $mod::$constant,
             )+
         }
 
         impl $name {
--- a/servo/components/script/dom/webglframebuffer.rs
+++ b/servo/components/script/dom/webglframebuffer.rs
@@ -14,17 +14,17 @@ use dom::bindings::reflector::reflect_do
 use dom::webglobject::WebGLObject;
 use dom::webglrenderbuffer::WebGLRenderbuffer;
 use dom::webgltexture::WebGLTexture;
 use dom::window::Window;
 use dom_struct::dom_struct;
 use std::cell::Cell;
 
 #[must_root]
-#[derive(JSTraceable, Clone, HeapSizeOf)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 enum WebGLFramebufferAttachment {
     Renderbuffer(JS<WebGLRenderbuffer>),
     Texture { texture: JS<WebGLTexture>, level: i32 },
 }
 
 #[dom_struct]
 pub struct WebGLFramebuffer {
     webgl_object: WebGLObject,
--- a/servo/components/script/dom/webglshader.rs
+++ b/servo/components/script/dom/webglshader.rs
@@ -13,17 +13,17 @@ use dom::bindings::str::DOMString;
 use dom::webgl_extensions::WebGLExtensions;
 use dom::webgl_extensions::ext::oesstandardderivatives::OESStandardDerivatives;
 use dom::webglobject::WebGLObject;
 use dom::window::Window;
 use dom_struct::dom_struct;
 use std::cell::Cell;
 use std::sync::{ONCE_INIT, Once};
 
-#[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum ShaderCompilationStatus {
     NotCompiled,
     Succeeded,
     Failed,
 }
 
 #[dom_struct]
 pub struct WebGLShader {
--- a/servo/components/script/dom/webgltexture.rs
+++ b/servo/components/script/dom/webgltexture.rs
@@ -377,17 +377,17 @@ impl WebGLTexture {
 }
 
 impl Drop for WebGLTexture {
     fn drop(&mut self) {
         self.delete();
     }
 }
 
-#[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 pub struct ImageInfo {
     width: u32,
     height: u32,
     depth: u32,
     internal_format: Option<TexFormat>,
     is_initialized: bool,
     data_type: Option<TexDataType>,
 }
--- a/servo/components/script/dom/websocket.rs
+++ b/servo/components/script/dom/websocket.rs
@@ -37,17 +37,17 @@ use servo_url::ServoUrl;
 use std::ascii::AsciiExt;
 use std::borrow::ToOwned;
 use std::cell::Cell;
 use std::ptr;
 use std::thread;
 use task_source::TaskSource;
 use task_source::networking::NetworkingTaskSource;
 
-#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 enum WebSocketRequestState {
     Connecting = 0,
     Open = 1,
     Closing = 2,
     Closed = 3,
 }
 
 // Close codes defined in https://tools.ietf.org/html/rfc6455#section-7.4.1
--- a/servo/components/script/dom/window.rs
+++ b/servo/components/script/dom/window.rs
@@ -125,17 +125,17 @@ use timers::{IsInterval, TimerCallback};
 #[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
 use tinyfiledialogs::{self, MessageBoxIcon};
 use url::Position;
 use webdriver_handlers::jsval_to_webdriver;
 use webrender_api::ClipId;
 use webvr_traits::WebVRMsg;
 
 /// Current state of the window object
-#[derive(JSTraceable, Copy, Clone, Debug, PartialEq, HeapSizeOf)]
+#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
 enum WindowState {
     Alive,
     Zombie,     // Pipeline is closed, but the window hasn't been GCed yet.
 }
 
 /// Extra information concerning the reason for reflowing.
 #[derive(Debug, HeapSizeOf)]
 pub enum ReflowReason {
--- a/servo/components/script/dom/worklet.rs
+++ b/servo/components/script/dom/worklet.rs
@@ -147,17 +147,17 @@ impl WorkletMethods for Worklet {
 
         // Step 5.
         debug!("Returning promise.");
         promise
     }
 }
 
 /// A guid for worklets.
-#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, JSTraceable)]
+#[derive(Clone, Copy, Debug, Eq, Hash, JSTraceable, PartialEq)]
 pub struct WorkletId(Uuid);
 
 known_heap_size!(0, WorkletId);
 
 impl WorkletId {
     fn new() -> WorkletId {
         WorkletId(servo_rand::random())
     }
@@ -651,17 +651,17 @@ impl WorkletThread {
     {
         let msg = CommonScriptMsg::RunnableMsg(ScriptThreadEventCategory::WorkletEvent, box runnable);
         let msg = MainThreadScriptMsg::Common(msg);
         self.global_init.to_script_thread_sender.send(msg).expect("Worklet thread outlived script thread.");
     }
 }
 
 /// An executor of worklet tasks
-#[derive(Clone, JSTraceable, HeapSizeOf)]
+#[derive(Clone, HeapSizeOf, JSTraceable)]
 pub struct WorkletExecutor {
     worklet_id: WorkletId,
     #[ignore_heap_size_of = "channels are hard"]
     primary_sender: Sender<WorkletData>,
 }
 
 impl WorkletExecutor {
     fn new(worklet_id: WorkletId, primary_sender: Sender<WorkletData>) -> WorkletExecutor {
--- a/servo/components/script/dom/xmlhttprequest.rs
+++ b/servo/components/script/dom/xmlhttprequest.rs
@@ -69,26 +69,26 @@ use std::cell::Cell;
 use std::default::Default;
 use std::str;
 use std::sync::{Arc, Mutex};
 use task_source::networking::NetworkingTaskSource;
 use time;
 use timers::{OneshotTimerCallback, OneshotTimerHandle};
 use url::Position;
 
-#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 enum XMLHttpRequestState {
     Unsent = 0,
     Opened = 1,
     HeadersReceived = 2,
     Loading = 3,
     Done = 4,
 }
 
-#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub struct GenerationId(u32);
 
 /// Closure of required data for each async network event that comprises the
 /// XHR's response.
 struct XHRContext {
     xhr: TrustedXHRAddress,
     gen_id: GenerationId,
     buf: DOMRefCell<Vec<u8>>,
@@ -1330,17 +1330,17 @@ impl XMLHttpRequest {
             match self.response_headers.borrow().get() {
                 Some(&ContentType(ref mime)) => { Some(mime.clone()) },
                 None => { None }
             }
         }
     }
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct XHRTimeoutCallback {
     #[ignore_heap_size_of = "Because it is non-owning"]
     xhr: Trusted<XMLHttpRequest>,
     generation_id: GenerationId,
 }
 
 impl XHRTimeoutCallback {
     pub fn invoke(self) {
--- a/servo/components/script/microtask.rs
+++ b/servo/components/script/microtask.rs
@@ -16,39 +16,39 @@ use dom::htmlmediaelement::MediaElementM
 use dom::mutationobserver::MutationObserver;
 use msg::constellation_msg::PipelineId;
 use script_thread::ScriptThread;
 use std::cell::Cell;
 use std::mem;
 use std::rc::Rc;
 
 /// A collection of microtasks in FIFO order.
-#[derive(JSTraceable, HeapSizeOf, Default)]
+#[derive(Default, HeapSizeOf, JSTraceable)]
 pub struct MicrotaskQueue {
     /// The list of enqueued microtasks that will be invoked at the next microtask checkpoint.
     microtask_queue: DOMRefCell<Vec<Microtask>>,
     /// https://html.spec.whatwg.org/multipage/#performing-a-microtask-checkpoint
     performing_a_microtask_checkpoint: Cell<bool>,
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub enum Microtask {
     Promise(EnqueuedPromiseCallback),
     MediaElement(MediaElementMicrotask),
     ImageElement(ImageElementMicrotask),
     CustomElementReaction,
     NotifyMutationObservers,
 }
 
 pub trait MicrotaskRunnable {
     fn handler(&self) {}
 }
 
 /// A promise callback scheduled to run during the next microtask checkpoint (#4283).
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct EnqueuedPromiseCallback {
     #[ignore_heap_size_of = "Rc has unclear ownership"]
     pub callback: Rc<PromiseJobCallback>,
     pub pipeline: PipelineId,
 }
 
 impl MicrotaskQueue {
     /// Add a new microtask to this queue. It will be invoked as part of the next
--- a/servo/components/script/serviceworkerjob.rs
+++ b/servo/components/script/serviceworkerjob.rs
@@ -21,17 +21,17 @@ use js::jsapi::JSAutoCompartment;
 use script_thread::{ScriptThread, Runnable};
 use servo_url::ServoUrl;
 use std::cmp::PartialEq;
 use std::collections::HashMap;
 use std::rc::Rc;
 use task_source::TaskSource;
 use task_source::dom_manipulation::DOMManipulationTaskSource;
 
-#[derive(PartialEq, Copy, Clone, Debug, JSTraceable)]
+#[derive(Clone, Copy, Debug, JSTraceable, PartialEq)]
 pub enum JobType {
     Register,
     Unregister,
     Update
 }
 
 #[derive(Clone)]
 pub enum SettleType {
--- a/servo/components/script/task_source/dom_manipulation.rs
+++ b/servo/components/script/task_source/dom_manipulation.rs
@@ -9,17 +9,17 @@ use dom::eventtarget::EventTarget;
 use dom::window::Window;
 use script_thread::{MainThreadScriptMsg, Runnable, RunnableWrapper, ScriptThread};
 use servo_atoms::Atom;
 use std::fmt;
 use std::result::Result;
 use std::sync::mpsc::Sender;
 use task_source::TaskSource;
 
-#[derive(JSTraceable, Clone)]
+#[derive(Clone, JSTraceable)]
 pub struct DOMManipulationTaskSource(pub Sender<MainThreadScriptMsg>);
 
 impl fmt::Debug for DOMManipulationTaskSource {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "DOMManipulationTaskSource(...)")
     }
 }
 
--- a/servo/components/script/task_source/performance_timeline.rs
+++ b/servo/components/script/task_source/performance_timeline.rs
@@ -11,17 +11,17 @@ use dom::bindings::refcounted::Trusted;
 use dom::performance::{NotifyPerformanceObserverRunnable, Performance};
 use dom::window::Window;
 use script_thread::{MainThreadScriptMsg, Runnable, RunnableWrapper, ScriptThread};
 use std::fmt;
 use std::result::Result;
 use std::sync::mpsc::Sender;
 use task_source::TaskSource;
 
-#[derive(JSTraceable, Clone)]
+#[derive(Clone, JSTraceable)]
 pub struct PerformanceTimelineTaskSource(pub Sender<MainThreadScriptMsg>);
 
 impl fmt::Debug for PerformanceTimelineTaskSource {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "PerformanceTimelineTaskSource(...)")
     }
 }
 
--- a/servo/components/script/task_source/user_interaction.rs
+++ b/servo/components/script/task_source/user_interaction.rs
@@ -9,17 +9,17 @@ use dom::eventtarget::EventTarget;
 use dom::window::Window;
 use script_thread::{MainThreadScriptMsg, Runnable, RunnableWrapper, ScriptThread};
 use servo_atoms::Atom;
 use std::fmt;
 use std::result::Result;
 use std::sync::mpsc::Sender;
 use task_source::TaskSource;
 
-#[derive(JSTraceable, Clone)]
+#[derive(Clone, JSTraceable)]
 pub struct UserInteractionTaskSource(pub Sender<MainThreadScriptMsg>);
 
 impl fmt::Debug for UserInteractionTaskSource {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "UserInteractionTaskSource(...)")
     }
 }
 
--- a/servo/components/script/textinput.rs
+++ b/servo/components/script/textinput.rs
@@ -11,23 +11,23 @@ use msg::constellation_msg::{ALT, CONTRO
 use msg::constellation_msg::{Key, KeyModifiers};
 use std::borrow::ToOwned;
 use std::cmp::{max, min};
 use std::default::Default;
 use std::ops::Range;
 use std::usize;
 use unicode_segmentation::UnicodeSegmentation;
 
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 pub enum Selection {
     Selected,
     NotSelected
 }
 
-#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum SelectionDirection {
     Forward,
     Backward,
     None,
 }
 
 impl From<DOMString> for SelectionDirection {
     fn from(direction: DOMString) -> SelectionDirection {
@@ -44,26 +44,26 @@ impl From<SelectionDirection> for DOMStr
         match direction {
             SelectionDirection::Forward => DOMString::from("forward"),
             SelectionDirection::Backward => DOMString::from("backward"),
             SelectionDirection::None => DOMString::from("none"),
         }
     }
 }
 
-#[derive(JSTraceable, Copy, Clone, HeapSizeOf, PartialEq)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub struct TextPoint {
     /// 0-based line number
     pub line: usize,
     /// 0-based column number in UTF-8 bytes
     pub index: usize,
 }
 
 /// Encapsulated state for handling keyboard input in a single or multiline text input control.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct TextInput<T: ClipboardProvider> {
     /// Current text input content, split across lines without trailing '\n'
     lines: Vec<DOMString>,
     /// Current cursor input point
     pub edit_point: TextPoint,
     /// Beginning of selection range with edit_point as end that can span multiple lines.
     pub selection_begin: Option<TextPoint>,
     /// Is this a multiline input?
@@ -91,24 +91,24 @@ impl Default for TextPoint {
         TextPoint {
             line: 0,
             index: 0,
         }
     }
 }
 
 /// Control whether this control should allow multiple lines.
-#[derive(PartialEq, Eq)]
+#[derive(Eq, PartialEq)]
 pub enum Lines {
     Single,
     Multiple,
 }
 
 /// The direction in which to delete a character.
-#[derive(PartialEq, Eq, Copy, Clone)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 pub enum Direction {
     Forward,
     Backward
 }
 
 
 /// Was the keyboard event accompanied by the standard control modifier,
 /// i.e. cmd on Mac OS or ctrl on other platforms.
--- a/servo/components/script/timers.rs
+++ b/servo/components/script/timers.rs
@@ -22,17 +22,17 @@ use script_traits::{TimerEvent, TimerEve
 use script_traits::{TimerSchedulerMsg, TimerSource};
 use servo_config::prefs::PREFS;
 use std::cell::Cell;
 use std::cmp::{self, Ord, Ordering};
 use std::collections::HashMap;
 use std::default::Default;
 use std::rc::Rc;
 
-#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)]
+#[derive(Clone, Copy, Debug, Eq, Hash, HeapSizeOf, JSTraceable, Ord, PartialEq, PartialOrd)]
 pub struct OneshotTimerHandle(i32);
 
 #[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
 pub struct OneshotTimers {
     js_timers: JsTimers,
     #[ignore_heap_size_of = "Defined in std"]
     timer_event_chan: IpcSender<TimerEvent>,
     #[ignore_heap_size_of = "Defined in std"]
@@ -60,17 +60,17 @@ struct OneshotTimer {
     source: TimerSource,
     callback: OneshotTimerCallback,
     scheduled_for: MsDuration,
 }
 
 // This enum is required to work around the fact that trait objects do not support generic methods.
 // A replacement trait would have a method such as
 //     `invoke<T: DomObject>(self: Box<Self>, this: &T, js_timers: &JsTimers);`.
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub enum OneshotTimerCallback {
     XhrTimeout(XHRTimeoutCallback),
     EventSourceTimeout(EventSourceTimeoutCallback),
     JsTimer(JsTimerTask),
     TestBindingCallback(TestBindingCallback),
     FakeRequestAnimationFrame(FakeRequestAnimationFrameCallback),
 }
 
@@ -296,63 +296,63 @@ impl OneshotTimers {
                                                source)
     }
 
     pub fn clear_timeout_or_interval(&self, global: &GlobalScope, handle: i32) {
         self.js_timers.clear_timeout_or_interval(global, handle)
     }
 }
 
-#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord)]
+#[derive(Clone, Copy, Eq, Hash, HeapSizeOf, JSTraceable, Ord, PartialEq, PartialOrd)]
 pub struct JsTimerHandle(i32);
 
 #[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
 pub struct JsTimers {
     next_timer_handle: Cell<JsTimerHandle>,
     active_timers: DOMRefCell<HashMap<JsTimerHandle, JsTimerEntry>>,
     /// The nesting level of the currently executing timer task or 0.
     nesting_level: Cell<u32>,
     /// Used to introduce a minimum delay in event intervals
     min_duration: Cell<Option<MsDuration>>,
 }
 
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 struct JsTimerEntry {
     oneshot_handle: OneshotTimerHandle,
 }
 
 // Holder for the various JS values associated with setTimeout
 // (ie. function value to invoke and all arguments to pass
 //      to the function when calling it)
 // TODO: Handle rooting during invocation when movable GC is turned on
-#[derive(JSTraceable, HeapSizeOf)]
+#[derive(HeapSizeOf, JSTraceable)]
 pub struct JsTimerTask {
     #[ignore_heap_size_of = "Because it is non-owning"]
     handle: JsTimerHandle,
     source: TimerSource,
     callback: InternalTimerCallback,
     is_interval: IsInterval,
     nesting_level: u32,
     duration: MsDuration,
 }
 
 // Enum allowing more descriptive values for the is_interval field
-#[derive(JSTraceable, PartialEq, Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
 pub enum IsInterval {
     Interval,
     NonInterval,
 }
 
 #[derive(Clone)]
 pub enum TimerCallback {
     StringTimerCallback(DOMString),
     FunctionTimerCallback(Rc<Function>),
 }
 
-#[derive(JSTraceable, Clone)]
+#[derive(Clone, JSTraceable)]
 enum InternalTimerCallback {
     StringTimerCallback(DOMString),
     FunctionTimerCallback(Rc<Function>, Rc<Box<[Heap<JSVal>]>>),
 }
 
 impl HeapSizeOf for InternalTimerCallback {
     fn heap_size_of_children(&self) -> usize {
         // FIXME: Rc<T> isn't HeapSizeOf and we can't ignore it due to #6870 and #6871
--- a/servo/components/script_layout_interface/lib.rs
+++ b/servo/components/script_layout_interface/lib.rs
@@ -69,17 +69,17 @@ impl StyleData {
     pub fn new() -> Self {
         Self {
             element_data: AtomicRefCell::new(ElementData::default()),
             parallel: DomParallelInfo::new(),
         }
     }
 }
 
-#[derive(Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, HeapSizeOf)]
 pub struct OpaqueStyleAndLayoutData {
     // NB: We really store a `StyleAndLayoutData` here, so be careful!
     #[ignore_heap_size_of = "TODO(#6910) Box value that should be counted but \
                              the type lives in layout"]
     pub ptr: NonZero<*mut StyleData>
 }
 
 #[allow(unsafe_code)]
@@ -96,23 +96,23 @@ impl DomParallelInfo {
     pub fn new() -> DomParallelInfo {
         DomParallelInfo {
             children_to_process: AtomicIsize::new(0),
         }
     }
 }
 
 
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum LayoutNodeType {
     Element(LayoutElementType),
     Text,
 }
 
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum LayoutElementType {
     Element,
     HTMLCanvasElement,
     HTMLIFrameElement,
     HTMLImageElement,
     HTMLInputElement,
     HTMLObjectElement,
     HTMLTableCellElement,
@@ -136,17 +136,17 @@ pub struct HTMLCanvasData {
 }
 
 pub struct SVGSVGData {
     pub width: u32,
     pub height: u32,
 }
 
 /// The address of a node known to be valid. These are sent from script to layout.
-#[derive(Clone, Debug, PartialEq, Eq, Copy)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub struct TrustedNodeAddress(pub *const c_void);
 
 #[allow(unsafe_code)]
 unsafe impl Send for TrustedNodeAddress {}
 
 pub fn is_image_data(uri: &str) -> bool {
     static TYPES: &'static [&'static str] = &["data:image/png", "data:image/gif", "data:image/jpeg"];
     TYPES.iter().any(|&type_| uri.starts_with(type_))
--- a/servo/components/script_layout_interface/reporter.rs
+++ b/servo/components/script_layout_interface/reporter.rs
@@ -6,17 +6,17 @@ use cssparser::SourceLocation;
 use ipc_channel::ipc::IpcSender;
 use log;
 use msg::constellation_msg::PipelineId;
 use script_traits::ConstellationControlMsg;
 use servo_url::ServoUrl;
 use std::sync::{Mutex, Arc};
 use style::error_reporting::{ParseErrorReporter, ContextualParseError};
 
-#[derive(HeapSizeOf, Clone)]
+#[derive(Clone, HeapSizeOf)]
 pub struct CSSErrorReporter {
     pub pipelineid: PipelineId,
     // Arc+Mutex combo is necessary to make this struct Sync,
     // which is necessary to fulfill the bounds required by the
     // uses of the ParseErrorReporter trait.
     #[ignore_heap_size_of = "Arc is defined in libstd"]
     pub script_chan: Arc<Mutex<IpcSender<ConstellationControlMsg>>>,
 }
--- a/servo/components/script_layout_interface/wrapper_traits.rs
+++ b/servo/components/script_layout_interface/wrapper_traits.rs
@@ -23,17 +23,17 @@ use style::data::ElementData;
 use style::dom::{LayoutIterator, NodeInfo, PresentationalHintsSynthesizer, TNode};
 use style::dom::OpaqueNode;
 use style::font_metrics::ServoMetricsProvider;
 use style::properties::{CascadeFlags, ComputedValues};
 use style::selector_parser::{PseudoElement, PseudoElementCascadeType, SelectorImpl};
 use style::stylist::RuleInclusion;
 use webrender_api::ClipId;
 
-#[derive(Copy, PartialEq, Clone, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum PseudoElementType<T> {
     Normal,
     Before(T),
     After(T),
     DetailsSummary(T),
     DetailsContent(T),
 }
 
--- a/servo/components/script_traits/lib.rs
+++ b/servo/components/script_traits/lib.rs
@@ -72,17 +72,17 @@ use webdriver_msg::{LoadStatus, WebDrive
 use webrender_api::{ClipId, DevicePixel, ImageKey};
 use webvr_traits::{WebVREvent, WebVRMsg};
 
 pub use script_msg::{LayoutMsg, ScriptMsg, EventResult, LogEntry};
 pub use script_msg::{ServiceWorkerMsg, ScopeThings, SWManagerMsg, SWManagerSenders, DOMMessage};
 
 /// The address of a node. Layout sends these back. They must be validated via
 /// `from_untrusted_node_address` before they can be used, because we do not trust layout.
-#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
 pub struct UntrustedNodeAddress(pub *const c_void);
 
 impl HeapSizeOf for UntrustedNodeAddress {
     fn heap_size_of_children(&self) -> usize {
         0
     }
 }
 
@@ -191,31 +191,31 @@ pub struct NewLayoutInfo {
     pub pipeline_port: IpcReceiver<LayoutControlMsg>,
     /// A shutdown channel so that layout can tell the content process to shut down when it's done.
     pub content_process_shutdown_chan: Option<IpcSender<()>>,
     /// Number of threads to use for layout.
     pub layout_threads: usize,
 }
 
 /// When a pipeline is closed, should its browsing context be discarded too?
-#[derive(Copy, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, Eq, Hash, PartialEq, Serialize)]
 pub enum DiscardBrowsingContext {
     /// Discard the browsing context
     Yes,
     /// Don't discard the browsing context
     No,
 }
 
 /// Is a document fully active, active or inactive?
 /// A document is active if it is the current active document in its session history,
 /// it is fuly active if it is active and all of its ancestors are active,
 /// and it is inactive otherwise.
 /// https://html.spec.whatwg.org/multipage/#active-document
 /// https://html.spec.whatwg.org/multipage/#fully-active
-#[derive(Copy, Clone, PartialEq, Eq, Hash, HeapSizeOf, Debug, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub enum DocumentActivity {
     /// An inactive document
     Inactive,
     /// An active but not fully active document
     Active,
     /// A fully active document
     FullyActive,
 }
@@ -225,17 +225,17 @@ pub enum DocumentActivity {
 pub enum PaintMetricType {
     /// Time to First Paint type.
     FirstPaint,
     /// Time to First Contentful Paint type.
     FirstContentfulPaint,
 }
 
 /// The reason why the pipeline id of an iframe is being updated.
-#[derive(Copy, Clone, PartialEq, Eq, Hash, HeapSizeOf, Debug, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
 pub enum UpdatePipelineIdReason {
     /// The pipeline id is being updated due to a navigation.
     Navigation,
     /// The pipeline id is being updated due to a history traversal.
     Traversal,
 }
 
 /// Messages sent from the constellation or layout to the script thread.
@@ -347,27 +347,27 @@ impl fmt::Debug for ConstellationControl
             WebVREvents(..) => "WebVREvents",
             PaintMetric(..) => "PaintMetric",
         };
         write!(formatter, "ConstellationMsg::{}", variant)
     }
 }
 
 /// Used to determine if a script has any pending asynchronous activity.
-#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
 pub enum DocumentState {
     /// The document has been loaded and is idle.
     Idle,
     /// The document is either loading or waiting on an event.
     Pending,
 }
 
 /// For a given pipeline, whether any animations are currently running
 /// and any animation callbacks are queued
-#[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)]
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
 pub enum AnimationState {
     /// Animations are active but no callbacks are queued
     AnimationsPresent,
     /// Animations are active and callbacks are queued
     AnimationCallbacksPresent,
     /// No animations are active and no callbacks are queued
     NoAnimationsPresent,
     /// No animations are active but callbacks are queued
@@ -385,17 +385,17 @@ pub enum TouchEventType {
     Up,
     /// The system stopped tracking a touch point.
     Cancel,
 }
 
 /// An opaque identifier for a touch point.
 ///
 /// http://w3c.github.io/touch-events/#widl-Touch-identifier
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
 pub struct TouchId(pub i32);
 
 /// The mouse button involved in the event.
 #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
 pub enum MouseButton {
     /// The left mouse button.
     Left,
     /// The middle mouse button.
@@ -428,17 +428,17 @@ pub enum CompositorEvent {
     TouchEvent(TouchEventType, TouchId, Point2D<f32>),
     /// Touchpad pressure event
     TouchpadPressureEvent(Point2D<f32>, f32, TouchpadPressurePhase),
     /// A key was pressed.
     KeyEvent(Option<char>, Key, KeyState, KeyModifiers),
 }
 
 /// Touchpad pressure phase for `TouchpadPressureEvent`.
-#[derive(Copy, Clone, HeapSizeOf, PartialEq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum TouchpadPressurePhase {
     /// Pressure before a regular click.
     BeforeClick,
     /// Pressure after a regular click.
     AfterFirstClick,
     /// Pressure after a "forceTouch" click
     AfterSecondClick,
 }
@@ -458,26 +458,26 @@ pub enum TimerSchedulerMsg {
 
 /// Notifies the script thread to fire due timers.
 /// `TimerSource` must be `FromWindow` when dispatched to `ScriptThread` and
 /// must be `FromWorker` when dispatched to a `DedicatedGlobalWorkerScope`
 #[derive(Debug, Deserialize, Serialize)]
 pub struct TimerEvent(pub TimerSource, pub TimerEventId);
 
 /// Describes the thread that requested the TimerEvent.
-#[derive(Copy, Clone, Debug, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub enum TimerSource {
     /// The event was requested from a window (ScriptThread).
     FromWindow(PipelineId),
     /// The event was requested from a worker (DedicatedGlobalWorkerScope).
     FromWorker,
 }
 
 /// The id to be used for a `TimerEvent` is defined by the corresponding `TimerEventRequest`.
-#[derive(PartialEq, Eq, Copy, Clone, Debug, HeapSizeOf, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
 pub struct TimerEventId(pub u32);
 
 /// Unit of measurement.
 #[derive(Clone, Copy, HeapSizeOf)]
 pub enum Milliseconds {}
 /// Unit of measurement.
 #[derive(Clone, Copy, HeapSizeOf)]
 pub enum Nanoseconds {}
@@ -550,17 +550,17 @@ pub trait ScriptThreadFactory {
     /// Type of message sent from script to layout.
     type Message;
     /// Create a `ScriptThread`.
     fn create(state: InitialScriptState, load_data: LoadData)
         -> (Sender<Self::Message>, Receiver<Self::Message>);
 }
 
 /// Whether the sandbox attribute is present for an iframe element
-#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
 pub enum IFrameSandboxState {
     /// Sandbox attribute is present
     IFrameSandboxed,
     /// Sandbox attribute is not present
     IFrameUnsandboxed,
 }
 
 /// Specifies the information required to load an iframe.
@@ -690,37 +690,37 @@ impl MozBrowserErrorType {
 pub enum AnimationTickType {
     /// The script thread.
     Script,
     /// The layout thread.
     Layout,
 }
 
 /// The scroll state of a stacking context.
-#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
 pub struct ScrollState {
     /// The ID of the scroll root.
     pub scroll_root_id: ClipId,
     /// The scrolling offset of this stacking context.
     pub scroll_offset: Vector2D<f32>,
 }
 
 /// Data about the window size.
-#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
 pub struct WindowSizeData {
     /// The size of the initial layout viewport, before parsing an
     /// http://www.w3.org/TR/css-device-adapt/#initial-viewport
     pub initial_viewport: TypedSize2D<f32, CSSPixel>,
 
     /// The resolution of the window in dppx, not including any "pinch zoom" factor.
     pub device_pixel_ratio: ScaleFactor<f32, CSSPixel, DevicePixel>,
 }
 
 /// The type of window size change.
-#[derive(Deserialize, Eq, PartialEq, Serialize, Copy, Clone, HeapSizeOf)]
+#[derive(Clone, Copy, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
 pub enum WindowSizeType {
     /// Initial load.
     Initial,
     /// Window resize.
     Resize,
 }
 
 /// Messages to the constellation originating from the WebDriver server.
@@ -781,17 +781,17 @@ pub enum ConstellationMsg {
     NewBrowser(ServoUrl, IpcSender<TopLevelBrowsingContextId>),
     /// Close a top level browsing context.
     CloseBrowser(TopLevelBrowsingContextId),
     /// Make browser visible.
     SelectBrowser(TopLevelBrowsingContextId),
 }
 
 /// Resources required by workerglobalscopes
-#[derive(Serialize, Deserialize, Clone)]
+#[derive(Clone, Deserialize, Serialize)]
 pub struct WorkerGlobalScopeInit {
     /// Chan to a resource thread
     pub resource_threads: ResourceThreads,
     /// Chan to the memory profiler
     pub mem_profiler_chan: mem::ProfilerChan,
     /// Chan to the time profiler
     pub time_profiler_chan: profile_time::ProfilerChan,
     /// To devtools sender
@@ -806,28 +806,28 @@ pub struct WorkerGlobalScopeInit {
     pub worker_id: WorkerId,
     /// The pipeline id
     pub pipeline_id: PipelineId,
     /// The origin
     pub origin: ImmutableOrigin,
 }
 
 /// Common entities representing a network load origin
-#[derive(Deserialize, Serialize, Clone)]
+#[derive(Clone, Deserialize, Serialize)]
 pub struct WorkerScriptLoadOrigin {
     /// referrer url
     pub referrer_url: Option<ServoUrl>,
     /// the referrer policy which is used
     pub referrer_policy: Option<ReferrerPolicy>,
     /// the pipeline id of the entity requesting the load
     pub pipeline_id: Option<PipelineId>,
 }
 
 /// Errors from executing a paint worklet
-#[derive(Debug, Deserialize, Serialize, Clone)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
 pub enum PaintWorkletError {
     /// Execution timed out.
     Timeout,
     /// No such worklet.
     WorkletNotFound,
 }
 
 impl From<RecvTimeoutError> for PaintWorkletError {
@@ -844,32 +844,32 @@ pub trait Painter: SpeculativePainter {
                           zoom: ScaleFactor<f32, CSSPixel, DevicePixel>,
                           properties: Vec<(Atom, String)>,
                           arguments: Vec<String>)
                           -> DrawAPaintImageResult;
 }
 
 /// The result of executing paint code: the image together with any image URLs that need to be loaded.
 /// TODO: this should return a WR display list. https://github.com/servo/servo/issues/17497
-#[derive(Debug, Deserialize, Serialize, Clone, HeapSizeOf)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub struct DrawAPaintImageResult {
     /// The image height
     pub width: u32,
     /// The image width
     pub height: u32,
     /// The image format
     pub format: PixelFormat,
     /// The image drawn, or None if an invalid paint image was drawn
     pub image_key: Option<ImageKey>,
     /// Drawing the image might have requested loading some image URLs.
     pub missing_image_urls: Vec<ServoUrl>,
 }
 
 /// A Script to Constellation channel.
-#[derive(Deserialize, Serialize, Clone)]
+#[derive(Clone, Deserialize, Serialize)]
 pub struct ScriptToConstellationChan {
     /// Sender for communicating with constellation thread.
     pub sender: IpcSender<(PipelineId, ScriptMsg)>,
     /// Used to identify the origin of the message.
     pub pipeline_id: PipelineId,
 }
 
 impl ScriptToConstellationChan {
--- a/servo/components/script_traits/script_msg.rs
+++ b/servo/components/script_traits/script_msg.rs
@@ -158,32 +158,32 @@ pub enum ScriptMsg {
     RegisterServiceWorker(ScopeThings, ServoUrl),
     /// Enter or exit fullscreen
     SetFullscreenState(bool),
     /// Requests that the compositor shut down.
     Exit,
 }
 
 /// Entities required to spawn service workers
-#[derive(Deserialize, Serialize, Clone)]
+#[derive(Clone, Deserialize, Serialize)]
 pub struct ScopeThings {
     /// script resource url
     pub script_url: ServoUrl,
     /// network load origin of the resource
     pub worker_load_origin: WorkerScriptLoadOrigin,
     /// base resources required to create worker global scopes
     pub init: WorkerGlobalScopeInit,
     /// the port to receive devtools message from
     pub devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
     /// service worker id
     pub worker_id: WorkerId,
 }
 
 /// Message that gets passed to service worker scope on postMessage
-#[derive(Deserialize, Serialize, Debug, Clone)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
 pub struct DOMMessage(pub Vec<u8>);
 
 /// Channels to allow service worker manager to communicate with constellation and resource thread
 pub struct SWManagerSenders {
     /// sender for communicating with constellation
     pub swmanager_sender: IpcSender<SWManagerMsg>,
     /// sender for communicating with resource thread
     pub resource_sender: IpcSender<CoreResourceMsg>,
--- a/servo/components/selectors/attr.rs
+++ b/servo/components/selectors/attr.rs
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use cssparser::ToCss;
 use parser::SelectorImpl;
 use std::ascii::AsciiExt;
 use std::fmt;
 
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub struct AttrSelectorWithNamespace<Impl: SelectorImpl> {
     pub namespace: NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>,
     pub local_name: Impl::LocalName,
     pub local_name_lower: Impl::LocalName,
     pub operation: ParsedAttrSelectorOperation<Impl::AttrValue>,
     pub never_matches: bool,
 }
 
@@ -22,35 +22,35 @@ impl<Impl: SelectorImpl> AttrSelectorWit
             NamespaceConstraint::Any => NamespaceConstraint::Any,
             NamespaceConstraint::Specific((_, ref url)) => {
                 NamespaceConstraint::Specific(url)
             }
         }
     }
 }
 
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub enum NamespaceConstraint<NamespaceUrl> {
     Any,
 
     /// Empty string for no namespace
     Specific(NamespaceUrl),
 }
 
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub enum ParsedAttrSelectorOperation<AttrValue> {
     Exists,
     WithValue {
         operator: AttrSelectorOperator,
         case_sensitivity: ParsedCaseSensitivity,
         expected_value: AttrValue,
     }
 }
 
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub enum AttrSelectorOperation<AttrValue> {
     Exists,
     WithValue {
         operator: AttrSelectorOperator,
         case_sensitivity: CaseSensitivity,
         expected_value: AttrValue,
     }
 }
@@ -61,17 +61,17 @@ impl<AttrValue> AttrSelectorOperation<At
             AttrSelectorOperation::Exists => true,
             AttrSelectorOperation::WithValue { operator, case_sensitivity, ref expected_value } => {
                 operator.eval_str(element_attr_value, expected_value.as_ref(), case_sensitivity)
             }
         }
     }
 }
 
-#[derive(Eq, PartialEq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 pub enum AttrSelectorOperator {
     Equal,
     Includes,
     DashMatch,
     Prefix,
     Substring,
     Suffix,
 }
@@ -122,17 +122,17 @@ impl AttrSelectorOperator {
             }
         }
     }
 }
 
 /// The definition of whitespace per CSS Selectors Level 3 § 4.
 pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C'];
 
-#[derive(Eq, PartialEq, Clone, Copy, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum ParsedCaseSensitivity {
     CaseSensitive,
     AsciiCaseInsensitive,
     AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument,
 }
 
 impl ParsedCaseSensitivity {
     pub fn to_unconditional(self, is_html_element_in_html_document: bool) -> CaseSensitivity {
@@ -145,17 +145,17 @@ impl ParsedCaseSensitivity {
                 CaseSensitivity::CaseSensitive
             }
             ParsedCaseSensitivity::CaseSensitive => CaseSensitivity::CaseSensitive,
             ParsedCaseSensitivity::AsciiCaseInsensitive => CaseSensitivity::AsciiCaseInsensitive,
         }
     }
 }
 
-#[derive(Eq, PartialEq, Clone, Copy, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum CaseSensitivity {
     CaseSensitive,
     AsciiCaseInsensitive,
 }
 
 impl CaseSensitivity {
     pub fn eq(self, a: &[u8], b: &[u8]) -> bool {
         match self {
--- a/servo/components/selectors/builder.rs
+++ b/servo/components/selectors/builder.rs
@@ -178,17 +178,17 @@ impl<'a, Impl: SelectorImpl> Iterator fo
 }
 
 fn split_from_end<T>(s: &[T], at: usize) -> (&[T], &[T]) {
     s.split_at(s.len() - at)
 }
 
 pub const HAS_PSEUDO_BIT: u32 = 1 << 30;
 
-#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub struct SpecificityAndFlags(pub u32);
 
 impl SpecificityAndFlags {
     pub fn specificity(&self) -> u32 {
         self.0 & !HAS_PSEUDO_BIT
     }
 
     pub fn has_pseudo_element(&self) -> bool {
--- a/servo/components/selectors/context.rs
+++ b/servo/components/selectors/context.rs
@@ -4,17 +4,17 @@
 
 use attr::CaseSensitivity;
 use bloom::BloomFilter;
 
 /// What kind of selector matching mode we should use.
 ///
 /// There are two modes of selector matching. The difference is only noticeable
 /// in presence of pseudo-elements.
-#[derive(Debug, PartialEq, Copy, Clone)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum MatchingMode {
     /// Don't ignore any pseudo-element selectors.
     Normal,
 
     /// Ignores any stateless pseudo-element selectors in the rightmost sequence
     /// of simple selectors.
     ///
     /// This is useful, for example, to match against ::before when you aren't a
@@ -24,17 +24,17 @@ pub enum MatchingMode {
     /// `::before` would be ignored as in "matching".
     ///
     /// It's required for all the selectors you match using this mode to have a
     /// pseudo-element.
     ForStatelessPseudoElement,
 }
 
 /// The mode to use when matching unvisited and visited links.
-#[derive(PartialEq, Eq, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum VisitedHandlingMode {
     /// All links are matched as if they are unvisted.
     AllLinksUnvisited,
     /// All links are matched as if they are visited and unvisited (both :link
     /// and :visited match).
     ///
     /// This is intended to be used from invalidation code, to be conservative
     /// about whether we need to restyle a link.
@@ -43,17 +43,17 @@ pub enum VisitedHandlingMode {
     /// or the nearest ancestor link. The relevant link is matched as though it
     /// is visited, and all other links are matched as if they are unvisited.
     RelevantLinkVisited,
 }
 
 /// Which quirks mode is this document in.
 ///
 /// See: https://quirks.spec.whatwg.org/
-#[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)]
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
 pub enum QuirksMode {
     /// Quirks mode.
     Quirks,
     /// Limited quirks mode.
     LimitedQuirks,
     /// No quirks mode.
     NoQuirks,
 }
--- a/servo/components/selectors/gecko_like_types.rs
+++ b/servo/components/selectors/gecko_like_types.rs
@@ -1,27 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! These types need to have the same size and alignment as the respectively corresponding
 //! types in components/style/gecko/selector_parser.rs
 
-#[derive(Eq, PartialEq, Clone, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 #[allow(dead_code)]
 pub enum PseudoClass {
     Bare,
     String(Box<[u16]>),
     MozAny(Box<[()]>),
 }
 
-#[derive(Eq, PartialEq, Clone, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub enum PseudoElement {
     A,
     B,
     Tree(Box<[String]>),
 }
 
-#[derive(Eq, PartialEq, Clone, Debug, Default)]
+#[derive(Clone, Debug, Default, Eq, PartialEq)]
 pub struct Atom(usize);
 
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub struct Impl;
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -210,17 +210,17 @@ fn may_match<E>(hashes: &AncestorHashes,
 /// complex selector. A "relevant link" is the element being matched if it is a
 /// link or the nearest ancestor link.
 ///
 /// `matches_complex_selector` creates a new instance of this for each complex
 /// selector we try to match for an element. This is done because `is_visited`
 /// and `is_unvisited` are based on relevant link state of only the current
 /// complex selector being matched (not the global relevant link status for all
 /// selectors in `MatchingContext`).
-#[derive(PartialEq, Eq, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum RelevantLinkStatus {
     /// Looking for a possible relevant link.  This is the initial mode when
     /// matching a selector.
     Looking,
     /// Not looking for a relevant link.  We transition to this mode if we
     /// encounter a sibiling combinator (since only ancestor combinators are
     /// allowed for this purpose).
     NotLooking,
@@ -347,17 +347,17 @@ impl RelevantLinkStatus {
 /// The selectors ("b1 + b2 ~") doesn't match and matching restart from "d1".
 ///
 /// The additional example is child and sibling. When the selector
 /// "b1 + c1 > b2 ~ d1 a" is provided and the selector "b1" doesn't match on
 /// the element, this "b1" raises NotMatchedAndRestartFromClosestLaterSibling.
 /// However since the selector "c1" raises
 /// NotMatchedAndRestartFromClosestDescendant. So the selector
 /// "b1 + c1 > b2 ~ " doesn't match and restart matching from "d1".
-#[derive(PartialEq, Eq, Copy, Clone)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 enum SelectorMatchingResult {
     Matched,
     NotMatchedAndRestartFromClosestLaterSibling,
     NotMatchedAndRestartFromClosestDescendant,
     NotMatchedGlobally,
 }
 
 /// Matches a selector, fast-rejecting against a bloom filter.
--- a/servo/components/selectors/parser.rs
+++ b/servo/components/selectors/parser.rs
@@ -165,17 +165,17 @@ pub trait Parser<'i> {
     }
 
     fn namespace_for_prefix(&self, _prefix: &<Self::Impl as SelectorImpl>::NamespacePrefix)
                             -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl> {
         None
     }
 }
 
-#[derive(PartialEq, Eq, Clone, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub struct SelectorList<Impl: SelectorImpl>(pub Vec<Selector<Impl>>);
 
 impl<Impl: SelectorImpl> SelectorList<Impl> {
     /// Parse a comma-separated list of Selectors.
     /// https://drafts.csswg.org/selectors/#grouping
     ///
     /// Return the Selectors or Err if there is an invalid selector.
     pub fn parse<'i, 't, P, E>(parser: &P, input: &mut CssParser<'i, 't>)
@@ -201,17 +201,17 @@ impl<Impl: SelectorImpl> SelectorList<Im
 ///
 /// Because the bloom filter only uses the bottom 24 bits of the hash, we pack
 /// the fourth hash into the upper bits of the first three hashes in order to
 /// shrink Rule (whose size matters a lot). This scheme minimizes the runtime
 /// overhead of the packing for the first three hashes (we just need to mask
 /// off the upper bits) at the expense of making the fourth somewhat more
 /// complicated to assemble, because we often bail out before checking all the
 /// hashes.
-#[derive(Eq, PartialEq, Clone, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub struct AncestorHashes {
     pub packed_hashes: [u32; 3],
 }
 
 impl AncestorHashes {
     pub fn new<Impl: SelectorImpl>(
         selector: &Selector<Impl>,
         quirks_mode: QuirksMode,
@@ -570,17 +570,17 @@ impl<'a, Impl: SelectorImpl> Iterator fo
                 self.skip_until_ancestor();
             }
         }
 
         self.0.next()
     }
 }
 
-#[derive(Eq, PartialEq, Clone, Copy, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum Combinator {
     Child,  //  >
     Descendant,  // space
     NextSibling,  // +
     LaterSibling,  // ~
     /// A dummy combinator we use to the left of pseudo-elements.
     ///
     /// It serializes as the empty string, and acts effectively as a child
@@ -608,17 +608,17 @@ impl Combinator {
         matches!(*self, Combinator::NextSibling | Combinator::LaterSibling)
     }
 }
 
 /// A CSS simple selector or combinator. We store both in the same enum for
 /// optimal packing and cache performance, see [1].
 ///
 /// [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1357973
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub enum Component<Impl: SelectorImpl> {
     Combinator(Combinator),
 
     ExplicitAnyNamespace,
     ExplicitNoNamespace,
     DefaultNamespace(Impl::NamespaceUrl),
     Namespace(Impl::NamespacePrefix, Impl::NamespaceUrl),
 
@@ -707,17 +707,17 @@ impl<Impl: SelectorImpl> Component<Impl>
     pub fn as_combinator(&self) -> Option<Combinator> {
         match *self {
             Component::Combinator(c) => Some(c),
             _ => None,
         }
     }
 }
 
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub struct LocalName<Impl: SelectorImpl> {
     pub name: Impl::LocalName,
     pub lower_name: Impl::LocalName,
 }
 
 impl<Impl: SelectorImpl> Debug for Selector<Impl> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.write_str("Selector(")?;
@@ -1689,24 +1689,24 @@ fn parse_simple_pseudo_class<'i, P, E, I
 pub mod tests {
     use builder::HAS_PSEUDO_BIT;
     use cssparser::{Parser as CssParser, ToCss, serialize_identifier, ParserInput};
     use parser;
     use std::collections::HashMap;
     use std::fmt;
     use super::*;
 
-    #[derive(PartialEq, Clone, Debug, Eq)]
+    #[derive(Clone, Debug, Eq, PartialEq)]
     pub enum PseudoClass {
         Hover,
         Active,
         Lang(String),
     }
 
-    #[derive(Eq, PartialEq, Clone, Debug)]
+    #[derive(Clone, Debug, Eq, PartialEq)]
     pub enum PseudoElement {
         Before,
         After,
     }
 
     impl parser::PseudoElement for PseudoElement {
         type Impl = DummySelectorImpl;
 
@@ -1744,17 +1744,17 @@ pub mod tests {
 
     impl SelectorMethods for PseudoClass {
         type Impl = DummySelectorImpl;
 
         fn visit<V>(&self, _visitor: &mut V) -> bool
             where V: SelectorVisitor<Impl = Self::Impl> { true }
     }
 
-    #[derive(Clone, PartialEq, Debug)]
+    #[derive(Clone, Debug, PartialEq)]
     pub struct DummySelectorImpl;
 
     #[derive(Default)]
     pub struct DummyParser {
         default_ns: Option<DummyAtom>,
         ns_prefixes: HashMap<DummyAtom, DummyAtom>,
     }
 
@@ -1781,17 +1781,17 @@ pub mod tests {
 
         #[inline]
         fn is_active_or_hover(pseudo_class: &Self::NonTSPseudoClass) -> bool {
             matches!(*pseudo_class, PseudoClass::Active |
                                     PseudoClass::Hover)
         }
     }
 
-    #[derive(Default, Debug, Clone, PartialEq, Eq, Hash)]
+    #[derive(Clone, Debug, Default, Eq, Hash, PartialEq)]
     pub struct DummyAtom(String);
 
     impl fmt::Display for DummyAtom {
         fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
             <String as fmt::Display>::fmt(&self.0, fmt)
         }
     }
 
--- a/servo/components/servo_arc/lib.rs
+++ b/servo/components/servo_arc/lib.rs
@@ -874,17 +874,17 @@ impl<T: 'static> Arc<T> {
 /// an Arc<T> instance somewhere pinned down until we're done with it.
 ///
 /// However, Gecko hands us refcounted things as pointers to T directly,
 /// so we have to conjure up a temporary Arc on the stack each time. The
 /// same happens for when the object is managed by a RawOffsetArc.
 ///
 /// ArcBorrow lets us deal with borrows of known-refcounted objects
 /// without needing to worry about how they're actually stored.
-#[derive(PartialEq, Eq)]
+#[derive(Eq, PartialEq)]
 pub struct ArcBorrow<'a, T: 'a>(&'a T);
 
 impl<'a, T> Copy for ArcBorrow<'a, T> {}
 impl<'a, T> Clone for ArcBorrow<'a, T> {
     fn clone(&self) -> Self {
         *self
     }
 }
--- a/servo/components/style/animation.rs
+++ b/servo/components/style/animation.rs
@@ -23,41 +23,41 @@ use timer::Timer;
 use values::computed::Time;
 use values::computed::transform::TimingFunction;
 use values::generics::transform::{StepPosition, TimingFunction as GenericTimingFunction};
 
 /// This structure represents a keyframes animation current iteration state.
 ///
 /// If the iteration count is infinite, there's no other state, otherwise we
 /// have to keep track the current iteration and the max iteration count.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub enum KeyframesIterationState {
     /// Infinite iterations, so no need to track a state.
     Infinite,
     /// Current and max iterations.
     Finite(f32, f32),
 }
 
 /// This structure represents wether an animation is actually running.
 ///
 /// An animation can be running, or paused at a given time.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub enum KeyframesRunningState {
     /// This animation is paused. The inner field is the percentage of progress
     /// when it was paused, from 0 to 1.
     Paused(f64),
     /// This animation is actually running.
     Running,
 }
 
 /// This structure represents the current keyframe animation state, i.e., the
 /// duration, the current and maximum iteration count, and the state (either
 /// playing or paused).
 // TODO: unify the use of f32/f64 in this file.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub struct KeyframesAnimationState {
     /// The time this animation started at.
     pub started_at: f64,
     /// The duration of this animation.
     pub duration: f64,
     /// The delay of the animation.
     pub delay: f64,
     /// The current iteration state for the animation.
@@ -239,27 +239,27 @@ impl Animation {
             Animation::Transition(..) => true,
             Animation::Keyframes(..) => false,
         }
     }
 }
 
 
 /// A single animation frame of a single property.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub struct AnimationFrame {
     /// A description of the property animation that is occurring.
     pub property_animation: PropertyAnimation,
     /// The duration of the animation. This is either relative in the keyframes
     /// case (a number between 0 and 1), or absolute in the transition case.
     pub duration: f64,
 }
 
 /// Represents an animation for a given property.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub struct PropertyAnimation {
     property: AnimatedProperty,
     timing_function: TimingFunction,
     duration: Time, // TODO: isn't this just repeated?
 }
 
 impl PropertyAnimation {
     /// Returns the given property name.
--- a/servo/components/style/applicable_declarations.rs
+++ b/servo/components/style/applicable_declarations.rs
@@ -32,17 +32,17 @@ pub type ApplicableDeclarationList = Sma
 /// [1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/
 ///     RuleSet.h?l=128&rcl=90140ab80b84d0f889abc253410f44ed54ae04f3
 const SOURCE_ORDER_BITS: usize = 24;
 const SOURCE_ORDER_MASK: u32 = (1 << SOURCE_ORDER_BITS) - 1;
 const SOURCE_ORDER_MAX: u32 = SOURCE_ORDER_MASK;
 
 /// Stores the source order of a block and the cascade level it belongs to.
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-#[derive(Copy, Clone, Eq, PartialEq)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 struct SourceOrderAndCascadeLevel(u32);
 
 impl SourceOrderAndCascadeLevel {
     fn new(source_order: u32, cascade_level: CascadeLevel) -> SourceOrderAndCascadeLevel {
         let mut bits = ::std::cmp::min(source_order, SOURCE_ORDER_MAX);
         bits |= (cascade_level as u8 as u32) << SOURCE_ORDER_BITS;
         SourceOrderAndCascadeLevel(bits)
     }
@@ -71,17 +71,17 @@ impl Debug for SourceOrderAndCascadeLeve
 }
 
 /// A property declaration together with its precedence among rules of equal
 /// specificity so that we can sort them.
 ///
 /// This represents the declarations in a given declaration block for a given
 /// importance.
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
 pub struct ApplicableDeclarationBlock {
     /// The style source, either a style rule, or a property declaration block.
     #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
     pub source: StyleSource,
     /// The source order of the block, and the cascade level it belongs to.
     order_and_level: SourceOrderAndCascadeLevel,
     /// The specificity of the selector this block is represented by.
     pub specificity: u32,
--- a/servo/components/style/context.rs
+++ b/servo/components/style/context.rs
@@ -722,17 +722,17 @@ impl<E: TElement> Drop for ThreadLocalSt
 pub struct StyleContext<'a, E: TElement + 'a> {
     /// The shared style context reference.
     pub shared: &'a SharedStyleContext<'a>,
     /// The thread-local style context (mutable) reference.
     pub thread_local: &'a mut ThreadLocalStyleContext<E>,
 }
 
 /// Why we're doing reflow.
-#[derive(PartialEq, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum ReflowGoal {
     /// We're reflowing in order to send a display list to the screen.
     ForDisplay,
     /// We're reflowing in order to satisfy a script query. No display list will be created.
     ForScriptQuery,
 }
 
 /// A registered painter
--- a/servo/components/style/counter_style/mod.rs
+++ b/servo/components/style/counter_style/mod.rs
@@ -265,17 +265,17 @@ counter_style_descriptors! {
 
     /// https://drafts.csswg.org/css-counter-styles/#counter-style-speak-as
     "speak-as" speak_as / eCSSCounterDesc_SpeakAs: SpeakAs = {
         SpeakAs::Auto
     }
 }
 
 /// https://drafts.csswg.org/css-counter-styles/#counter-style-system
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub enum System {
     /// 'cyclic'
     Cyclic,
     /// 'numeric'
     Numeric,
     /// 'alphabetic'
     Alphabetic,
     /// 'symbolic'
@@ -330,17 +330,17 @@ impl ToCss for System {
                 dest.write_str("extends ")?;
                 other.to_css(dest)
             }
         }
     }
 }
 
 /// https://drafts.csswg.org/css-counter-styles/#typedef-symbol
-#[derive(Debug, Clone, PartialEq, Eq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub enum Symbol {
     /// <string>
     String(String),
     /// <ident>
     Ident(String),
     // Not implemented:
     // /// <image>
     // Image(Image),
@@ -373,32 +373,32 @@ impl Symbol {
             // Identifier is not allowed.
             &Symbol::Ident(_) => false,
             _ => true,
         }
     }
 }
 
 /// https://drafts.csswg.org/css-counter-styles/#counter-style-negative
-#[derive(Debug, Clone, ToCss)]
+#[derive(Clone, Debug, ToCss)]
 pub struct Negative(pub Symbol, pub Option<Symbol>);
 
 impl Parse for Negative {
     fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
         Ok(Negative(
             Symbol::parse(context, input)?,
             input.try(|input| Symbol::parse(context, input)).ok(),
         ))
     }
 }
 
 /// https://drafts.csswg.org/css-counter-styles/#counter-style-range
 ///
 /// Empty Vec represents 'auto'
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub struct Ranges(pub Vec<Range<Option<i32>>>);
 
 impl Parse for Ranges {
     fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
         if input.try(|input| input.expect_ident_matching("auto")).is_ok() {
             Ok(Ranges(Vec::new()))
         } else {
             input.parse_comma_separated(|input| {
@@ -477,17 +477,17 @@ pub struct Fallback(pub CustomIdent);
 
 impl Parse for Fallback {
     fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
         parse_counter_style_name(input).map(Fallback)
     }
 }
 
 /// https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols
-#[derive(Debug, Clone, PartialEq, Eq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub struct Symbols(pub Vec<Symbol>);
 
 impl Parse for Symbols {
     fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
         let mut symbols = Vec::new();
         loop {
             if let Ok(s) = input.try(|input| Symbol::parse(context, input)) {
                 symbols.push(s)
--- a/servo/components/style/custom_properties.rs
+++ b/servo/components/style/custom_properties.rs
@@ -34,17 +34,17 @@ pub fn parse_name(s: &str) -> Result<&st
         Err(())
     }
 }
 
 /// A specified value for a custom property is just a set of tokens.
 ///
 /// We preserve the original CSS for serialization, and also the variable
 /// references to other custom property names.
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct SpecifiedValue {
     css: String,
 
     first_token_type: TokenSerializationType,
     last_token_type: TokenSerializationType,
 
     /// Custom property names in var() functions.
--- a/servo/components/style/dom.rs
+++ b/servo/components/style/dom.rs
@@ -41,17 +41,17 @@ pub use style_traits::UnsafeNode;
 /// back into a non-opaque representation. The only safe operation that can be
 /// performed on this node is to compare it to another opaque handle or to another
 /// OpaqueNode.
 ///
 /// Layout and Graphics use this to safely represent nodes for comparison purposes.
 /// Because the script task's GC does not trace layout, node data cannot be safely stored in layout
 /// data structures. Also, layout code tends to be faster when the DOM is not being accessed, for
 /// locality reasons. Using `OpaqueNode` enforces this invariant.
-#[derive(Clone, PartialEq, Copy, Debug, Hash, Eq)]
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
 pub struct OpaqueNode(pub usize);
 
 impl OpaqueNode {
     /// Returns the address of this node, for debugging purposes.
     #[inline]
     pub fn id(&self) -> usize {
         self.0
--- a/servo/components/style/font_face.rs
+++ b/servo/components/style/font_face.rs
@@ -39,17 +39,17 @@ pub enum Source {
 impl OneOrMoreSeparated for Source {
     type S = Comma;
 }
 
 /// A `UrlSource` represents a font-face source that has been specified with a
 /// `url()` function.
 ///
 /// https://drafts.csswg.org/css-fonts/#src-desc
-#[derive(Clone, Debug, PartialEq, Eq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 pub struct UrlSource {
     /// The specified url.
     pub url: SpecifiedUrl,
     /// The format hints specified with the `format()` function.
     pub format_hints: Vec<String>,
 }
 
@@ -220,17 +220,17 @@ macro_rules! is_descriptor_enabled {
 
 macro_rules! font_face_descriptors_common {
     (
         $( #[$doc: meta] $name: tt $ident: ident / $gecko_ident: ident: $ty: ty, )*
     ) => {
         /// Data inside a `@font-face` rule.
         ///
         /// https://drafts.csswg.org/css-fonts/#font-face-rule
-        #[derive(Clone, Debug, PartialEq, Eq)]
+        #[derive(Clone, Debug, Eq, PartialEq)]
         pub struct FontFaceRuleData {
             $(
                 #[$doc]
                 pub $ident: Option<$ty>,
             )*
             /// Line and column of the @font-face rule source code.
             pub source_location: SourceLocation,
         }
--- a/servo/components/style/font_metrics.rs
+++ b/servo/components/style/font_metrics.rs
@@ -11,26 +11,26 @@ use app_units::Au;
 use context::SharedStyleContext;
 use logical_geometry::WritingMode;
 use media_queries::Device;
 use properties::style_structs::Font;
 use std::fmt;
 
 /// Represents the font metrics that style needs from a font to compute the
 /// value of certain CSS units like `ex`.
-#[derive(Debug, PartialEq, Clone)]
+#[derive(Clone, Debug, PartialEq)]
 pub struct FontMetrics {
     /// The x-height of the font.
     pub x_height: Au,
     /// The zero advance. This is usually writing mode dependent
     pub zero_advance_measure: Au,
 }
 
 /// The result for querying font metrics for a given font family.
-#[derive(Debug, PartialEq, Clone)]
+#[derive(Clone, Debug, PartialEq)]
 pub enum FontMetricsQueryResult {
     /// The font is available, but we may or may not have found any font metrics
     /// for it.
     Available(FontMetrics),
     /// The font is not available.
     NotAvailable,
 }
 
--- a/servo/components/style/gecko/data.rs
+++ b/servo/components/style/gecko/data.rs
@@ -15,17 +15,17 @@ use invalidation::media_queries::{MediaL
 use media_queries::{Device, MediaList};
 use properties::ComputedValues;
 use servo_arc::Arc;
 use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard};
 use stylesheets::{PerOrigin, StylesheetContents, StylesheetInDocument};
 use stylist::{ExtraStyleData, Stylist};
 
 /// Little wrapper to a Gecko style sheet.
-#[derive(PartialEq, Eq, Debug)]
+#[derive(Debug, Eq, PartialEq)]
 pub struct GeckoStyleSheet(*const ServoStyleSheet);
 
 impl ToMediaListKey for ::gecko::data::GeckoStyleSheet {
     fn to_media_list_key(&self) -> MediaListKey {
         use std::mem;
         unsafe {
             MediaListKey::from_raw(mem::transmute(self.0))
         }
--- a/servo/components/style/gecko/media_queries.rs
+++ b/servo/components/style/gecko/media_queries.rs
@@ -195,17 +195,17 @@ impl Device {
     /// Un-apply text zoom (see nsStyleFont::UnzoomText).
     pub fn unzoom_text(&self, size: Au) -> Au {
         size.scale_by(1. / self.pres_context().mEffectiveTextZoom)
     }
 }
 
 /// A expression for gecko contains a reference to the media feature, the value
 /// the media query contained, and the range to evaluate.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub struct Expression {
     feature: &'static nsMediaFeature,
     value: Option<MediaExpressionValue>,
     range: nsMediaExpression_Range
 }
 
 impl ToCss for Expression {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
@@ -237,17 +237,17 @@ impl ToCss for Expression {
 impl PartialEq for Expression {
     fn eq(&self, other: &Expression) -> bool {
         self.feature.mName == other.feature.mName &&
             self.value == other.value && self.range == other.range
     }
 }
 
 /// A resolution.
-#[derive(PartialEq, Debug, Clone)]
+#[derive(Clone, Debug, PartialEq)]
 pub enum Resolution {
     /// Dots per inch.
     Dpi(CSSFloat),
     /// Dots per pixel.
     Dppx(CSSFloat),
     /// Dots per centimeter.
     Dpcm(CSSFloat),
 }
@@ -290,17 +290,17 @@ impl ToCss for Resolution {
             Resolution::Dpi(v) => serialize_dimension(v, "dpi", dest),
             Resolution::Dppx(v) => serialize_dimension(v, "dppx", dest),
             Resolution::Dpcm(v) => serialize_dimension(v, "dpcm", dest),
         }
     }
 }
 
 /// A value found or expected in a media expression.
-#[derive(PartialEq, Debug, Clone)]
+#[derive(Clone, Debug, PartialEq)]
 pub enum MediaExpressionValue {
     /// A length.
     Length(specified::Length),
     /// A (non-negative) integer.
     Integer(u32),
     /// A floating point value.
     Float(CSSFloat),
     /// A boolean value, specified as an integer (i.e., either 0 or 1).
--- a/servo/components/style/gecko/pseudo_element_definition.mako.rs
+++ b/servo/components/style/gecko/pseudo_element_definition.mako.rs
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /// Gecko's pseudo-element definition.
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Debug, Eq, Hash, PartialEq)]
 pub enum PseudoElement {
     % for pseudo in PSEUDOS:
         /// ${pseudo.value}
         % if pseudo.is_tree_pseudo_element():
         ${pseudo.capitalized()}(Box<[String]>),
         % else:
         ${pseudo.capitalized()},
         % endif
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -30,17 +30,17 @@ bitflags! {
 /// The type used for storing pseudo-class string arguments.
 pub type PseudoClassStringArg = Box<[u16]>;
 
 macro_rules! pseudo_class_name {
     (bare: [$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*],
      string: [$(($s_css:expr, $s_name:ident, $s_gecko_type:tt, $s_state:tt, $s_flags:tt),)*],
      keyword: [$(($k_css:expr, $k_name:ident, $k_gecko_type:tt, $k_state:tt, $k_flags:tt),)*]) => {
         #[doc = "Our representation of a non tree-structural pseudo-class."]
-        #[derive(Clone, Debug, PartialEq, Eq)]
+        #[derive(Clone, Debug, Eq, PartialEq)]
         pub enum NonTSPseudoClass {
             $(
                 #[doc = $css]
                 $name,
             )*
             $(
                 #[doc = $s_css]
                 $s_name(PseudoClassStringArg),
@@ -251,17 +251,17 @@ impl NonTSPseudoClass {
         matches!(*self,
                  NonTSPseudoClass::MozTableBorderNonzero |
                  NonTSPseudoClass::MozBrowserFrame |
                  NonTSPseudoClass::Lang(..))
     }
 }
 
 /// The dummy struct we use to implement our selector parsing.
-#[derive(Clone, Debug, PartialEq, Eq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub struct SelectorImpl;
 
 impl ::selectors::SelectorImpl for SelectorImpl {
     type AttrValue = Atom;
     type Identifier = Atom;
     type ClassName = Atom;
     type LocalName = Atom;
     type NamespacePrefix = Atom;
--- a/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
+++ b/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
@@ -199,17 +199,17 @@ impl<'a> CoordDataMut for CornersDataMut
         (&mut *unit, &mut *value)
     }
 }
 
 /// Enum representing the tagged union that is CoordData.
 ///
 /// In release mode this should never actually exist in the code, and will be
 /// optimized out by threading matches and inlining.
-#[derive(Copy, Clone, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum CoordDataValue {
     /// eStyleUnit_Null
     Null,
     /// eStyleUnit_Normal
     Normal,
     /// eStyleUnit_Auto
     Auto,
     /// eStyleUnit_None
--- a/servo/components/style/gecko_string_cache/mod.rs
+++ b/servo/components/style/gecko_string_cache/mod.rs
@@ -34,17 +34,17 @@ pub mod namespace;
 
 pub use self::namespace::{Namespace, WeakNamespace};
 
 macro_rules! local_name {
     ($s: tt) => { atom!($s) }
 }
 
 /// A strong reference to a Gecko atom.
-#[derive(PartialEq, Eq)]
+#[derive(Eq, PartialEq)]
 pub struct Atom(*mut WeakAtom);
 
 /// An atom *without* a strong reference.
 ///
 /// Only usable as `&'a WeakAtom`,
 /// where `'a` is the lifetime of something that holds a strong reference to that atom.
 pub struct WeakAtom(nsIAtom);
 
--- a/servo/components/style/gecko_string_cache/namespace.rs
+++ b/servo/components/style/gecko_string_cache/namespace.rs
@@ -13,17 +13,17 @@ use string_cache::{Atom, WeakAtom};
 
 #[macro_export]
 macro_rules! ns {
     () => { $crate::string_cache::Namespace(atom!("")) };
     ($s: tt) => { $crate::string_cache::Namespace(atom!($s)) };
 }
 
 /// A Gecko namespace is just a wrapped atom.
-#[derive(Debug, PartialEq, Eq, Clone, Default, Hash)]
+#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)]
 pub struct Namespace(pub Atom);
 
 impl PrecomputedHash for Namespace {
     #[inline]
     fn precomputed_hash(&self) -> u32 {
         self.0.precomputed_hash()
     }
 }
--- a/servo/components/style/invalidation/element/invalidator.rs
+++ b/servo/components/style/invalidation/element/invalidator.rs
@@ -43,17 +43,17 @@ pub struct TreeStyleInvalidator<'a, 'b: 
 }
 
 type InvalidationVector = SmallVec<[Invalidation; 10]>;
 
 /// The kind of invalidation we're processing.
 ///
 /// We can use this to avoid pushing invalidations of the same kind to our
 /// descendants or siblings.
-#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 enum InvalidationKind {
     Descendant,
     Sibling,
 }
 
 /// An `Invalidation` is a complex selector that describes which elements,
 /// relative to a current element we are processing, must be restyled.
 ///
--- a/servo/components/style/invalidation/media_queries.rs
+++ b/servo/components/style/invalidation/media_queries.rs
@@ -18,17 +18,17 @@ use stylesheets::{NestedRuleIterationCon
 /// represent them.
 ///
 /// Also, note that right now when a rule or stylesheet is removed, we do a full
 /// style flush, so there's no need to worry about other item created with the
 /// same pointer address.
 ///
 /// If this changes, though, we may need to remove the item from the cache if
 /// present before it goes away.
-#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct MediaListKey(usize);
 
 impl MediaListKey {
     /// Create a MediaListKey from a raw usize.
     pub fn from_raw(k: usize) -> Self {
         MediaListKey(k)
     }
--- a/servo/components/style/invalidation/stylesheets.rs
+++ b/servo/components/style/invalidation/stylesheets.rs
@@ -15,17 +15,17 @@ use media_queries::Device;
 use selector_parser::SelectorImpl;
 use selectors::attr::CaseSensitivity;
 use selectors::parser::{Component, Selector};
 use shared_lock::SharedRwLockReadGuard;
 use stylesheets::{CssRule, StylesheetInDocument};
 
 /// An invalidation scope represents a kind of subtree that may need to be
 /// restyled.
-#[derive(Debug, Hash, Eq, PartialEq)]
+#[derive(Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 enum InvalidationScope {
     /// All the descendants of an element with a given id.
     ID(Atom),
     /// All the descendants of an element with a given class name.
     Class(Atom),
 }
 
--- a/servo/components/style/logical_geometry.rs
+++ b/servo/components/style/logical_geometry.rs
@@ -170,22 +170,22 @@ impl fmt::Display for WritingMode {
 
 /// Wherever logical geometry is used, the writing mode is known based on context:
 /// every method takes a `mode` parameter.
 /// However, this context is easy to get wrong.
 /// In debug builds only, logical geometry objects store their writing mode
 /// (in addition to taking it as a parameter to methods) and check it.
 /// In non-debug builds, make this storage zero-size and the checks no-ops.
 #[cfg(not(debug_assertions))]
-#[derive(PartialEq, Eq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Serialize))]
 struct DebugWritingMode;
 
 #[cfg(debug_assertions)]
-#[derive(PartialEq, Eq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Serialize))]
 struct DebugWritingMode {
     mode: WritingMode
 }
 
 #[cfg(not(debug_assertions))]
 impl DebugWritingMode {
     #[inline]
@@ -227,25 +227,25 @@ impl Debug for DebugWritingMode {
     #[cfg(debug_assertions)]
     fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
         write!(formatter, "{}", self.mode)
     }
 }
 
 
 // Used to specify the logical direction.
-#[derive(Debug, Clone, Copy, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Serialize))]
 pub enum Direction {
     Inline,
     Block
 }
 
 /// A 2D size in flow-relative dimensions
-#[derive(PartialEq, Eq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Serialize))]
 pub struct LogicalSize<T> {
     pub inline: T,  // inline-size, a.k.a. logical width, a.k.a. measure
     pub block: T,  // block-size, a.k.a. logical height, a.k.a. extent
     debug_writing_mode: DebugWritingMode,
 }
 
 impl<T: Debug> Debug for LogicalSize<T> {
@@ -372,17 +372,17 @@ impl<T: Sub<T, Output=T>> Sub for Logica
             inline: self.inline - other.inline,
             block: self.block - other.block,
         }
     }
 }
 
 
 /// A 2D point in flow-relative dimensions
-#[derive(PartialEq, Eq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Serialize))]
 pub struct LogicalPoint<T> {
     /// inline-axis coordinate
     pub i: T,
     /// block-axis coordinate
     pub b: T,
     debug_writing_mode: DebugWritingMode,
 }
@@ -545,17 +545,17 @@ impl<T: Copy + Sub<T, Output=T>> Sub<Log
     }
 }
 
 
 /// A "margin" in flow-relative dimensions
 /// Represents the four sides of the margins, borders, or padding of a CSS box,
 /// or a combination of those.
 /// A positive "margin" can be added to a rectangle to obtain a bigger rectangle.
-#[derive(PartialEq, Eq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Serialize))]
 pub struct LogicalMargin<T> {
     pub block_start: T,
     pub inline_end: T,
     pub block_end: T,
     pub inline_start: T,
     debug_writing_mode: DebugWritingMode,
 }
@@ -849,17 +849,17 @@ impl<T: Sub<T, Output=T>> Sub for Logica
             block_end: self.block_end - other.block_end,
             inline_start: self.inline_start - other.inline_start,
         }
     }
 }
 
 
 /// A rectangle in flow-relative dimensions
-#[derive(PartialEq, Eq, Clone, Copy)]
+#[derive(Clone, Copy, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(Serialize))]
 pub struct LogicalRect<T> {
     pub start: LogicalPoint<T>,
     pub size: LogicalSize<T>,
     debug_writing_mode: DebugWritingMode,
 }
 
 impl<T: Debug> Debug for LogicalRect<T> {
@@ -1097,15 +1097,15 @@ impl<T: Copy + Add<T, Output=T> + Sub<T,
                 block: self.size.block - other.block_start_end(),
                 debug_writing_mode: self.debug_writing_mode,
             },
             debug_writing_mode: self.debug_writing_mode,
         }
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 pub enum PhysicalSide {
     Top,
     Right,
     Bottom,
     Left,
 }
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -35,27 +35,27 @@ impl StyleDifference {
         StyleDifference {
             change: change,
             damage: damage,
         }
     }
 }
 
 /// Represents whether or not the style of an element has changed.
-#[derive(Copy, Clone)]
+#[derive(Clone, Copy)]
 pub enum StyleChange {
     /// The style hasn't changed.
     Unchanged,
     /// The style has changed.
     Changed,
 }
 
 /// Whether or not newly computed values for an element need to be cascade
 /// to children.
-#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
 pub enum ChildCascadeRequirement {
     /// Old and new computed values were the same, or we otherwise know that
     /// we won't bother recomputing style for children, so we can skip cascading
     /// the new values into child elements.
     CanSkipCascade = 0,
     /// Old and new computed values were different, so we must cascade the
     /// new values to children.
     ///
@@ -91,17 +91,17 @@ impl RulesChanged {
     /// Return true if there are any important rules changed.
     #[inline]
     pub fn important_rules_changed(&self) -> bool {
         self.contains(IMPORTANT_RULES_CHANGED)
     }
 }
 
 /// Determines which styles are being cascaded currently.
-#[derive(PartialEq, Eq, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum CascadeVisitedMode {
     /// Cascade the regular, unvisited styles.
     Unvisited,
     /// Cascade the styles used when an element's relevant link is visited.  A
     /// "relevant link" is the element being matched if it is a link or the
     /// nearest ancestor link.
     Visited,
 }
--- a/servo/components/style/media_queries.rs
+++ b/servo/components/style/media_queries.rs
@@ -18,17 +18,17 @@ use style_traits::{ToCss, ParseError, St
 use values::CustomIdent;
 
 #[cfg(feature = "servo")]
 pub use servo::media_queries::{Device, Expression};
 #[cfg(feature = "gecko")]
 pub use gecko::media_queries::{Device, Expression};
 
 /// A type that encapsulates a media query list.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct MediaList {
     /// The list of media queries.
     pub media_queries: Vec<MediaQuery>,
 }
 
 impl ToCss for MediaList {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result
@@ -55,17 +55,17 @@ pub enum Qualifier {
     /// Negate a media query:
     /// https://drafts.csswg.org/mediaqueries/#mq-not
     Not,
 }
 
 /// A [media query][mq].
 ///
 /// [mq]: https://drafts.csswg.org/mediaqueries/
-#[derive(PartialEq, Clone, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct MediaQuery {
     /// The qualifier for this query.
     pub qualifier: Option<Qualifier>,
     /// The media type for this query, that can be known, unknown, or "all".
     pub media_type: MediaQueryType,
     /// The set of expressions that this media query contains.
     pub expressions: Vec<Expression>,
@@ -127,17 +127,17 @@ impl ToCss for MediaQuery {
             write!(dest, " and ")?;
             expr.to_css(dest)?;
         }
         Ok(())
     }
 }
 
 /// http://dev.w3.org/csswg/mediaqueries-3/#media0
-#[derive(PartialEq, Eq, Clone, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum MediaQueryType {
     /// A media type that matches every device.
     All,
     /// A specific media type.
     Concrete(MediaType),
 }
 
@@ -156,17 +156,17 @@ impl MediaQueryType {
         match *self {
             MediaQueryType::All => true,
             MediaQueryType::Concrete(ref known_type) => *known_type == other,
         }
     }
 }
 
 /// https://drafts.csswg.org/mediaqueries/#media-types
-#[derive(PartialEq, Eq, Clone, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct MediaType(pub CustomIdent);
 
 impl MediaType {
     /// The `screen` media type.
     pub fn screen() -> Self {
         MediaType(CustomIdent(atom!("screen")))
     }
--- a/servo/components/style/properties/declaration_block.rs
+++ b/servo/components/style/properties/declaration_block.rs
@@ -37,17 +37,17 @@ impl AnimationRules {
         self.0.is_none() && self.1.is_none()
     }
 }
 
 /// A declaration [importance][importance].
 ///
 /// [importance]: https://drafts.csswg.org/css-cascade/#importance
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
 pub enum Importance {
     /// Indicates a declaration without `!important`.
     Normal,
 
     /// Indicates a declaration with `!important`.
     Important,
 }
 
--- a/servo/components/style/properties/helpers.mako.rs
+++ b/servo/components/style/properties/helpers.mako.rs
@@ -443,17 +443,17 @@
                 fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
                     T::parse(input)
                 }
             }
 
             ${gecko_keyword_conversion(keyword, keyword.values_for(product), type="T", cast_to="i32")}
         }
 
-        #[derive(Debug, Clone, PartialEq, Eq, Copy, ToCss)]
+        #[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
         pub enum SpecifiedValue {
             Keyword(computed_value::T),
             System(SystemFont),
         }
 
         pub fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>) -> Result<SpecifiedValue, ParseError<'i>> {
             Ok(SpecifiedValue::Keyword(computed_value::T::parse(input)?))
         }
--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -63,17 +63,17 @@ use values::generics::svg::{SVGPaintKind
 /// https://drafts.csswg.org/css-transitions/#animtype-repeatable-list
 pub trait RepeatableListAnimatable: Animate {}
 
 /// A longhand property whose animation type is not "none".
 ///
 /// NOTE: This includes the 'display' property since it is animatable from SMIL even though it is
 /// not animatable from CSS animations or Web Animations. CSS transitions also does not allow
 /// animating 'display', but for CSS transitions we have the separate TransitionProperty type.
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum AnimatableLonghand {
     % for prop in data.longhands:
         % if prop.animatable:
             /// ${prop.name}
             ${prop.camel_case},
         % endif
     % endfor
--- a/servo/components/style/properties/longhand/background.mako.rs
+++ b/servo/components/style/properties/longhand/background.mako.rs
@@ -59,17 +59,17 @@
         RepeatX,
         RepeatY,
         Other(RepeatKeyword, Option<RepeatKeyword>),
     }
 
     pub mod computed_value {
         pub use super::RepeatKeyword;
 
-        #[derive(Debug, Clone, PartialEq)]
+        #[derive(Clone, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T(pub RepeatKeyword, pub RepeatKeyword);
     }
 
     no_viewport_percentage!(SpecifiedValue);
 
     impl ToCss for computed_value::T {
         fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
--- a/servo/components/style/properties/longhand/border.mako.rs
+++ b/servo/components/style/properties/longhand/border.mako.rs
@@ -77,22 +77,22 @@
                        ignored_when_colors_disabled="True">
         use std::fmt;
         use style_traits::ToCss;
         use values::specified::RGBAColor;
         no_viewport_percentage!(SpecifiedValue);
 
         pub mod computed_value {
             use cssparser::RGBA;
-            #[derive(Debug, Clone, PartialEq)]
+            #[derive(Clone, Debug, PartialEq)]
             #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
             pub struct T(pub Option<Vec<RGBA>>);
         }
 
-        #[derive(Debug, Clone, PartialEq)]
+        #[derive(Clone, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum SpecifiedValue {
             None,
             Colors(Vec<RGBAColor>),
         }
 
         impl ToCss for computed_value::T {
             fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
@@ -231,22 +231,22 @@
     use style_traits::ToCss;
 
     no_viewport_percentage!(SpecifiedValue);
 
     pub mod computed_value {
         pub use super::RepeatKeyword;
 
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-        #[derive(Debug, Clone, PartialEq, ToCss)]
+        #[derive(Clone, Debug, PartialEq, ToCss)]
         pub struct T(pub RepeatKeyword, pub RepeatKeyword);
     }
 
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     pub struct SpecifiedValue(pub RepeatKeyword,
                               pub Option<RepeatKeyword>);
 
     define_css_keyword_enum!(RepeatKeyword:
                              "stretch" => Stretch,
                              "repeat" => Repeat,
                              "round" => Round,
                              "space" => Space);
--- a/servo/components/style/properties/longhand/box.mako.rs
+++ b/servo/components/style/properties/longhand/box.mako.rs
@@ -365,17 +365,17 @@
     pub mod computed_value {
         use std::fmt;
         use style_traits::ToCss;
         use values::computed;
 
         /// The keywords are the same, and the `LengthOrPercentage` is computed
         /// here.
         #[allow(non_camel_case_types)]
-        #[derive(PartialEq, Copy, Clone, Debug)]
+        #[derive(Clone, Copy, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum T {
             % for keyword in vertical_align_keywords:
                 ${to_rust_ident(keyword)},
             % endfor
             LengthOrPercentage(computed::LengthOrPercentage),
         }
         impl ToCss for T {
@@ -518,17 +518,17 @@
     use style_traits::ToCss;
     use values::computed::ComputedValueAsSpecified;
     use values::KeyframesName;
 
     pub mod computed_value {
         pub use super::SpecifiedValue as T;
     }
 
-    #[derive(Clone, Debug, Hash, Eq, PartialEq)]
+    #[derive(Clone, Debug, Eq, Hash, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub struct SpecifiedValue(pub Option<KeyframesName>);
 
     impl SpecifiedValue {
         /// As an Atom
         pub fn as_atom(&self) -> Option< &Atom> {
             self.0.as_ref().map(|n| n.as_atom())
         }
@@ -613,17 +613,17 @@
     use values::computed::ComputedValueAsSpecified;
 
     pub mod computed_value {
         pub use super::SpecifiedValue as T;
     }
 
     // https://drafts.csswg.org/css-animations/#animation-iteration-count
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     pub enum SpecifiedValue {
         Number(f32),
         Infinite,
     }
 
     impl Parse for SpecifiedValue {
         fn parse<'i, 't>(_context: &ParserContext, input: &mut ::cssparser::Parser<'i, 't>)
                          -> Result<Self, ParseError<'i>> {
@@ -1850,17 +1850,17 @@
 
     impl ComputedValueAsSpecified for SpecifiedValue {}
     no_viewport_percentage!(SpecifiedValue);
 
     pub mod computed_value {
         pub use super::SpecifiedValue as T;
     }
 
-    #[derive(Debug, Clone, PartialEq)]
+    #[derive(Clone, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub enum SpecifiedValue {
         Auto,
         AnimateableFeatures(Vec<CustomIdent>),
     }
 
     impl ToCss for SpecifiedValue {
         fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
--- a/servo/components/style/properties/longhand/counters.mako.rs
+++ b/servo/components/style/properties/longhand/counters.mako.rs
@@ -35,17 +35,17 @@
         #[cfg(feature = "servo")]
         type CounterStyleType = super::super::list_style_type::computed_value::T;
         #[cfg(feature = "gecko")]
         type CounterStyleType = ::values::generics::CounterStyleOrNone;
 
         #[cfg(feature = "gecko")]
         use values::specified::Attr;
 
-        #[derive(Debug, PartialEq, Eq, Clone)]
+        #[derive(Clone, Debug, Eq, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum ContentItem {
             /// Literal string content.
             String(String),
             /// `counter(name, style)`.
             Counter(String, CounterStyleType),
             /// `counters(name, separator, style)`.
             Counters(String, String, CounterStyleType),
@@ -96,17 +96,17 @@
                             attr.to_css(dest)
                         }
                         ContentItem::Url(ref url) => url.to_css(dest),
                     % endif
                 }
             }
         }
 
-        #[derive(Debug, PartialEq, Eq, Clone)]
+        #[derive(Clone, Debug, Eq, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum T {
             Normal,
             None,
             #[cfg(feature = "gecko")]
             MozAltContent,
             Items(Vec<ContentItem>),
         }
@@ -235,25 +235,25 @@
 </%helpers:longhand>
 
 <%helpers:longhand name="counter-increment" animation_value_type="discrete"
                    spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment">
     use std::fmt;
     use style_traits::ToCss;
     use values::CustomIdent;
 
-    #[derive(Debug, Clone, PartialEq)]
+    #[derive(Clone, Debug, PartialEq)]
     pub struct SpecifiedValue(pub Vec<(CustomIdent, specified::Integer)>);
 
     pub mod computed_value {
         use std::fmt;
         use style_traits::ToCss;
         use values::CustomIdent;
 
-        #[derive(Debug, Clone, PartialEq)]
+        #[derive(Clone, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T(pub Vec<(CustomIdent, i32)>);
 
         impl ToCss for T {
             fn to_css<W>(&self, dest: &mut W) -> fmt::Result
                 where W: fmt::Write,
             {
                 if self.0.is_empty() {
--- a/servo/components/style/properties/longhand/font.mako.rs
+++ b/servo/components/style/properties/longhand/font.mako.rs
@@ -80,31 +80,31 @@ macro_rules! impl_gecko_keyword_conversi
 
     pub mod computed_value {
         use cssparser::{CssStringWriter, Parser, serialize_identifier};
         use std::fmt::{self, Write};
         use Atom;
         use style_traits::{ToCss, ParseError};
         pub use self::FontFamily as SingleComputedValue;
 
-        #[derive(Debug, PartialEq, Eq, Clone, Hash)]
+        #[derive(Clone, Debug, Eq, Hash, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
         pub enum FontFamily {
             FamilyName(FamilyName),
             Generic(Atom),
         }
 
-        #[derive(Debug, PartialEq, Eq, Clone, Hash)]
+        #[derive(Clone, Debug, Eq, Hash, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
         pub struct FamilyName {
             pub name: Atom,
             pub syntax: FamilyNameSyntax,
         }
 
-        #[derive(Debug, PartialEq, Eq, Clone, Hash)]
+        #[derive(Clone, Debug, Eq, Hash, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
         pub enum FamilyNameSyntax {
             /// The family name was specified in a quoted form, e.g. "Font Name"
             /// or 'Font Name'.
             Quoted,
 
             /// The family name was specified in an unquoted form as a sequence of
             /// identifiers.  The `String` is the serialization of the sequence of
@@ -291,17 +291,17 @@ macro_rules! impl_gecko_keyword_conversi
                 for family in iter {
                     dest.write_str(", ")?;
                     family.to_css(dest)?;
                 }
                 Ok(())
             }
         }
 
-        #[derive(Debug, Clone, PartialEq, Eq, Hash)]
+        #[derive(Clone, Debug, Eq, Hash, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T(pub Vec<FontFamily>);
     }
 
     #[inline]
     pub fn get_initial_value() -> computed_value::T {
         computed_value::T(vec![FontFamily::Generic(atom!("serif"))])
     }
@@ -309,17 +309,17 @@ macro_rules! impl_gecko_keyword_conversi
     /// <family-name>#
     /// <family-name> = <string> | [ <ident>+ ]
     /// TODO: <generic-family>
     pub fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>)
                          -> Result<SpecifiedValue, ParseError<'i>> {
         SpecifiedValue::parse(input)
     }
 
-    #[derive(Debug, Clone, PartialEq, Eq, Hash)]
+    #[derive(Clone, Debug, Eq, Hash, PartialEq)]
     pub enum SpecifiedValue {
         Values(Vec<FontFamily>),
         System(SystemFont),
     }
 
     #[cfg(feature = "gecko")]
     impl SpecifiedValue {
         /// Return the generic ID if it is a single generic font
@@ -480,17 +480,17 @@ macro_rules! impl_gecko_keyword_conversi
     }
 
     pub mod computed_value {
         /// As of CSS Fonts Module Level 3, only the following values are
         /// valid: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
         ///
         /// However, system fonts may provide other values. Pango
         /// may provide 350, 380, and 1000 (on top of the existing values), for example.
-        #[derive(Clone, ComputeSquaredDistance, Copy, Debug, PartialEq, Eq, Hash, ToCss)]
+        #[derive(Clone, ComputeSquaredDistance, Copy, Debug, Eq, Hash, PartialEq, ToCss)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
         pub struct T(pub u16);
 
         impl T {
             /// Value for normal
             pub fn normal() -> Self {
                 T(400)
             }
@@ -619,17 +619,17 @@ macro_rules! impl_gecko_keyword_conversi
         fn has_viewport_percentage(&self) -> bool {
             match *self {
                 SpecifiedValue::Length(ref lop) => lop.has_viewport_percentage(),
                 _ => false
             }
         }
     }
 
-    #[derive(Debug, Clone, PartialEq)]
+    #[derive(Clone, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub enum SpecifiedValue {
         Length(specified::LengthOrPercentage),
         /// A keyword value, along with a ratio.
         /// The ratio in any specified keyword value
         /// will be 1, but we cascade keywordness even
         /// after font-relative (percent and em) values
         /// have been applied, which is where the keyword
@@ -647,17 +647,17 @@ macro_rules! impl_gecko_keyword_conversi
     }
 
     pub mod computed_value {
         use values::computed::NonNegativeAu;
         pub type T = NonNegativeAu;
     }
 
     /// CSS font keywords
-    #[derive(Debug, Copy, Clone, PartialEq)]
+    #[derive(Clone, Copy, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub enum KeywordSize {
         XXSmall = 1, // This is to enable the NonZero optimization
                      // which simplifies the representation of Option<KeywordSize>
                      // in bindgen
         XSmall,
         Small,
         Medium,
@@ -1115,17 +1115,17 @@ macro_rules! impl_gecko_keyword_conversi
     }
 
     pub mod computed_value {
         use values::CSSFloat;
         use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
         use values::distance::{ComputeSquaredDistance, SquaredDistance};
 
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-        #[derive(Copy, Clone, Debug, PartialEq, ToCss)]
+        #[derive(Clone, Copy, Debug, PartialEq, ToCss)]
         pub enum T {
             None,
             Number(CSSFloat),
         }
 
         impl T {
             pub fn from_gecko_adjust(gecko: f32) -> Self {
                 if gecko == -1.0 {
@@ -1212,17 +1212,17 @@ macro_rules! impl_gecko_keyword_conversi
 
     impl ComputedValueAsSpecified for SpecifiedValue {}
     no_viewport_percentage!(SpecifiedValue);
 
     pub mod computed_value {
         pub use super::SpecifiedValue as T;
     }
 
-    #[derive(Debug, Clone, PartialEq)]
+    #[derive(Clone, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub struct SpecifiedValue {
         pub weight: bool,
         pub style: bool,
     }
 
     impl ToCss for computed_value::T {
         fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
@@ -1320,33 +1320,33 @@ macro_rules! impl_gecko_keyword_conversi
                    spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-alternates">
     use properties::longhands::system_font::SystemFont;
     use std::fmt;
     use style_traits::ToCss;
     use values::CustomIdent;
 
     no_viewport_percentage!(SpecifiedValue);
 
-    #[derive(PartialEq, Clone, Debug)]
+    #[derive(Clone, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub enum VariantAlternates {
         Stylistic(CustomIdent),
         Styleset(Box<[CustomIdent]>),
         CharacterVariant(Box<[CustomIdent]>),
         Swash(CustomIdent),
         Ornaments(CustomIdent),
         Annotation(CustomIdent),
         HistoricalForms,
     }
 
-    #[derive(Debug, Clone, PartialEq)]
+    #[derive(Clone, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub struct VariantAlternatesList(pub Box<[VariantAlternates]>);
 
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub enum SpecifiedValue {
         Value(VariantAlternatesList),
         System(SystemFont)
     }
 
     <%self:simple_system_boilerplate name="font_variant_alternates"></%self:simple_system_boilerplate>
 
@@ -1547,17 +1547,17 @@ macro_rules! exclusive_value {
             const TRADITIONAL = 0x20,
             const FULL_WIDTH = 0x40,
             const PROPORTIONAL_WIDTH = 0x80,
             const RUBY = 0x100,
         }
     }
 
 
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     pub enum SpecifiedValue {
         Value(VariantEastAsian),
         System(SystemFont)
     }
 
     <%self:simple_system_boilerplate name="font_variant_east_asian"></%self:simple_system_boilerplate>
 
     //                                 servo_bit: gecko_bit
@@ -1693,17 +1693,17 @@ macro_rules! exclusive_value {
             const HISTORICAL_LIGATURES = 0x20,
             const NO_HISTORICAL_LIGATURES = 0x40,
             const CONTEXTUAL = 0x80,
             const NO_CONTEXTUAL = 0x100,
         }
     }
 
 
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     pub enum SpecifiedValue {
         Value(VariantLigatures),
         System(SystemFont)
     }
 
     <%self:simple_system_boilerplate name="font_variant_ligatures"></%self:simple_system_boilerplate>
 
     //                                 servo_bit: gecko_bit
@@ -1853,17 +1853,17 @@ macro_rules! exclusive_value {
             const STACKED_FRACTIONS = 0x20,
             const SLASHED_ZERO = 0x40,
             const ORDINAL = 0x80,
         }
     }
 
 
 
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     pub enum SpecifiedValue {
         Value(VariantNumeric),
         System(SystemFont)
     }
 
     <%self:simple_system_boilerplate name="font_variant_numeric"></%self:simple_system_boilerplate>
 
 
@@ -1992,17 +1992,17 @@ macro_rules! exclusive_value {
 
 <%helpers:longhand name="font-feature-settings" products="gecko" animation_value_type="discrete"
                    extra_prefixes="moz" boxed="True"
                    flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER"
                    spec="https://drafts.csswg.org/css-fonts/#propdef-font-feature-settings">
     use properties::longhands::system_font::SystemFont;
     use values::generics::FontSettings;
 
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     pub enum SpecifiedValue {
         Value(computed_value::T),
         System(SystemFont)
     }
     no_viewport_percentage!(SpecifiedValue);
 
     <%self:simple_system_boilerplate name="font_feature_settings"></%self:simple_system_boilerplate>
 
@@ -2069,17 +2069,17 @@ https://drafts.csswg.org/css-fonts-4/#lo
                    flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER"
                    spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override">
     use properties::longhands::system_font::SystemFont;
     use std::fmt;
     use style_traits::ToCss;
     use byteorder::{BigEndian, ByteOrder};
     no_viewport_percentage!(SpecifiedValue);
 
-    #[derive(Debug, Clone, PartialEq, Eq)]
+    #[derive(Clone, Debug, Eq, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub enum SpecifiedValue {
         Normal,
         Override(String),
         System(SystemFont)
     }
 
     impl ToCss for SpecifiedValue {
@@ -2126,17 +2126,17 @@ https://drafts.csswg.org/css-fonts-4/#lo
                 slice.trim_right().to_css(dest)
             }
         }
 
         // font-language-override can only have a single three-letter
         // OpenType "language system" tag, so we should be able to compute
         // it and store it as a 32-bit integer
         // (see http://www.microsoft.com/typography/otspec/languagetags.htm).
-        #[derive(Clone, Copy, Debug, PartialEq, Eq)]
+        #[derive(Clone, Copy, Debug, Eq, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T(pub u32);
     }
 
     #[inline]
     pub fn get_initial_value() -> computed_value::T {
         computed_value::T(0)
     }
@@ -2299,17 +2299,17 @@ https://drafts.csswg.org/css-fonts-4/#lo
         pub type T = i8;
     }
 
     #[inline]
     pub fn get_initial_value() -> computed_value::T {
         0
     }
 
-    #[derive(Copy, Clone, PartialEq, Debug)]
+    #[derive(Clone, Copy, Debug, PartialEq)]
     pub enum SpecifiedValue {
         Relative(i32),
         Absolute(i32),
         Auto
     }
 
     impl ToCss for SpecifiedValue {
         fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
@@ -2638,17 +2638,17 @@ https://drafts.csswg.org/css-fonts-4/#lo
 % else:
     pub mod system_font {
         use cssparser::Parser;
 
         // We don't parse system fonts, but in the interest of not littering
         // a lot of code with `if product == gecko` conditionals, we have a
         // dummy system font module that does nothing
 
-        #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, ToCss)]
+        #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ToCss)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         /// void enum for system font, can never exist
         pub enum SystemFont {}
         impl SystemFont {
             pub fn parse(_: &mut Parser) -> Result<Self, ()> {
                 Err(())
             }
         }
--- a/servo/components/style/properties/longhand/inherited_box.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_box.mako.rs
@@ -66,17 +66,17 @@
     use style_traits::ToCss;
     use values::specified::Angle;
 
     no_viewport_percentage!(SpecifiedValue);
 
     use std::f64::consts::PI;
     const TWO_PI: f64 = 2.0 * PI;
 
-    #[derive(Clone, PartialEq, Copy, Debug)]
+    #[derive(Clone, Copy, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub struct SpecifiedValue {
         pub angle: Option<Angle>,
         pub flipped: bool
     }
 
     impl ToCss for SpecifiedValue {
         fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
@@ -97,17 +97,17 @@
         }
     }
 
     pub mod computed_value {
         use std::fmt;
         use style_traits::ToCss;
         use values::specified::Angle;
 
-        #[derive(Copy, Clone, Debug, Eq, PartialEq)]
+        #[derive(Clone, Copy, Debug, Eq, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum Orientation {
             Angle0 = 0,
             Angle90,
             Angle180,
             Angle270,
         }
 
@@ -129,17 +129,17 @@
                     Orientation::Angle0 => dest.write_str("0deg"),
                     Orientation::Angle90 => dest.write_str("90deg"),
                     Orientation::Angle180 => dest.write_str("180deg"),
                     Orientation::Angle270 => dest.write_str("270deg"),
                 }
             }
         }
 
-        #[derive(Clone, PartialEq, Copy, Debug)]
+        #[derive(Clone, Copy, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum T {
             FromImage,
             AngleWithFlipped(Orientation, bool),
         }
     }
 
     use self::computed_value::Orientation;
@@ -256,17 +256,17 @@
                    animation_value_type="none"
                    spec="Nonstandard (internal layout use only)">
     use std::fmt;
     use style_traits::ToCss;
     use values::computed::ComputedValueAsSpecified;
 
     no_viewport_percentage!(SpecifiedValue);
 
-    #[derive(Copy, Clone, Debug, Eq, PartialEq)]
+    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
     pub struct SpecifiedValue(pub bool);
 
     pub mod computed_value {
         pub type T = super::SpecifiedValue;
     }
     impl ComputedValueAsSpecified for SpecifiedValue {}
 
--- a/servo/components/style/properties/longhand/inherited_svg.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_svg.mako.rs
@@ -159,17 +159,17 @@
     ///
     /// Each pair can be set to FILL, STROKE, or MARKERS
     /// Lowest significant bit pairs are highest priority.
     ///  `normal` is the empty bitfield. The three pairs are
     /// never zero in any case other than `normal`.
     ///
     /// Higher priority values, i.e. the values specified first,
     /// will be painted first (and may be covered by paintings of lower priority)
-    #[derive(PartialEq, Clone, Copy, Debug)]
+    #[derive(Clone, Copy, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub struct SpecifiedValue(pub u8);
 
     pub mod computed_value {
         pub use super::SpecifiedValue as T;
     }
 
     pub fn get_initial_value() -> SpecifiedValue {
--- a/servo/components/style/properties/longhand/inherited_text.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_text.mako.rs
@@ -172,17 +172,17 @@
         computed_value::T::start
     }
 
 
     % if product == "gecko":
         use std::fmt;
         use style_traits::ToCss;
 
-        #[derive(Copy, Clone, Eq, PartialEq, Debug, Hash)]
+        #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
         pub enum SpecifiedValue {
             Keyword(computed_value::T),
             MatchParent,
             MozCenterOrInherit,
         }
         pub fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>)
                              -> Result<SpecifiedValue, ParseError<'i>> {
             // MozCenterOrInherit cannot be parsed, only set directly on th elements
@@ -289,17 +289,17 @@
     use cssparser::RGBA;
     use std::fmt;
     use style_traits::ToCss;
     use values::computed::ComputedValueAsSpecified;
 
     impl ComputedValueAsSpecified for SpecifiedValue {}
     no_viewport_percentage!(SpecifiedValue);
 
-    #[derive(Clone, PartialEq, Copy, Debug)]
+    #[derive(Clone, Copy, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub struct SpecifiedValue {
         pub underline: Option<RGBA>,
         pub overline: Option<RGBA>,
         pub line_through: Option<RGBA>,
     }
 
     pub mod computed_value {
@@ -441,33 +441,33 @@
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         #[derive(Clone, Debug, PartialEq, ToCss)]
         pub enum T {
             Keyword(KeywordValue),
             None,
             String(String),
         }
 
-        #[derive(Debug, Clone, PartialEq)]
+        #[derive(Clone, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct KeywordValue {
             pub fill: bool,
             pub shape: super::ShapeKeyword,
         }
     }
 
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     #[derive(Clone, Debug, PartialEq, ToCss)]
     pub enum SpecifiedValue {
         Keyword(KeywordValue),
         None,
         String(String),
     }
 
-    #[derive(Debug, Clone, PartialEq)]
+    #[derive(Clone, Debug, PartialEq)]
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
     pub enum KeywordValue {
         Fill(bool),
         Shape(ShapeKeyword),
         FillAndShape(bool, ShapeKeyword),
     }
 
     impl ToCss for KeywordValue {
@@ -625,17 +625,17 @@
     define_css_keyword_enum!(HorizontalWritingModeValue:
                              "over" => Over,
                              "under" => Under);
     define_css_keyword_enum!(VerticalWritingModeValue:
                              "right" => Right,
                              "left" => Left);
 
     #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-    #[derive(Debug, Clone, PartialEq, ToCss)]
+    #[derive(Clone, Debug, PartialEq, ToCss)]
     pub struct SpecifiedValue(pub HorizontalWritingModeValue, pub VerticalWritingModeValue);
 
     pub mod computed_value {
         pub type T = super::SpecifiedValue;
     }
 
     impl ComputedValueAsSpecified for SpecifiedValue {}
     no_viewport_percentage!(SpecifiedValue);
--- a/servo/components/style/properties/longhand/list.mako.rs
+++ b/servo/components/style/properties/longhand/list.mako.rs
@@ -37,17 +37,17 @@
         use values::generics::CounterStyleOrNone;
 
         pub use self::computed_value::T as SpecifiedValue;
 
         pub mod computed_value {
             use values::generics::CounterStyleOrNone;
 
             /// <counter-style> | <string> | none
-            #[derive(Debug, Clone, Eq, PartialEq, ToCss)]
+            #[derive(Clone, Debug, Eq, PartialEq, ToCss)]
             pub enum T {
                 CounterStyle(CounterStyleOrNone),
                 String(String),
             }
         }
 
         impl ComputedValueAsSpecified for SpecifiedValue {}
         no_viewport_percentage!(SpecifiedValue);
@@ -105,17 +105,17 @@
     use values::computed::ComputedValueAsSpecified;
     use values::specified::UrlOrNone;
     pub use self::computed_value::T as SpecifiedValue;
 
     pub mod computed_value {
         use values::specified::UrlOrNone;
 
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-        #[derive(Debug, Clone, PartialEq, ToCss)]
+        #[derive(Clone, Debug, PartialEq, ToCss)]
         pub struct T(pub UrlOrNone);
     }
 
 
     impl ComputedValueAsSpecified for SpecifiedValue {}
     no_viewport_percentage!(SpecifiedValue);
 
     #[inline]
@@ -146,17 +146,17 @@
     use cssparser::serialize_string;
     use std::fmt;
     use style_traits::ToCss;
     use values::computed::ComputedValueAsSpecified;
 
     pub use self::computed_value::T as SpecifiedValue;
 
     pub mod computed_value {
-        #[derive(Debug, Clone, PartialEq)]
+        #[derive(Clone, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T(pub Vec<(String,String)>);
     }
 
     impl ComputedValueAsSpecified for SpecifiedValue {}
     no_viewport_percentage!(SpecifiedValue);
 
     impl ToCss for SpecifiedValue {
--- a/servo/components/style/properties/longhand/pointing.mako.rs
+++ b/servo/components/style/properties/longhand/pointing.mako.rs
@@ -31,24 +31,24 @@
             Auto,
             Cursor(Cursor),
         }
 
         #[cfg(not(feature = "gecko"))]
         pub type T = Keyword;
 
         #[cfg(feature = "gecko")]
-        #[derive(Clone, PartialEq, Debug)]
+        #[derive(Clone, Debug, PartialEq)]
         pub struct Image {
             pub url: SpecifiedUrl,
             pub hotspot: Option<(f32, f32)>,
         }
 
         #[cfg(feature = "gecko")]
-        #[derive(Clone, PartialEq, Debug)]
+        #[derive(Clone, Debug, PartialEq)]
         pub struct T {
             pub images: Vec<Image>,
             pub keyword: Keyword,
         }
 
         #[cfg(feature = "gecko")]
         impl ToCss for Image {
             fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
--- a/servo/components/style/properties/longhand/position.mako.rs
+++ b/servo/components/style/properties/longhand/position.mako.rs
@@ -291,24 +291,24 @@ macro_rules! impl_align_conversions {
         animation_value_type="discrete">
     use std::fmt;
     use style_traits::ToCss;
     use values::computed::ComputedValueAsSpecified;
 
     pub type SpecifiedValue = computed_value::T;
 
     pub mod computed_value {
-        #[derive(PartialEq, Clone, Eq, Copy, Debug)]
+        #[derive(Clone, Copy, Debug, Eq, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum AutoFlow {
             Row,
             Column,
         }
 
-        #[derive(PartialEq, Clone, Eq, Copy, Debug)]
+        #[derive(Clone, Copy, Debug, Eq, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T {
             pub autoflow: AutoFlow,
             pub dense: bool,
         }
     }
 
     no_viewport_percentage!(SpecifiedValue);
--- a/servo/components/style/properties/longhand/table.mako.rs
+++ b/servo/components/style/properties/longhand/table.mako.rs
@@ -18,17 +18,17 @@
 
     impl ComputedValueAsSpecified for SpecifiedValue {}
     no_viewport_percentage!(SpecifiedValue);
     pub type SpecifiedValue = computed_value::T;
     pub mod computed_value {
         use std::fmt;
         use style_traits::ToCss;
 
-        #[derive(PartialEq, Clone, Copy, Debug)]
+        #[derive(Clone, Copy, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T(pub i32);
 
         impl ToCss for T {
             fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write {
                 Ok(())
             }
         }
--- a/servo/components/style/properties/longhand/text.mako.rs
+++ b/servo/components/style/properties/longhand/text.mako.rs
@@ -33,17 +33,17 @@
     pub struct SpecifiedValue {
         pub first: Side,
         pub second: Option<Side>
     }
 
     pub mod computed_value {
         pub use super::Side;
 
-        #[derive(Debug, Clone, PartialEq)]
+        #[derive(Clone, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T {
             // When the specified value only has one side, that's the "second"
             // side, and the sides are logical, so "second" means "end".  The
             // start side is Clip in that case.
             //
             // When the specified value has two sides, those are our "first"
             // and "second" sides, and they are physical sides ("left" and
--- a/servo/components/style/properties/longhand/ui.mako.rs
+++ b/servo/components/style/properties/longhand/ui.mako.rs
@@ -49,17 +49,17 @@
                    spec="None (Nonstandard Firefox-only property)">
     use std::fmt;
     use style_traits::ToCss;
     use values::computed::ComputedValueAsSpecified;
 
     no_viewport_percentage!(SpecifiedValue);
 
     pub mod computed_value {
-        #[derive(Debug, Clone, Copy, PartialEq)]
+        #[derive(Clone, Copy, Debug, PartialEq)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub struct T(pub bool);
     }
 
     pub use self::computed_value::T as SpecifiedValue;
 
     impl ToCss for computed_value::T {
         fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -226,17 +226,17 @@ pub mod shorthands {
 ///
 /// This needs to be "included" by mako at least after all longhand modules,
 /// given they populate the global data.
 pub mod animated_properties {
     <%include file="/helpers/animated_properties.mako.rs" />
 }
 
 /// A longhand or shorthand porperty
-#[derive(Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug)]
 pub struct NonCustomPropertyId(usize);
 
 impl From<LonghandId> for NonCustomPropertyId {
     fn from(id: LonghandId) -> Self {
         NonCustomPropertyId(id as usize)
     }
 }
 
@@ -391,17 +391,17 @@ impl PropertyDeclarationIdSet {
                 }
             }
         }
     }
 }
 
 /// An enum to represent a CSS Wide keyword.
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
 pub enum CSSWideKeyword {
     /// The `initial` keyword.
     Initial,
     /// The `inherit` keyword.
     Inherit,
     /// The `unset` keyword.
     Unset,
 }
@@ -454,17 +454,17 @@ bitflags! {
         /// This longhand property applies to ::first-line.
         const APPLIES_TO_FIRST_LINE = 1 << 5,
         /// This longhand property applies to ::placeholder.
         const APPLIES_TO_PLACEHOLDER = 1 << 6,
     }
 }
 
 /// An identifier for a given longhand property.
-#[derive(Clone, Copy, Eq, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum LonghandId {
     % for i, property in enumerate(data.longhands):
         /// ${property.name}
         ${property.camel_case} = ${i},
     % endfor
 }
 
@@ -766,31 +766,31 @@ impl ShorthandId {
             // 'all' accepts no value other than CSS-wide keywords
             ShorthandId::All => Err(StyleParseError::UnspecifiedError.into())
         }
     }
 }
 
 /// Servo's representation of a declared value for a given `T`, which is the
 /// declared value for that property.
-#[derive(Clone, PartialEq, Eq, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub enum DeclaredValue<'a, T: 'a> {
     /// A known specified value from the stylesheet.
     Value(&'a T),
     /// An unparsed value that contains `var()` functions.
     WithVariables(&'a Arc<UnparsedValue>),
     /// An CSS-wide keyword.
     CSSWideKeyword(CSSWideKeyword),
 }
 
 /// A variant of DeclaredValue that owns its data. This separation exists so
 /// that PropertyDeclaration can avoid embedding a DeclaredValue (and its
 /// extra discriminant word) and synthesize dependent DeclaredValues for
 /// PropertyDeclaration instances as needed.
-#[derive(Clone, PartialEq, Eq, Debug)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub enum DeclaredValueOwned<T> {
     /// A known specified value from the stylesheet.
     Value(T),
     /// An unparsed value that contains `var()` functions.
     WithVariables(Arc<UnparsedValue>),
     /// An CSS-wide keyword.
     CSSWideKeyword(CSSWideKeyword),
 }
@@ -802,17 +802,17 @@ impl<T> DeclaredValueOwned<T> {
             DeclaredValueOwned::Value(ref v) => DeclaredValue::Value(v),
             DeclaredValueOwned::WithVariables(ref v) => DeclaredValue::WithVariables(v),
             DeclaredValueOwned::CSSWideKeyword(v) => DeclaredValue::CSSWideKeyword(v),
         }
     }
 }
 
 /// An unparsed property value that contains `var()` functions.
-#[derive(PartialEq, Eq, Debug)]
+#[derive(Debug, Eq, PartialEq)]
 pub struct UnparsedValue {
     /// The css serialization for this value.
     css: String,
     /// The first token type for this serialization.
     first_token_type: TokenSerializationType,
     /// The url data for resolving url values.
     url_data: UrlExtraData,
     /// The shorthand this came from.
@@ -905,17 +905,17 @@ impl<'a, T: ToCss> ToCss for DeclaredVal
             },
             DeclaredValue::CSSWideKeyword(ref keyword) => keyword.to_css(dest),
         }
     }
 }
 
 /// An identifier for a given property declaration, which can be either a
 /// longhand or a custom property.
-#[derive(PartialEq, Clone, Copy)]
+#[derive(Clone, Copy, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum PropertyDeclarationId<'a> {
     /// A longhand.
     Longhand(LonghandId),
     /// A custom property declaration.
     Custom(&'a ::custom_properties::Name),
 }
 
@@ -970,17 +970,17 @@ impl<'a> PropertyDeclarationId<'a> {
                 s.into()
             }
         }
     }
 }
 
 /// Servo's representation of a CSS property, that is, either a longhand, a
 /// shorthand, or a custom property.
-#[derive(Eq, PartialEq, Clone)]
+#[derive(Clone, Eq, PartialEq)]
 pub enum PropertyId {
     /// A longhand property.
     Longhand(LonghandId),
     /// A shorthand property.
     Shorthand(ShorthandId),
     /// A custom property.
     Custom(::custom_properties::Name),
 }
@@ -1279,17 +1279,17 @@ impl PropertyParserContext {
         Self {
             stylesheet_origin: context.stylesheet_origin,
             rule_type: context.rule_type(),
         }
     }
 }
 
 /// Servo's representation for a property declaration.
-#[derive(PartialEq, Clone)]
+#[derive(Clone, PartialEq)]
 pub enum PropertyDeclaration {
     % for property in data.longhands:
         /// ${property.name}
         % if property.boxed:
             ${property.camel_case}(Box<longhands::${property.ident}::SpecifiedValue>),
         % else:
             ${property.camel_case}(longhands::${property.ident}::SpecifiedValue),
         % endif
@@ -1719,17 +1719,17 @@ pub mod style_structs {
     use logical_geometry::WritingMode;
     use media_queries::Device;
     use values::computed::NonNegativeAu;
 
     % for style_struct in data.active_style_structs():
         % if style_struct.name == "Font":
         #[derive(Clone, Debug)]
         % else:
-        #[derive(PartialEq, Clone, Debug)]
+        #[derive(Clone, Debug, PartialEq)]
         % endif
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         /// The ${style_struct.name} style struct.
         pub struct ${style_struct.name} {
             % for longhand in style_struct.longhands:
                 /// The ${longhand.name} computed value.
                 pub ${longhand.ident}: longhands::${longhand.ident}::computed_value::T,
             % endfor
@@ -3490,17 +3490,17 @@ pub fn modify_border_style_for_inline_si
 
     if !is_last_fragment_of_element {
         let side = style.writing_mode.inline_end_physical_side();
         modify_side(style, side)
     }
 }
 
 /// An identifier for a given alias property.
-#[derive(Clone, Copy, Eq, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum AliasId {
     % for i, property in enumerate(data.all_aliases()):
         /// ${property.name}
         ${property.camel_case} = ${i},
     % endfor
 }
 
--- a/servo/components/style/rule_tree/mod.rs
+++ b/servo/components/style/rule_tree/mod.rs
@@ -64,17 +64,17 @@ impl Drop for RuleTree {
 
 /// A style source for the rule node. It can either be a CSS style rule or a
 /// declaration block.
 ///
 /// Note that, even though the declaration block from inside the style rule
 /// could be enough to implement the rule tree, keeping the whole rule provides
 /// more debuggability, and also the ability of show those selectors to
 /// devtools.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub enum StyleSource {
     /// A style rule stable pointer.
     Style(Arc<Locked<StyleRule>>),
     /// A declaration block stable pointer.
     Declarations(Arc<Locked<PropertyDeclarationBlock>>),
     /// Indicates no style source. Used to save an Option wrapper around the stylesource in
     /// RuleNode
     None,
@@ -437,17 +437,17 @@ const RULE_TREE_GC_INTERVAL: usize = 300
 
 /// The cascade level these rules are relevant at, as per[1].
 ///
 /// The order of variants declared here is significant, and must be in
 /// _ascending_ order of precedence.
 ///
 /// [1]: https://drafts.csswg.org/css-cascade/#cascade-origin
 #[repr(u8)]
-#[derive(Eq, PartialEq, Copy, Clone, Debug, PartialOrd)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum CascadeLevel {
     /// Normal User-Agent rules.
     UANormal = 0,
     /// Presentational hints.
     PresHints,
     /// User normal rules.
     UserNormal,
--- a/servo/components/style/selector_parser.rs
+++ b/servo/components/style/selector_parser.rs
@@ -75,17 +75,17 @@ impl<'a> SelectorParser<'a> {
         self.url_data.map_or(false, |d| d.is_chrome())
     }
 }
 
 /// This enumeration determines if a pseudo-element is eagerly cascaded or not.
 ///
 /// If you're implementing a public selector for `Servo` that the end-user might
 /// customize, then you probably need to make it eager.
-#[derive(Debug, Clone, PartialEq, Eq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub enum PseudoElementCascadeType {
     /// Eagerly cascaded pseudo-elements are "normal" pseudo-elements (i.e.
     /// `::before` and `::after`). They inherit styles normally as another
     /// selector would do, and they're computed as part of the cascade.
     Eager,
     /// Lazy pseudo-elements are affected by selector matching, but they're only
     /// computed when needed, and not before. They're useful for general
     /// pseudo-elements that are not very common.
--- a/servo/components/style/servo/media_queries.rs
+++ b/servo/components/style/servo/media_queries.rs
@@ -128,27 +128,27 @@ impl Device {
     pub fn default_background_color(&self) -> RGBA {
         RGBA::new(255, 255, 255, 255)
     }
 }
 
 /// A expression kind servo understands and parses.
 ///
 /// Only `pub` for unit testing, please don't use it directly!
-#[derive(PartialEq, Clone, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum ExpressionKind {
     /// http://dev.w3.org/csswg/mediaqueries-3/#width
     Width(Range<specified::Length>),
 }
 
 /// A single expression a per:
 ///
 /// http://dev.w3.org/csswg/mediaqueries-3/#media1
-#[derive(PartialEq, Clone, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct Expression(ExpressionKind);
 
 impl Expression {
     /// The kind of expression we're, just for unit testing.
     ///
     /// Eventually this will become servo-only.
     pub fn kind_for_testing(&self) -> &ExpressionKind {
@@ -216,17 +216,17 @@ impl ToCss for Expression {
         write!(dest, ")")
     }
 }
 
 /// An enumeration that represents a ranged value.
 ///
 /// Only public for testing, implementation details of `Expression` may change
 /// for Stylo.
-#[derive(PartialEq, Eq, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum Range<T> {
     /// At least the inner value.
     Min(T),
     /// At most the inner value.
     Max(T),
     /// Exactly the inner value.
     Eq(T),
--- a/servo/components/style/servo/selector_parser.rs
+++ b/servo/components/style/servo/selector_parser.rs
@@ -26,17 +26,17 @@ use std::fmt;
 use std::fmt::Debug;
 use std::mem;
 use std::ops::{Deref, DerefMut};
 use style_traits::{ParseError, StyleParseError};
 
 /// A pseudo-element, both public and private.
 ///
 /// NB: If you add to this list, be sure to update `each_simple_pseudo_element` too.
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 #[allow(missing_docs)]
 #[repr(usize)]
 pub enum PseudoElement {
     // Eager pseudos. Keep these first so that eager_index() works.
     After = 0,
     Before,
     Selection,
@@ -247,17 +247,17 @@ impl PseudoElement {
     }
 }
 
 /// The type used for storing pseudo-class string arguments.
 pub type PseudoClassStringArg = Box<str>;
 
 /// A non tree-structural pseudo-class.
 /// See https://drafts.csswg.org/selectors-4/#structural-pseudos
-#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 #[allow(missing_docs)]
 pub enum NonTSPseudoClass {
     Active,
     AnyLink,
     Checked,
     Disabled,
     Enabled,
--- a/servo/components/style/servo/url.rs
+++ b/servo/components/style/servo/url.rs
@@ -17,17 +17,17 @@ use values::computed::{Context, ToComput
 /// A specified url() value for servo.
 ///
 /// Servo eagerly resolves SpecifiedUrls, which it can then take advantage of
 /// when computing values. In contrast, Gecko uses a different URL backend, so
 /// eagerly resolving with rust-url would be duplicated work.
 ///
 /// However, this approach is still not necessarily optimal: See
 /// https://bugzilla.mozilla.org/show_bug.cgi?id=1347435#c6
-#[derive(Clone, Debug, HeapSizeOf, Serialize, Deserialize)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
 pub struct SpecifiedUrl {
     /// The original URI. This might be optional since we may insert computed
     /// values of images into the cascade directly, and we don't bother to
     /// convert their serialization.
     ///
     /// Refcounted since cloning this should be cheap and data: uris can be
     /// really large.
     original: Option<Arc<String>>,
--- a/servo/components/style/stylesheets/keyframes_rule.rs
+++ b/servo/components/style/stylesheets/keyframes_rule.rs
@@ -94,17 +94,17 @@ impl DeepCloneWithLock for KeyframesRule
             vendor_prefix: self.vendor_prefix.clone(),
             source_location: self.source_location.clone(),
         }
     }
 }
 
 /// A number from 0 to 1, indicating the percentage of the animation when this
 /// keyframe should run.
-#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
+#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct KeyframePercentage(pub f32);
 
 impl ::std::cmp::Ord for KeyframePercentage {
     #[inline]
     fn cmp(&self, other: &Self) -> ::std::cmp::Ordering {
         // We know we have a number from 0 to 1, so unwrap() here is safe.
         self.0.partial_cmp(&other.0).unwrap()
@@ -142,17 +142,17 @@ impl KeyframePercentage {
         };
 
         Ok(percentage)
     }
 }
 
 /// A keyframes selector is a list of percentages or from/to symbols, which are
 /// converted at parse time to percentages.
-#[derive(Clone, Debug, PartialEq, Eq)]
+#[derive(Clone, Debug, Eq, PartialEq)]
 pub struct KeyframeSelector(Vec<KeyframePercentage>);
 
 impl ToCss for KeyframeSelector {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
         let mut iter = self.0.iter();
         iter.next().unwrap().to_css(dest)?;
         for percentage in iter {
             write!(dest, ", ")?;
--- a/servo/components/style/stylesheets/mod.rs
+++ b/servo/components/style/stylesheets/mod.rs
@@ -83,17 +83,17 @@ impl UrlExtraData {
 // XXX We probably need to figure out whether we should mark Eq here.
 // It is currently marked so because properties::UnparsedValue wants Eq.
 #[cfg(feature = "gecko")]
 impl Eq for UrlExtraData {}
 
 /// A CSS rule.
 ///
 /// TODO(emilio): Lots of spec links should be around.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 #[allow(missing_docs)]
 pub enum CssRule {
     // No Charset here, CSSCharsetRule has been removed from CSSOM
     // https://drafts.csswg.org/cssom/#changes-from-5-december-2013
 
     Namespace(Arc<Locked<NamespaceRule>>),
     Import(Arc<Locked<ImportRule>>),
     Style(Arc<Locked<StyleRule>>),
@@ -130,17 +130,17 @@ impl MallocSizeOfWithGuard for CssRule {
             CssRule::Supports(_) => 0,
             CssRule::Page(_) => 0,
             CssRule::Document(_)  => 0,
         }
     }
 }
 
 #[allow(missing_docs)]
-#[derive(PartialEq, Eq, Copy, Clone, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum CssRuleType {
     // https://drafts.csswg.org/cssom/#the-cssrule-interface
     Style               = 1,
     Charset             = 2,
     Import              = 3,
     Media               = 4,
     FontFace            = 5,
     Page                = 6,
--- a/servo/components/style/stylesheets/origin.rs
+++ b/servo/components/style/stylesheets/origin.rs
@@ -5,17 +5,17 @@
 //! [CSS cascade origins](https://drafts.csswg.org/css-cascade/#cascading-origins).
 
 use std::marker::PhantomData;
 use std::ops::BitOrAssign;
 
 /// Each style rule has an origin, which determines where it enters the cascade.
 ///
 /// https://drafts.csswg.org/css-cascade/#cascading-origins
-#[derive(Clone, PartialEq, Eq, Copy, Debug)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 #[repr(u8)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum Origin {
     /// https://drafts.csswg.org/css-cascade/#cascade-origin-user-agent
     UserAgent = 1 << 0,
 
     /// https://drafts.csswg.org/css-cascade/#cascade-origin-user
     User = 1 << 1,
--- a/servo/components/style/stylesheets/rule_parser.rs
+++ b/servo/components/style/stylesheets/rule_parser.rs
@@ -81,17 +81,17 @@ impl<'b> TopLevelRuleParser<'b> {
     pub fn take_had_hierarchy_error(&mut self) -> bool {
         let had_hierarchy_error = self.had_hierarchy_error;
         self.had_hierarchy_error = false;
         had_hierarchy_error
     }
 }
 
 /// The current state of the parser.
-#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone)]
+#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
 pub enum State {
     /// We haven't started parsing rules.
     Start = 1,
     /// We're parsing `@import` rules.
     Imports = 2,
     /// We're parsing `@namespace` rules.
     Namespaces = 3,
     /// We're parsing the main body of the stylesheet.
--- a/servo/components/style/stylesheets/stylesheet.rs
+++ b/servo/components/style/stylesheets/stylesheet.rs
@@ -31,17 +31,17 @@ pub struct UserAgentStylesheets {
     pub user_or_user_agent_stylesheets: Vec<Stylesheet>,
     /// The quirks mode stylesheet.
     pub quirks_mode_stylesheet: Stylesheet,
 }
 
 /// A set of namespaces applying to a given stylesheet.
 ///
 /// The namespace id is used in gecko
-#[derive(Clone, Default, Debug)]
+#[derive(Clone, Debug, Default)]
 #[allow(missing_docs)]
 pub struct Namespaces {
     pub default: Option<(Namespace, NamespaceId)>,
     pub prefixes: FnvHashMap<Prefix, (Namespace, NamespaceId)>,
 }
 
 /// The contents of a given stylesheet. This effectively maps to a
 /// StyleSheetInner in Gecko.
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -421,17 +421,17 @@ pub struct Stylist {
     /// The rule tree, that stores the results of selector matching.
     rule_tree: RuleTree,
 
     /// The total number of times the stylist has been rebuilt.
     num_rebuilds: usize,
 }
 
 /// What cascade levels to include when styling elements.
-#[derive(Copy, Clone, PartialEq)]
+#[derive(Clone, Copy, PartialEq)]
 pub enum RuleInclusion {
     /// Include rules for style sheets at all cascade levels.  This is the
     /// normal rule inclusion mode.
     All,
     /// Only include rules from UA and user level sheets.  Used to implement
     /// `getDefaultComputedStyle`.
     DefaultOnly,
 }
--- a/servo/components/style/timer.rs
+++ b/servo/components/style/timer.rs
@@ -4,28 +4,28 @@
 
 #![deny(missing_docs)]
 
 //! A timer module, used to define a `Timer` type, that is controlled by script.
 
 use time;
 
 /// The `TimerMode` is used to determine what time should the `Timer` return.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 enum TimerMode {
     /// The timer should return a fixed value.
     Test(f64),
     /// The timer should return the actual time.
     Current,
 }
 
 /// A `Timer` struct that takes care of giving the current time for animations.
 ///
 /// This is needed to be allowed to hook the time in the animations' test-mode.
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 pub struct Timer {
     mode: TimerMode,
 }
 
 impl Timer {
     /// Creates a new "normal" timer, i.e., a "Current" mode timer.
     #[inline]
     pub fn new() -> Self {
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -35,17 +35,17 @@ pub struct PerLevelTraversalData {
 /// to enfore that callers process root invalidations before starting the traversal.
 pub struct PreTraverseToken(bool);
 impl PreTraverseToken {
     /// Whether we should traverse children.
     pub fn should_traverse(&self) -> bool { self.0 }
 }
 
 /// The kind of traversals we could perform.
-#[derive(Debug, Copy, Clone)]
+#[derive(Clone, Copy, Debug)]
 pub enum TraversalDriver {
     /// A potentially parallel traversal.
     Parallel,
     /// A sequential traversal.
     Sequential,
 }
 
 impl TraversalDriver {
--- a/servo/components/style/values/computed/align.rs
+++ b/servo/components/style/values/computed/align.rs
@@ -12,17 +12,17 @@ use values::computed::{ComputedValueAsSp
 use values::specified;
 
 pub use super::specified::{AlignItems, AlignJustifyContent, AlignJustifySelf};
 
 /// The computed value for the `justify-items` property.
 ///
 /// Need to carry around both the specified and computed value to handle the
 /// special legacy keyword. Sigh.
-#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub struct JustifyItems {
     /// The specified value for the property. Can contain `auto`.
     pub specified: specified::JustifyItems,
     /// The computed value for the property. Cannot contain `auto`.
     pub computed: specified::JustifyItems,
 }
 
 impl ToCss for JustifyItems {
--- a/servo/components/style/values/computed/length.rs
+++ b/servo/components/style/values/computed/length.rs
@@ -59,17 +59,17 @@ impl ToComputedValue for specified::Leng
     }
 
     #[inline]
     fn from_computed_value(computed: &Au) -> Self {
         specified::Length::NoCalc(specified::NoCalcLength::from_computed_value(computed))
     }
 }
 
-#[derive(Clone, PartialEq, Copy, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 #[allow(missing_docs)]
 pub struct CalcLengthOrPercentage {
     pub clamping_mode: AllowedLengthType,
     length: Au,
     pub percentage: Option<Percentage>,
 }
 
--- a/servo/components/style/values/computed/mod.rs
+++ b/servo/components/style/values/computed/mod.rs
@@ -549,17 +549,17 @@ impl From<Au> for NonNegativeAu {
     #[inline]
     fn from(au: Au) -> NonNegativeAu {
         NonNegative::<Au>(au)
     }
 }
 
 /// The computed value of a CSS `url()`, resolved relative to the stylesheet URL.
 #[cfg(feature = "servo")]
-#[derive(Clone, Debug, HeapSizeOf, Serialize, Deserialize, PartialEq)]
+#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
 pub enum ComputedUrl {
     /// The `url()` was invalid or it wasn't specified by the user.
     Invalid(Arc<String>),
     /// The resolved `url()` relative to the stylesheet URL.
     Valid(ServoUrl),
 }
 
 /// TODO: Properly build ComputedUrl for gecko
--- a/servo/components/style/values/computed/time.rs
+++ b/servo/components/style/values/computed/time.rs
@@ -4,17 +4,17 @@
 
 //! Computed time values.
 
 use std::fmt;
 use style_traits::ToCss;
 use values::CSSFloat;
 
 /// A computed `<time>` value.
-#[derive(Clone, PartialEq, PartialOrd, Copy, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
 pub struct Time {
     seconds: CSSFloat,
 }
 
 impl Time {
     /// Creates a time value from a seconds amount.
     pub fn from_seconds(seconds: CSSFloat) -> Self {
--- a/servo/components/style/values/generics/grid.rs
+++ b/servo/components/style/values/generics/grid.rs
@@ -9,17 +9,17 @@ use cssparser::Parser;
 use parser::{Parse, ParserContext};
 use std::{fmt, mem, usize};
 use style_traits::{ToCss, ParseError, StyleParseError};
 use values::{CSSFloat, CustomIdent, serialize_dimension};
 use values::computed::{ComputedValueAsSpecified, Context, ToComputedValue};
 use values::specified::Integer;
 use values::specified::grid::parse_line_names;
 
-#[derive(PartialEq, Clone, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 /// A `<grid-line>` type.
 ///
 /// https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line
 pub struct GridLine {
     /// Flag to check whether it's a `span` keyword.
     pub is_span: bool,
     /// A custom identifier for named lines.
@@ -133,17 +133,17 @@ impl ComputedValueAsSpecified for GridLi
 no_viewport_percentage!(GridLine);
 
 define_css_keyword_enum!{ TrackKeyword:
     "auto" => Auto,
     "max-content" => MaxContent,
     "min-content" => MinContent
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 /// A track breadth for explicit grid track sizing. It's generic solely to
 /// avoid re-implementing it for the computed type.
 ///
 /// https://drafts.csswg.org/css-grid/#typedef-track-breadth
 pub enum TrackBreadth<L> {
     /// The generic type is almost always a non-negative `<length-percentage>`
     Breadth(L),
@@ -377,17 +377,17 @@ impl Parse for RepeatCount {
 
 impl ComputedValueAsSpecified for RepeatCount {}
 no_viewport_percentage!(RepeatCount);
 
 /// The structure containing `<line-names>` and `<track-size>` values.
 ///
 /// It can also hold `repeat()` function parameters, which expands into the respective
 /// values in its computed form.
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct TrackRepeat<L> {
     /// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`)
     pub count: RepeatCount,
     /// `<line-names>` accompanying `<track_size>` values.
     ///
     /// If there's no `<line-names>`, then it's represented by an empty vector.
     /// For N `<track-size>` values, there will be N+1 `<line-names>`, and so this vector's
@@ -503,17 +503,17 @@ impl<L: ToComputedValue> ToComputedValue
             line_names: computed.line_names.clone(),
         }
     }
 }
 
 /// The type of a `<track-list>` as determined during parsing.
 ///
 /// https://drafts.csswg.org/css-grid/#typedef-track-list
-#[derive(Clone, Copy, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum TrackListType {
     /// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list)
     ///
     /// If this type exists, then the value at the index in `line_names` field in `TrackList`
     /// has the `<line-names>?` list that comes before `<auto-repeat>`. If it's a specified value,
     /// then the `repeat()` function (that follows the line names list) is also at the given index
     /// in `values` field. On the contrary, if it's a computed value, then the `repeat()` function
@@ -528,17 +528,17 @@ pub enum TrackListType {
     Explicit,
 }
 
 impl ComputedValueAsSpecified for TrackListType {}
 
 /// A grid `<track-list>` type.
 ///
 /// https://drafts.csswg.org/css-grid/#typedef-track-list
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct TrackList<T> {
     /// The type of this `<track-list>` (auto, explicit or general).
     ///
     /// In order to avoid parsing the same value multiple times, this does a single traversal
     /// and arrives at the type of value it has parsed (or bails out gracefully with an error).
     pub list_type: TrackListType,
     /// A vector of `<track-size>` values.
@@ -596,17 +596,17 @@ impl<T: ToCss> ToCss for TrackList<T> {
         Ok(())
     }
 }
 
 /// The `<line-name-list>` for subgrids.
 ///
 /// `subgrid [ <line-names> | repeat(<positive-integer> | auto-fill, <line-names>+) ]+`
 /// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list
-#[derive(Clone, PartialEq, Debug, Default)]
+#[derive(Clone, Debug, Default, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct LineNameList {
     /// The optional `<line-name-list>`
     pub names: Box<[Box<[CustomIdent]>]>,
     /// Indicates the line name that requires `auto-fill`
     pub fill_idx: Option<u32>,
 }
 
@@ -693,17 +693,17 @@ impl ToCss for LineNameList {
 }
 
 impl ComputedValueAsSpecified for LineNameList {}
 no_viewport_percentage!(LineNameList);
 
 /// Variants for `<grid-template-rows> | <grid-template-columns>`
 /// Subgrid deferred to Level 2 spec due to lack of implementation.
 /// But it's implemented in gecko, so we have to as well.
-#[derive(Clone, PartialEq, Debug, ToCss)]
+#[derive(Clone, Debug, PartialEq, ToCss)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum GridTemplateComponent<L> {
     /// `none` value.
     None,
     /// The grid `<track-list>`
     TrackList(TrackList<L>),
     /// A `subgrid <line-name-list>?`
     Subgrid(LineNameList),
--- a/servo/components/style/values/generics/svg.rs
+++ b/servo/components/style/values/generics/svg.rs
@@ -97,17 +97,17 @@ impl<ColorType: Parse, UrlPaintServer: P
         }
     }
 }
 
 /// A value of <length> | <percentage> | <number> for svg which allow unitless length.
 /// https://www.w3.org/TR/SVG11/painting.html#StrokeProperties
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 #[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToAnimatedValue)]
-#[derive(ToAnimatedZero, ToCss, ToComputedValue)]
+#[derive(ToAnimatedZero, ToComputedValue, ToCss)]
 pub enum SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number> {
     /// <length> | <percentage>
     LengthOrPercentage(LengthOrPercentage),
     /// <number>
     Number(Number),
 }
 
 impl<L, N> ComputeSquaredDistance for SvgLengthOrPercentageOrNumber<L, N>
@@ -190,17 +190,17 @@ pub enum SVGLength<LengthType> {
     /// `<length> | <percentage> | <number>`
     Length(LengthType),
     /// `context-value`
     ContextValue,
 }
 
 /// Generic value for stroke-dasharray.
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
-#[derive(Clone, ComputeSquaredDistance, Debug, PartialEq, HasViewportPercentage, ToAnimatedValue, ToComputedValue)]
+#[derive(Clone, ComputeSquaredDistance, Debug, HasViewportPercentage, PartialEq, ToAnimatedValue, ToComputedValue)]
 pub enum SVGStrokeDashArray<LengthType> {
     /// `[ <length> | <percentage> | <number> ]#`
     Values(Vec<LengthType>),
     /// `context-value`
     ContextValue,
 }
 
 impl<LengthType> ToCss for SVGStrokeDashArray<LengthType> where LengthType: ToCss {
--- a/servo/components/style/values/mod.rs
+++ b/servo/components/style/values/mod.rs
@@ -93,17 +93,17 @@ impl<A: Parse, B: Parse> Parse for Eithe
             Ok(Either::First(v))
         } else {
             B::parse(context, input).map(Either::Second)
         }
     }
 }
 
 /// https://drafts.csswg.org/css-values-4/#custom-idents
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+#[derive(Clone, Debug, Eq, Hash, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct CustomIdent(pub Atom);
 
 impl CustomIdent {
     /// Parse an already-tokenizer identifier
     pub fn from_ident<'i>(ident: &CowRcStr<'i>, excluding: &[&str]) -> Result<Self, ParseError<'i>> {
         let valid = match_ignore_ascii_case! { ident,
             "initial" | "inherit" | "unset" | "default" => false,
@@ -122,17 +122,17 @@ impl CustomIdent {
 
 impl ToCss for CustomIdent {
     fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
         serialize_identifier(&self.0.to_string(), dest)
     }
 }
 
 /// https://drafts.csswg.org/css-animations/#typedef-keyframes-name
-#[derive(Debug, Clone)]
+#[derive(Clone, Debug)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum KeyframesName {
     /// <custom-ident>
     Ident(CustomIdent),
     /// <string>
     QuotedString(Atom),
 }
 
--- a/servo/components/style/values/specified/align.rs
+++ b/servo/components/style/values/specified/align.rs
@@ -108,17 +108,17 @@ const ALIGN_ALL_BITS: u16 = structs::NS_
 const ALIGN_ALL_SHIFT: u32 = structs::NS_STYLE_ALIGN_ALL_SHIFT;
 
 /// Value of the `align-content` or `justify-content` property.
 ///
 /// https://drafts.csswg.org/css-align/#content-distribution
 ///
 /// The 16-bit field stores the primary value in its lower 8 bits, and the optional fallback value
 /// in its upper 8 bits.  This matches the representation of these properties in Gecko.
-#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
 pub struct AlignJustifyContent(u16);
 
 impl AlignJustifyContent {
     /// The initial value 'normal'
     #[inline]
     pub fn normal() -> Self {
         Self::new(ALIGN_NORMAL)
@@ -201,17 +201,17 @@ impl Parse for AlignJustifyContent {
         }
         Err(StyleParseError::UnspecifiedError.into())
     }
 }
 
 /// Value of the `align-self` or `justify-self` property.
 ///
 /// https://drafts.csswg.org/css-align/#self-alignment
-#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
 pub struct AlignJustifySelf(pub AlignFlags);
 
 impl AlignJustifySelf {
     /// The initial value 'auto'
     #[inline]
     pub fn auto() -> Self {
         AlignJustifySelf(ALIGN_AUTO)
     }
@@ -239,17 +239,17 @@ impl Parse for AlignJustifySelf {
         }
         Err(StyleParseError::UnspecifiedError.into())
     }
 }
 
 /// Value of the `align-items` property
 ///
 /// https://drafts.csswg.org/css-align/#self-alignment
-#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
 pub struct AlignItems(pub AlignFlags);
 
 impl AlignItems {
     /// The initial value 'normal'
     #[inline]
     pub fn normal() -> Self {
         AlignItems(ALIGN_NORMAL)
     }
@@ -277,17 +277,17 @@ impl Parse for AlignItems {
         }
         Err(StyleParseError::UnspecifiedError.into())
     }
 }
 
 /// Value of the `justify-items` property
 ///
 /// https://drafts.csswg.org/css-align/#justify-items-property
-#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
 pub struct JustifyItems(pub AlignFlags);
 
 impl JustifyItems {
     /// The initial value 'auto'
     #[inline]
     pub fn auto() -> Self {
         JustifyItems(ALIGN_AUTO)
     }
--- a/servo/components/style/values/specified/calc.rs
+++ b/servo/components/style/values/specified/calc.rs
@@ -58,17 +58,17 @@ pub enum CalcUnit {
     LengthOrPercentage,
     /// `<angle>`
     Angle,
     /// `<time>`
     Time,
 }
 
 /// A struct to hold a simplified `<length>` or `<percentage>` expression.
-#[derive(Clone, PartialEq, Copy, Debug, Default)]
+#[derive(Clone, Copy, Debug, Default, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 #[allow(missing_docs)]
 pub struct CalcLengthOrPercentage {
     pub clamping_mode: AllowedLengthType,
     pub absolute: Option<Au>,
     pub vw: Option<CSSFloat>,
     pub vh: Option<CSSFloat>,
     pub vmin: Option<CSSFloat>,
--- a/servo/components/style/values/specified/color.rs
+++ b/servo/components/style/values/specified/color.rs
@@ -13,17 +13,17 @@ use parser::{ParserContext, Parse};
 use properties::longhands::color::SystemColor;
 use std::fmt;
 use std::io::Write;
 use style_traits::{ToCss, ParseError, StyleParseError, ValueParseError};
 use super::AllowQuirks;
 use values::computed::{Color as ComputedColor, Context, ToComputedValue};
 
 /// Specified color value
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum Color {
     /// The 'currentColor' keyword
     CurrentColor,
     /// A specific RGBA color
     Numeric {
         /// Parsed RGBA color
         parsed: RGBA,
--- a/servo/components/style/values/specified/grid.rs
+++ b/servo/components/style/values/specified/grid.rs
@@ -92,17 +92,17 @@ pub fn parse_line_names<'i, 't>(input: &
 
         Ok(values.into_boxed_slice())
     })
 }
 
 /// The type of `repeat` function (only used in parsing).
 ///
 /// https://drafts.csswg.org/css-grid/#typedef-track-repeat
-#[derive(Clone, Copy, PartialEq, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 enum RepeatType {
     /// [`<auto-repeat>`](https://drafts.csswg.org/css-grid/#typedef-auto-repeat)
     Auto,
     /// [`<track-repeat>`](https://drafts.csswg.org/css-grid/#typedef-track-repeat)
     Normal,
     /// [`<fixed-repeat>`](https://drafts.csswg.org/css-grid/#typedef-fixed-repeat)
     Fixed,
--- a/servo/components/style/values/specified/length.rs
+++ b/servo/components/style/values/specified/length.rs
@@ -47,17 +47,17 @@ pub const AU_PER_PC: CSSFloat = AU_PER_P
 /// Same as Gecko's AppUnitsToIntCSSPixels
 ///
 /// Converts app units to integer pixel values,
 /// rounding during the conversion
 pub fn au_to_int_px(au: f32) -> i32 {
     (au / AU_PER_PX).round() as i32
 }
 
-#[derive(Clone, PartialEq, Copy, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 /// A font relative length.
 pub enum FontRelativeLength {
     /// A "em" value: https://drafts.csswg.org/css-values/#em
     Em(CSSFloat),
     /// A "ex" value: https://drafts.csswg.org/css-values/#ex
     Ex(CSSFloat),
     /// A "ch" value: https://drafts.csswg.org/css-values/#ch
@@ -162,17 +162,17 @@ impl FontRelativeLength {
                 } else {
                     context.device().root_font_size().scale_by(length)
                 }
             }
         }
     }
 }
 
-#[derive(Clone, PartialEq, Copy, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 /// A viewport-relative length.
 ///
 /// https://drafts.csswg.org/css-values/#viewport-relative-lengths
 pub enum ViewportPercentageLength {
     /// A vw unit: https://drafts.csswg.org/css-values/#vw
     Vw(CSSFloat),
     /// A vh unit: https://drafts.csswg.org/css-values/#vh
@@ -219,17 +219,17 @@ impl ViewportPercentageLength {
             ViewportPercentageLength::Vmax(length) =>
                 length * to_unit!(cmp::max(viewport_size.width, viewport_size.height)),
         };
         Au::from_f32_px(value)
     }
 }
 
 /// HTML5 "character width", as defined in HTML5 § 14.5.4.
-#[derive(Clone, PartialEq, Copy, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub struct CharacterWidth(pub i32);
 
 impl CharacterWidth {
     /// Computes the given character width.
     pub fn to_computed_value(&self, reference_font_size: Au) -> Au {
         // This applies the *converting a character width to pixels* algorithm as specified
         // in HTML5 § 14.5.4.
@@ -251,17 +251,17 @@ fn to_au_round(length: CSSFloat, au_per_
         (length * au_per_unit)
         .min(ABSOLUTE_LENGTH_MAX as f32)
         .max(ABSOLUTE_LENGTH_MIN as f32)
         .round() as i32
     )
 }
 
 /// Represents an absolute length with its unit
-#[derive(Clone, PartialEq, Copy, Debug)]
+#[derive(Clone, Copy, Debug, PartialEq)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 pub enum AbsoluteLength {
     /// An absolute length in pixels (px)
     Px(CSSFloat),
     /// An absolute length in inches (in)
     In(CSSFloat),
     /// An absolute length in centimeters (cm)
     Cm(CSSFloat),
@@ -342,17 +342,17 @@ impl Mul<CSSFloat> for AbsoluteLength {
             AbsoluteLength::Q(v) => AbsoluteLength::Q(v * scalar),
             AbsoluteLength::Pt(v) => AbsoluteLength::Pt(v * scalar),
             AbsoluteLength::Pc(v) => AbsoluteLength::Pc(v * scalar),