From ab73f3d61d895289898821272f6af2665c9c645c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DAVID?= Date: Mon, 21 Aug 2017 22:56:05 +0200 Subject: [PATCH 1/2] Automatically verify that derive() lists are alphabetically ordered --- python/tidy/servo_tidy/tidy.py | 13 +++++++++++++ python/tidy/servo_tidy_tests/rust_tidy.rs | 1 + python/tidy/servo_tidy_tests/test_tidy.py | 1 + 3 files changed, 15 insertions(+) diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 3bf6176de44..2c2a6275524 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -691,6 +691,19 @@ def check_rust(file_name, lines): # we now erase previous entries prev_mod = {} + # derivable traits should be alphabetically ordered + if is_attribute: + # match the derivable traits filtering out macro expansions + match = re.search(r"#\[derive\(([a-zA-Z, ]*)", line) + if match: + derives = map(lambda w: w.strip(), match.group(1).split(',')) + # sort, compare and report + sorted_derives = sorted(derives) + if sorted_derives != derives: + yield(idx + 1, decl_message.format("derivable traits list") + + decl_expected.format(", ".join(sorted_derives)) + + decl_found.format(", ".join(derives))) + # Avoid flagging constructs def is_associated_type(match, line): diff --git a/python/tidy/servo_tidy_tests/rust_tidy.rs b/python/tidy/servo_tidy_tests/rust_tidy.rs index bed4664a279..c1be1695156 100644 --- a/python/tidy/servo_tidy_tests/rust_tidy.rs +++ b/python/tidy/servo_tidy_tests/rust_tidy.rs @@ -21,6 +21,7 @@ extern crate webrender_api; extern crate style_traits; #[foo = "bar,baz"] +#[derive(Copy,Debug, ComputeSquaredDistance)] impl test { fn test_fun(y:f32)->f32{ diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py index df8bf316cd0..73a37cd4612 100644 --- a/python/tidy/servo_tidy_tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -107,6 +107,7 @@ class CheckTidiness(unittest.TestCase): self.assertTrue('mod declaration is not in alphabetical order' in errors.next()[2]) self.assertEqual('mod declaration spans multiple lines', errors.next()[2]) self.assertTrue('extern crate declaration is not in alphabetical order' in errors.next()[2]) + self.assertTrue('derivable traits list is not in alphabetical order' in errors.next()[2]) self.assertEqual('found an empty line following a {', errors.next()[2]) self.assertEqual('missing space before ->', errors.next()[2]) self.assertEqual('missing space after ->', errors.next()[2]) From c5fe2351124c673d1dc4d59355a03654b4fcc541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DAVID?= Date: Wed, 23 Aug 2017 14:10:08 +0200 Subject: [PATCH 2/2] order derivable traits lists Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs --- components/canvas_traits/canvas.rs | 18 +++--- components/compositing/compositor.rs | 16 +++--- components/compositing/windowing.rs | 2 +- components/config/prefs.rs | 2 +- components/devtools_traits/lib.rs | 12 ++-- components/gfx/display_list/mod.rs | 56 +++++++++---------- components/gfx/font.rs | 4 +- components/gfx/font_cache_thread.rs | 10 ++-- components/gfx/font_template.rs | 2 +- .../gfx/platform/freetype/font_template.rs | 2 +- .../gfx/platform/macos/font_template.rs | 2 +- .../gfx/platform/windows/font_template.rs | 2 +- components/gfx/text/glyph.rs | 10 ++-- components/gfx/text/util.rs | 2 +- components/gfx_traits/lib.rs | 4 +- components/layout/block.rs | 8 +-- components/layout/display_list_builder.rs | 6 +- components/layout/floats.rs | 6 +- components/layout/flow.rs | 10 ++-- components/layout/flow_ref.rs | 4 +- components/layout/fragment.rs | 12 ++-- components/layout/inline.rs | 8 +-- components/layout/model.rs | 10 ++-- components/layout/table.rs | 4 +- components/layout/table_cell.rs | 2 +- components/layout/table_row.rs | 8 +-- components/layout/table_wrapper.rs | 4 +- components/layout/text.rs | 2 +- components/layout/traversal.rs | 4 +- components/layout_thread/dom_wrapper.rs | 10 ++-- components/msg/constellation_msg.rs | 20 +++---- components/net/fetch/methods.rs | 2 +- components/net_traits/blob_url_store.rs | 4 +- components/net_traits/image/base.rs | 6 +- components/net_traits/image_cache.rs | 12 ++-- components/net_traits/lib.rs | 24 ++++---- components/net_traits/pub_domains.rs | 2 +- components/net_traits/request.rs | 28 +++++----- components/net_traits/response.rs | 14 ++--- components/net_traits/storage_thread.rs | 2 +- components/profile_traits/time.rs | 8 +-- components/range/lib.rs | 2 +- components/remutex/lib.rs | 2 +- components/script/body.rs | 2 +- components/script/build.rs | 2 +- components/script/document_loader.rs | 6 +- components/script/dom/abstractworker.rs | 2 +- .../script/dom/abstractworkerglobalscope.rs | 4 +- components/script/dom/bindings/callback.rs | 2 +- components/script/dom/bindings/conversions.rs | 2 +- components/script/dom/bindings/error.rs | 2 +- components/script/dom/bindings/interface.rs | 2 +- components/script/dom/bindings/iterable.rs | 2 +- components/script/dom/bindings/namespace.rs | 2 +- components/script/dom/bindings/num.rs | 2 +- .../script/dom/bindings/settings_stack.rs | 2 +- components/script/dom/bindings/str.rs | 2 +- components/script/dom/bindings/utils.rs | 4 +- components/script/dom/canvasgradient.rs | 2 +- .../script/dom/canvasrenderingcontext2d.rs | 4 +- components/script/dom/cssstyledeclaration.rs | 2 +- .../script/dom/customelementregistry.rs | 8 +-- components/script/dom/document.rs | 26 ++++----- components/script/dom/domexception.rs | 2 +- components/script/dom/element.rs | 6 +- components/script/dom/event.rs | 8 +-- components/script/dom/eventsource.rs | 6 +- components/script/dom/eventtarget.rs | 12 ++-- components/script/dom/filereader.rs | 6 +- components/script/dom/headers.rs | 2 +- components/script/dom/htmlbuttonelement.rs | 2 +- components/script/dom/htmlcanvaselement.rs | 2 +- components/script/dom/htmlcollection.rs | 12 ++-- components/script/dom/htmldatalistelement.rs | 2 +- components/script/dom/htmlfieldsetelement.rs | 2 +- components/script/dom/htmlformelement.rs | 18 +++--- components/script/dom/htmlheadingelement.rs | 2 +- components/script/dom/htmliframeelement.rs | 2 +- components/script/dom/htmlimageelement.rs | 8 +-- components/script/dom/htmlinputelement.rs | 2 +- components/script/dom/htmllinkelement.rs | 2 +- components/script/dom/htmlmediaelement.rs | 4 +- components/script/dom/htmlselectelement.rs | 2 +- components/script/dom/htmltableelement.rs | 2 +- components/script/dom/node.rs | 8 +-- components/script/dom/nodelist.rs | 4 +- .../script/dom/paintworkletglobalscope.rs | 2 +- .../script/dom/serviceworkerglobalscope.rs | 2 +- .../script/dom/servoparser/async_html.rs | 2 +- components/script/dom/servoparser/mod.rs | 2 +- components/script/dom/testbinding.rs | 4 +- components/script/dom/validitystate.rs | 2 +- components/script/dom/vrdisplay.rs | 2 +- .../script/dom/webgl_extensions/extensions.rs | 6 +- .../script/dom/webgl_extensions/wrapper.rs | 2 +- .../script/dom/webgl_validations/types.rs | 2 +- components/script/dom/webglframebuffer.rs | 2 +- components/script/dom/webglshader.rs | 2 +- components/script/dom/webgltexture.rs | 2 +- components/script/dom/websocket.rs | 2 +- components/script/dom/window.rs | 2 +- components/script/dom/worklet.rs | 4 +- components/script/dom/xmlhttprequest.rs | 6 +- components/script/microtask.rs | 6 +- components/script/serviceworkerjob.rs | 2 +- .../script/task_source/dom_manipulation.rs | 2 +- .../task_source/performance_timeline.rs | 2 +- .../script/task_source/user_interaction.rs | 2 +- components/script/textinput.rs | 12 ++-- components/script/timers.rs | 14 ++--- components/script_layout_interface/lib.rs | 8 +-- .../script_layout_interface/reporter.rs | 2 +- .../script_layout_interface/wrapper_traits.rs | 2 +- components/script_traits/lib.rs | 38 ++++++------- components/script_traits/script_msg.rs | 4 +- components/selectors/attr.rs | 14 ++--- components/selectors/builder.rs | 2 +- components/selectors/context.rs | 6 +- components/selectors/gecko_like_types.rs | 8 +-- components/selectors/matching.rs | 4 +- components/selectors/parser.rs | 18 +++--- components/servo_arc/lib.rs | 2 +- components/style/animation.rs | 10 ++-- components/style/applicable_declarations.rs | 4 +- components/style/context.rs | 2 +- components/style/counter_style/mod.rs | 10 ++-- components/style/custom_properties.rs | 2 +- components/style/dom.rs | 2 +- components/style/font_face.rs | 4 +- components/style/font_metrics.rs | 4 +- components/style/gecko/data.rs | 2 +- components/style/gecko/media_queries.rs | 6 +- .../gecko/pseudo_element_definition.mako.rs | 2 +- components/style/gecko/selector_parser.rs | 4 +- .../gecko_bindings/sugar/ns_style_coord.rs | 2 +- components/style/gecko_string_cache/mod.rs | 2 +- .../style/gecko_string_cache/namespace.rs | 2 +- .../style/invalidation/element/invalidator.rs | 2 +- .../style/invalidation/media_queries.rs | 2 +- components/style/invalidation/stylesheets.rs | 2 +- components/style/logical_geometry.rs | 16 +++--- components/style/matching.rs | 6 +- components/style/media_queries.rs | 8 +-- .../style/properties/declaration_block.rs | 2 +- components/style/properties/helpers.mako.rs | 2 +- .../helpers/animated_properties.mako.rs | 2 +- .../properties/longhand/background.mako.rs | 2 +- .../style/properties/longhand/border.mako.rs | 8 +-- .../style/properties/longhand/box.mako.rs | 8 +-- .../properties/longhand/counters.mako.rs | 8 +-- .../style/properties/longhand/font.mako.rs | 42 +++++++------- .../properties/longhand/inherited_box.mako.rs | 8 +-- .../properties/longhand/inherited_svg.mako.rs | 2 +- .../longhand/inherited_text.mako.rs | 10 ++-- .../style/properties/longhand/list.mako.rs | 6 +- .../properties/longhand/pointing.mako.rs | 4 +- .../properties/longhand/position.mako.rs | 4 +- .../style/properties/longhand/table.mako.rs | 2 +- .../style/properties/longhand/text.mako.rs | 2 +- .../style/properties/longhand/ui.mako.rs | 2 +- .../style/properties/properties.mako.rs | 22 ++++---- components/style/rule_tree/mod.rs | 4 +- components/style/selector_parser.rs | 2 +- components/style/servo/media_queries.rs | 6 +- components/style/servo/selector_parser.rs | 4 +- components/style/servo/url.rs | 2 +- .../style/stylesheets/keyframes_rule.rs | 4 +- components/style/stylesheets/mod.rs | 4 +- components/style/stylesheets/origin.rs | 2 +- components/style/stylesheets/rule_parser.rs | 2 +- components/style/stylesheets/stylesheet.rs | 2 +- components/style/stylist.rs | 2 +- components/style/timer.rs | 4 +- components/style/traversal.rs | 2 +- components/style/values/computed/align.rs | 2 +- components/style/values/computed/length.rs | 2 +- components/style/values/computed/mod.rs | 2 +- components/style/values/computed/time.rs | 2 +- components/style/values/generics/grid.rs | 14 ++--- components/style/values/generics/svg.rs | 4 +- components/style/values/mod.rs | 4 +- components/style/values/specified/align.rs | 8 +-- components/style/values/specified/calc.rs | 2 +- components/style/values/specified/color.rs | 2 +- components/style/values/specified/grid.rs | 2 +- components/style/values/specified/length.rs | 12 ++-- components/style/values/specified/mod.rs | 2 +- components/style/values/specified/time.rs | 2 +- components/style_traits/lib.rs | 4 +- components/style_traits/values.rs | 4 +- components/style_traits/viewport.rs | 2 +- components/url/lib.rs | 2 +- components/url/origin.rs | 4 +- servo-tidy.toml | 1 + 194 files changed, 553 insertions(+), 552 deletions(-) diff --git a/components/canvas_traits/canvas.rs b/components/canvas_traits/canvas.rs index 92444d03799..a9999ccdbc9 100644 --- a/components/canvas_traits/canvas.rs +++ b/components/canvas_traits/canvas.rs @@ -80,13 +80,13 @@ pub enum FromScriptMsg { SendPixels(IpcSender>>), } -#[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, @@ -108,7 +108,7 @@ impl LinearGradientStyle { } } -#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Deserialize, HeapSizeOf, Serialize)] pub struct RadialGradientStyle { pub x0: f64, pub y0: f64, @@ -163,7 +163,7 @@ pub enum FillOrStrokeStyle { Surface(SurfaceStyle), } -#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)] pub enum LineCapStyle { Butt = 0, Round = 1, @@ -183,7 +183,7 @@ impl FromStr for LineCapStyle { } } -#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)] pub enum LineJoinStyle { Round = 0, Bevel = 1, @@ -203,7 +203,7 @@ impl FromStr for LineJoinStyle { } } -#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)] pub enum RepetitionStyle { Repeat, RepeatX, @@ -225,7 +225,7 @@ impl FromStr for RepetitionStyle { } } -#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)] pub enum CompositionStyle { SrcIn, SrcOut, @@ -279,7 +279,7 @@ impl CompositionStyle { } } -#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)] pub enum BlendingStyle { Multiply, Screen, @@ -345,7 +345,7 @@ impl BlendingStyle { } } -#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)] pub enum CompositionOrBlending { Composition(CompositionStyle), Blending(BlendingStyle), diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index a7f979af812..89d2fff0c81 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -68,14 +68,14 @@ impl ConvertPipelineIdFromWebRender for webrender_api::PipelineId { /// 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 { @@ -88,7 +88,7 @@ impl FrameTreeId { /// /// 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. @@ -195,7 +195,7 @@ pub struct IOCompositor { pending_paint_metrics: HashMap, } -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] struct ScrollZoomEvent { /// Change the pinch zoom level by this factor magnification: f32, @@ -209,13 +209,13 @@ struct ScrollZoomEvent { 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, @@ -247,7 +247,7 @@ impl PipelineDetails { } } -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] enum CompositeTarget { /// Normal composition to a window Window, @@ -1657,7 +1657,7 @@ impl IOCompositor { } /// 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, diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index ed8b0501742..edff7cf85cf 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -115,7 +115,7 @@ impl Debug for WindowEvent { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum AnimationState { Idle, Animating, diff --git a/components/config/prefs.rs b/components/config/prefs.rs index d1a97b91dc2..3bfb94772b1 100644 --- a/components/config/prefs.rs +++ b/components/config/prefs.rs @@ -25,7 +25,7 @@ lazy_static! { }; } -#[derive(PartialEq, Clone, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] pub enum PrefValue { Boolean(bool), String(String), diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index ee69a490916..d703b27e625 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -40,7 +40,7 @@ pub struct DevtoolsPageInfo { pub url: ServoUrl, } -#[derive(Debug, Deserialize, HeapSizeOf, Serialize, Clone)] +#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)] pub struct CSSError { pub filename: String, pub line: u32, @@ -144,7 +144,7 @@ pub struct TimelineMarker { pub end_stack: Option>, } -#[derive(Debug, PartialEq, Eq, Hash, Clone, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)] pub enum TimelineMarkerType { Reflow, DOMEvent, @@ -223,7 +223,7 @@ pub struct Modification { pub newValue: Option, } -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub enum LogLevel { Log, Debug, @@ -232,7 +232,7 @@ pub enum LogLevel { Error, } -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub struct ConsoleMessage { pub message: String, pub logLevel: LogLevel, @@ -342,7 +342,7 @@ impl StartedTimelineMarker { /// 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 { @@ -355,5 +355,5 @@ impl PreciseTime { } } -#[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); diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 98ece855d25..718c44487ed 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -42,7 +42,7 @@ pub use style::dom::OpaqueNode; /// 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, } @@ -401,7 +401,7 @@ pub enum StackingContextType { 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. @@ -556,14 +556,14 @@ impl fmt::Debug for StackingContext { } } -#[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. @@ -671,7 +671,7 @@ impl BaseDisplayItem { /// 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, @@ -685,7 +685,7 @@ pub struct ClippingRegion { /// 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, @@ -855,7 +855,7 @@ impl ComplexClippingRegion { /// 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, @@ -865,7 +865,7 @@ pub struct DisplayItemMetadata { } /// 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, @@ -875,7 +875,7 @@ pub struct SolidColorDisplayItem { } /// Paints text. -#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] +#[derive(Clone, Deserialize, HeapSizeOf, Serialize)] pub struct TextDisplayItem { /// Fields common to all display items. pub base: BaseDisplayItem, @@ -897,7 +897,7 @@ pub struct TextDisplayItem { pub orientation: TextOrientation, } -#[derive(Clone, Eq, PartialEq, HeapSizeOf, Deserialize, Serialize)] +#[derive(Clone, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)] pub enum TextOrientation { Upright, SidewaysLeft, @@ -905,7 +905,7 @@ pub enum TextOrientation { } /// Paints an image. -#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] +#[derive(Clone, Deserialize, HeapSizeOf, Serialize)] pub struct ImageDisplayItem { pub base: BaseDisplayItem, @@ -928,7 +928,7 @@ pub struct ImageDisplayItem { 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, @@ -985,7 +985,7 @@ pub struct RadialGradientDisplayItem { } /// 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, @@ -1000,7 +1000,7 @@ pub struct NormalBorder { } /// 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, @@ -1022,7 +1022,7 @@ pub struct ImageBorder { } /// 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, @@ -1032,7 +1032,7 @@ pub struct GradientBorder { } /// 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, @@ -1042,7 +1042,7 @@ pub struct RadialGradientBorder { } /// Specifies the type of border -#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] +#[derive(Clone, Deserialize, HeapSizeOf, Serialize)] pub enum BorderDetails { Normal(NormalBorder), Image(ImageBorder), @@ -1051,7 +1051,7 @@ pub enum BorderDetails { } /// 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, @@ -1066,7 +1066,7 @@ pub struct BorderDisplayItem { /// 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 { pub top_left: Size2D, pub top_right: Size2D, @@ -1128,7 +1128,7 @@ impl BorderRadii where T: PartialEq + Zero + Clone { } /// Paints a line segment. -#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] +#[derive(Clone, Deserialize, HeapSizeOf, Serialize)] pub struct LineDisplayItem { pub base: BaseDisplayItem, @@ -1141,7 +1141,7 @@ pub struct LineDisplayItem { } /// 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, @@ -1171,7 +1171,7 @@ pub struct BoxShadowDisplayItem { } /// 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, @@ -1187,14 +1187,14 @@ pub struct PushTextShadowDisplayItem { } /// 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, @@ -1203,7 +1203,7 @@ pub struct PushStackingContextItem { } /// 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, @@ -1212,7 +1212,7 @@ pub struct PopStackingContextItem { } /// 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, @@ -1222,7 +1222,7 @@ pub struct DefineClipItem { } /// 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, @@ -1383,7 +1383,7 @@ impl fmt::Debug for DisplayItem { } } -#[derive(Copy, Clone, HeapSizeOf, Deserialize, Serialize)] +#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)] pub struct WebRenderImageInfo { pub width: u32, pub height: u32, diff --git a/components/gfx/font.rs b/components/gfx/font.rs index 357f61a2d7a..a7751e879a4 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -154,7 +154,7 @@ bitflags! { } /// 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. @@ -168,7 +168,7 @@ pub struct ShapingOptions { } /// An entry in the shape cache. -#[derive(Clone, Eq, PartialEq, Hash, Debug)] +#[derive(Clone, Debug, Eq, Hash, PartialEq)] struct ShapeCacheEntry { text: String, options: ShapingOptions, diff --git a/components/gfx/font_cache_thread.rs b/components/gfx/font_cache_thread.rs index 447bff83021..c58dfd131ed 100644 --- a/components/gfx/font_cache_thread.rs +++ b/components/gfx/font_cache_thread.rs @@ -33,7 +33,7 @@ struct FontTemplates { templates: Vec, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Debug, Deserialize, Serialize)] pub struct FontTemplateInfo { pub font_template: Arc, pub font_key: Option, @@ -102,7 +102,7 @@ impl FontTemplates { } /// 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), GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender), @@ -112,7 +112,7 @@ pub enum Command { } /// 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), } @@ -396,7 +396,7 @@ impl FontCache { /// 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, } @@ -478,7 +478,7 @@ impl FontCacheThread { } -#[derive(Clone, Eq, PartialEq, Hash, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] pub struct LowercaseString { inner: String, } diff --git a/components/gfx/font_template.rs b/components/gfx/font_template.rs index 920e9735737..2c88384a4d0 100644 --- a/components/gfx/font_template.rs +++ b/components/gfx/font_template.rs @@ -17,7 +17,7 @@ use style::computed_values::{font_stretch, font_weight}; /// 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, diff --git a/components/gfx/platform/freetype/font_template.rs b/components/gfx/platform/freetype/font_template.rs index f61c0a07732..658974bc3b0 100644 --- a/components/gfx/platform/freetype/font_template.rs +++ b/components/gfx/platform/freetype/font_template.rs @@ -11,7 +11,7 @@ use webrender_api::NativeFontHandle; /// 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, pub identifier: Atom, diff --git a/components/gfx/platform/macos/font_template.rs b/components/gfx/platform/macos/font_template.rs index 643c00a8435..d71dc84254e 100644 --- a/components/gfx/platform/macos/font_template.rs +++ b/components/gfx/platform/macos/font_template.rs @@ -24,7 +24,7 @@ use webrender_api::NativeFontHandle; /// 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 diff --git a/components/gfx/platform/windows/font_template.rs b/components/gfx/platform/windows/font_template.rs index d3cc237cd8b..12a08f1ff17 100644 --- a/components/gfx/platform/windows/font_template.rs +++ b/components/gfx/platform/windows/font_template.rs @@ -7,7 +7,7 @@ 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>, pub identifier: Atom, diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs index 90e899c3daa..ce3bad9cda2 100644 --- a/components/gfx/text/glyph.rs +++ b/components/gfx/text/glyph.rs @@ -21,7 +21,7 @@ pub use gfx_traits::ByteIndex; /// 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, } @@ -147,7 +147,7 @@ impl GlyphEntry { // 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) @@ -166,7 +166,7 @@ impl DetailedGlyph { } } -#[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, @@ -308,7 +308,7 @@ impl<'a> DetailedGlyphStore { // 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, @@ -339,7 +339,7 @@ impl GlyphData { // 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), diff --git a/components/gfx/text/util.rs b/components/gfx/text/util.rs index 6736b301d12..5be03cb2b78 100644 --- a/components/gfx/text/util.rs +++ b/components/gfx/text/util.rs @@ -2,7 +2,7 @@ * 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, diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index ea0ed54252e..e6f6c124ec2 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -18,7 +18,7 @@ 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 { @@ -62,7 +62,7 @@ int_range_index! { /// 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, diff --git a/components/layout/block.rs b/components/layout/block.rs index d868e1fe914..b22519ee71a 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -86,7 +86,7 @@ impl FloatedBlockInfo { } /// The solutions for the block-size-and-margins constraint equation. -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] struct BSizeConstraintSolution { block_start: Au, block_size: Au, @@ -2196,7 +2196,7 @@ impl fmt::Debug for BlockFlow { } /// 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, @@ -2229,7 +2229,7 @@ impl ISizeConstraintInput { } /// 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, @@ -3086,7 +3086,7 @@ impl ISizeAndMarginsComputer for InlineFlexItem { } /// 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, diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 5ec71dd09a3..709469fa7c0 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -2915,7 +2915,7 @@ impl ComputedValuesCursorUtility for ComputedValues { } // A helper data structure for gradients. -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] struct StopRun { start_offset: f32, end_offset: f32, @@ -2953,7 +2953,7 @@ impl ToGfxColor for RGBA { } /// Describes how to paint the borders. -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] pub enum BorderPaintingMode<'a> { /// Paint borders separately (`border-collapse: separate`). Separate, @@ -2963,7 +2963,7 @@ pub enum BorderPaintingMode<'a> { Hidden, } -#[derive(Copy, Clone, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum StackingContextCreationMode { Normal, PseudoPositioned, diff --git a/components/layout/floats.rs b/components/layout/floats.rs index 1fc28e9750a..4996a9e49e6 100644 --- a/components/layout/floats.rs +++ b/components/layout/floats.rs @@ -13,7 +13,7 @@ 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 @@ -30,7 +30,7 @@ impl FloatKind { } /// The kind of clearance: left, right, or both. -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] pub enum ClearType { Left, Right, @@ -431,7 +431,7 @@ impl Floats { /// 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, diff --git a/components/layout/flow.rs b/components/layout/flow.rs index b683dd0d2d1..67976ed0a64 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -559,7 +559,7 @@ pub trait MutableOwnedFlowUtils { absolute_descendants: &mut AbsoluteDescendants); } -#[derive(Copy, Clone, Serialize, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Serialize)] pub enum FlowClass { Block, Inline, @@ -771,7 +771,7 @@ pub type AbsoluteDescendantOffsetIter<'a> = Zip, Iter /// 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, @@ -793,7 +793,7 @@ impl EarlyAbsolutePositionInfo { /// 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, @@ -809,7 +809,7 @@ impl LateAbsolutePositionInfo { } } -#[derive(Copy, Clone, Debug)] +#[derive(Clone, Copy, Debug)] pub struct FragmentationContext { pub available_block_size: Au, pub this_fragment_is_empty: bool, @@ -1412,7 +1412,7 @@ 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 { diff --git a/components/layout/flow_ref.rs b/components/layout/flow_ref.rs index ea2c3ebf331..d1cd093a707 100644 --- a/components/layout/flow_ref.rs +++ b/components/layout/flow_ref.rs @@ -13,7 +13,7 @@ use flow::Flow; use std::ops::Deref; use std::sync::{Arc, Weak}; -#[derive(Clone,Debug)] +#[derive(Clone, Debug)] pub struct FlowRef(Arc); impl Deref for FlowRef { @@ -55,7 +55,7 @@ impl FlowRef { } } -#[derive(Clone,Debug)] +#[derive(Clone, Debug)] pub struct WeakFlowRef(Weak); impl WeakFlowRef { diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index fb3fd23b613..23c8b4fda82 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -574,7 +574,7 @@ impl ScannedTextFragmentInfo { /// 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. @@ -633,7 +633,7 @@ impl UnscannedTextFragmentInfo { } /// A fragment that represents a table column. -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] pub struct TableColumnFragmentInfo { /// the number of columns a element should span pub span: u32, @@ -3049,7 +3049,7 @@ pub trait FragmentBorderBoxIterator { /// 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, @@ -3094,7 +3094,7 @@ impl<'a> InlineStyleIterator<'a> { } } -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum WhitespaceStrippingResult { RetainFragment, FragmentContainedOnlyBidiControlCharacters, @@ -3116,7 +3116,7 @@ impl WhitespaceStrippingResult { /// 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, pub paint: Rect, @@ -3163,7 +3163,7 @@ bitflags! { /// 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, diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 2a1aa3075f2..1e8aa0a6d34 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -63,7 +63,7 @@ use unicode_bidi as bidi; /// 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. /// @@ -823,7 +823,7 @@ impl LineBreaker { } /// Represents a list of inline fragments, including element ranges. -#[derive(Serialize, Clone)] +#[derive(Clone, Serialize)] pub struct InlineFragments { /// The fragments themselves. pub fragments: Vec, @@ -1864,13 +1864,13 @@ impl InlineMetrics { } } -#[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, diff --git a/components/layout/model.rs b/components/layout/model.rs index c96c3bdaaf5..9094f82ae1d 100644 --- a/components/layout/model.rs +++ b/components/layout/model.rs @@ -18,7 +18,7 @@ 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, @@ -61,7 +61,7 @@ impl AdjoiningMargins { } /// 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), @@ -295,7 +295,7 @@ impl MarginCollapseInfo { } } -#[derive(Copy, Clone, Debug)] +#[derive(Clone, Copy, Debug)] pub enum MarginCollapseState { /// We are accumulating margin on the logical top of this flow. AccumulatingCollapsibleTopMargin, @@ -304,7 +304,7 @@ pub enum MarginCollapseState { } /// 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, @@ -395,7 +395,7 @@ impl IntrinsicISizesContribution { } /// 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), diff --git a/components/layout/table.rs b/components/layout/table.rs index db221518cf7..b56ac7c4d09 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -588,7 +588,7 @@ impl ISizeAndMarginsComputer for InternalTable { /// 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, @@ -625,7 +625,7 @@ impl ColumnIntrinsicInlineSize { /// /// 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, diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs index 0a19adb2430..370937bc73d 100644 --- a/components/layout/table_cell.rs +++ b/components/layout/table_cell.rs @@ -305,7 +305,7 @@ impl fmt::Debug for TableCellFlow { } } -#[derive(Copy, Clone, Debug, Serialize)] +#[derive(Clone, Copy, Debug, Serialize)] pub struct CollapsedBordersForCell { pub inline_start_border: CollapsedBorder, pub inline_end_border: CollapsedBorder, diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs index 5536c103b0e..3e6365d8c77 100644 --- a/components/layout/table_row.rs +++ b/components/layout/table_row.rs @@ -73,7 +73,7 @@ impl Serialize for TableRowFlow { } /// 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, @@ -571,7 +571,7 @@ impl CollapsedBorderSpacingForRow { } /// 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, @@ -596,7 +596,7 @@ impl Serialize for CollapsedBorder { // 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, @@ -906,7 +906,7 @@ fn set_inline_position_of_child_flow( } } -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] pub struct BorderCollapseInfoForChildTableCell<'a> { collapsed_borders_for_row: &'a CollapsedBordersForRow, collapsed_border_spacing_for_row: &'a CollapsedBorderSpacingForRow, diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index 6d08df8d3fa..531176d52d3 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -35,7 +35,7 @@ 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 @@ -615,7 +615,7 @@ impl<'a> Add for &'a AutoLayoutCandidateGuess { /// 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), diff --git a/components/layout/text.rs b/components/layout/text.rs index d6fc89ffc23..715c356ce4a 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -562,7 +562,7 @@ impl RunInfo { /// 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, diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index dfe79b9d178..6dfaa136ed2 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -243,7 +243,7 @@ impl<'a> PostorderFlowTraversal for BubbleISizes<'a> { } /// 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>, } @@ -263,7 +263,7 @@ impl<'a> PreorderFlowTraversal for AssignISizes<'a> { /// 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>, } diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index d35536c627f..f06ced47160 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -85,7 +85,7 @@ pub unsafe fn drop_style_and_layout_data(data: OpaqueStyleAndLayoutData) { let _ = Box::from_raw(non_opaque); } -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] pub struct ServoLayoutNode<'a> { /// The wrapped node. node: LayoutJS, @@ -329,7 +329,7 @@ impl<'ln> ServoLayoutNode<'ln> { } // 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, chain: PhantomData<&'ld ()>, @@ -374,7 +374,7 @@ impl<'ld> ServoLayoutDocument<'ld> { } /// 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, chain: PhantomData<&'le ()>, @@ -810,7 +810,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> { } } -#[derive(Copy, Clone, Debug)] +#[derive(Clone, Copy, Debug)] pub struct ServoThreadSafeLayoutNode<'ln> { /// The wrapped node. node: ServoLayoutNode<'ln>, @@ -1103,7 +1103,7 @@ impl Iterator for ThreadSafeLayoutNodeChildrenIterator { element: ServoLayoutElement<'le>, diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 0d7c10786d1..e5eaf995201 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -9,7 +9,7 @@ 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, @@ -17,7 +17,7 @@ pub enum KeyState { } //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, @@ -156,7 +156,7 @@ bitflags! { } } -#[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), @@ -217,13 +217,13 @@ impl PipelineNamespace { thread_local!(pub static PIPELINE_NAMESPACE: Cell> = 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 @@ -262,10 +262,10 @@ impl fmt::Display for PipelineId { } } -#[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 @@ -292,7 +292,7 @@ impl fmt::Display for BrowsingContextId { thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell> = 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 { @@ -342,7 +342,7 @@ pub const TEST_BROWSING_CONTEXT_INDEX: BrowsingContextIndex = BrowsingContextInd 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, diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index 75a829c46d9..30ab9f4149f 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -536,7 +536,7 @@ pub fn should_be_blocked_due_to_nosniff(request_type: Type, response_headers: &H /// /// 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 { diff --git a/components/net_traits/blob_url_store.rs b/components/net_traits/blob_url_store.rs index d171234cac4..2503fd66590 100644 --- a/components/net_traits/blob_url_store.rs +++ b/components/net_traits/blob_url_store.rs @@ -9,7 +9,7 @@ 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, @@ -22,7 +22,7 @@ pub enum BlobURLStoreError { } /// Standalone blob buffer object -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub struct BlobBuf { pub filename: Option, /// MIME type string diff --git a/components/net_traits/image/base.rs b/components/net_traits/image/base.rs index 16a438b9cd8..9b66b131c53 100644 --- a/components/net_traits/image/base.rs +++ b/components/net_traits/image/base.rs @@ -7,7 +7,7 @@ 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, @@ -19,7 +19,7 @@ pub enum PixelFormat { BGRA8, } -#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] +#[derive(Clone, Deserialize, HeapSizeOf, Serialize)] pub struct Image { pub width: u32, pub height: u32, @@ -37,7 +37,7 @@ impl fmt::Debug for Image { } } -#[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, diff --git a/components/net_traits/image_cache.rs b/components/net_traits/image_cache.rs index c86785a845a..6fe86462a38 100644 --- a/components/net_traits/image_cache.rs +++ b/components/net_traits/image_cache.rs @@ -16,14 +16,14 @@ use webrender_api; /// 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, ServoUrl), MetadataAvailable(ImageMetadata), @@ -60,7 +60,7 @@ impl ImageResponder { } /// 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, ServoUrl), @@ -73,7 +73,7 @@ pub enum ImageResponse { } /// 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, @@ -81,7 +81,7 @@ pub enum ImageState { } /// 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)] @@ -90,7 +90,7 @@ pub struct PendingImageResponse { pub id: PendingImageId, } -#[derive(Copy, Clone, PartialEq, Hash, Eq, Deserialize, Serialize)] +#[derive(Clone, Copy, Deserialize, Eq, Hash, PartialEq, Serialize)] pub enum UsePlaceholder { No, Yes, diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs index 562f2e5a15d..5625d111119 100644 --- a/components/net_traits/lib.rs +++ b/components/net_traits/lib.rs @@ -62,7 +62,7 @@ pub mod image { /// 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, @@ -75,7 +75,7 @@ pub enum LoadContext { 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", @@ -185,7 +185,7 @@ pub trait FetchTaskTarget { fn process_response_eof(&mut self, response: &Response); } -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Deserialize, Serialize)] pub enum FilteredMetadata { Basic(Metadata), Cors(Metadata), @@ -193,7 +193,7 @@ pub enum FilteredMetadata { OpaqueRedirect } -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Deserialize, Serialize)] pub enum FetchMetadata { Unfiltered(Metadata), Filtered { @@ -276,7 +276,7 @@ pub trait IpcSend // 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, @@ -318,13 +318,13 @@ impl HeapSizeOf for ResourceThreads { } } -#[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), @@ -397,7 +397,7 @@ pub fn fetch_async(request: RequestInit, core_resource_thread: &CoreResourceT 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, @@ -406,7 +406,7 @@ pub struct ResourceCorsData { } /// 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, @@ -475,7 +475,7 @@ impl Metadata { } /// 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, @@ -511,11 +511,11 @@ pub fn load_whole_resource(request: RequestInit, } /// 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), diff --git a/components/net_traits/pub_domains.rs b/components/net_traits/pub_domains.rs index 613b60c3c0c..9138c5afec7 100644 --- a/components/net_traits/pub_domains.rs +++ b/components/net_traits/pub_domains.rs @@ -20,7 +20,7 @@ use std::collections::HashSet; use std::iter::FromIterator; use std::str::from_utf8; -#[derive(Clone,Debug)] +#[derive(Clone, Debug)] pub struct PubDomainRules { rules: HashSet, wildcards: HashSet, diff --git a/components/net_traits/request.rs b/components/net_traits/request.rs index 9a5922b91cc..f66da12179d 100644 --- a/components/net_traits/request.rs +++ b/components/net_traits/request.rs @@ -10,7 +10,7 @@ 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, @@ -20,7 +20,7 @@ pub enum Initiator { } /// 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, @@ -33,7 +33,7 @@ pub enum Type { } /// 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, @@ -53,14 +53,14 @@ pub enum Destination { } /// 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 @@ -69,7 +69,7 @@ pub enum Referrer { } /// 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, @@ -79,7 +79,7 @@ pub enum RequestMode { } /// 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, @@ -87,7 +87,7 @@ pub enum CredentialsMode { } /// [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, @@ -98,7 +98,7 @@ pub enum CacheMode { } /// [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, @@ -106,7 +106,7 @@ pub enum ServiceWorkersMode { } /// [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, @@ -114,7 +114,7 @@ pub enum RedirectMode { } /// [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, @@ -122,20 +122,20 @@ pub enum ResponseTainting { } /// [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")] diff --git a/components/net_traits/response.rs b/components/net_traits/response.rs index 823e26cad6f..a034067455b 100644 --- a/components/net_traits/response.rs +++ b/components/net_traits/response.rs @@ -13,7 +13,7 @@ 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, @@ -24,7 +24,7 @@ pub enum ResponseType { } /// [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, @@ -33,7 +33,7 @@ pub enum TerminationReason { /// 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), @@ -52,7 +52,7 @@ impl ResponseBody { /// [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, @@ -61,7 +61,7 @@ pub enum CacheState { } /// [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, @@ -74,7 +74,7 @@ pub enum ResponseMsg { Errored, } -#[derive(Serialize, Deserialize, Clone, HeapSizeOf)] +#[derive(Clone, Deserialize, HeapSizeOf, Serialize)] pub struct ResponseInit { pub url: ServoUrl, #[serde(deserialize_with = "::hyper_serde::deserialize", @@ -86,7 +86,7 @@ pub struct ResponseInit { } /// 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, diff --git a/components/net_traits/storage_thread.rs b/components/net_traits/storage_thread.rs index b56ed2e3181..e338773a53a 100644 --- a/components/net_traits/storage_thread.rs +++ b/components/net_traits/storage_thread.rs @@ -5,7 +5,7 @@ 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, diff --git a/components/profile_traits/time.rs b/components/profile_traits/time.rs index c883c1f8336..3723f0761f9 100644 --- a/components/profile_traits/time.rs +++ b/components/profile_traits/time.rs @@ -10,7 +10,7 @@ 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, @@ -39,7 +39,7 @@ pub enum ProfilerMsg { } #[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, @@ -95,13 +95,13 @@ pub enum ProfilerCategory { 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, diff --git a/components/range/lib.rs b/components/range/lib.rs index dcb95148550..b2ae5ae9ce6 100644 --- a/components/range/lib.rs +++ b/components/range/lib.rs @@ -78,7 +78,7 @@ impl RangeIndex for usize { #[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); diff --git a/components/remutex/lib.rs b/components/remutex/lib.rs index d913687c777..8f97da8351f 100644 --- a/components/remutex/lib.rs +++ b/components/remutex/lib.rs @@ -26,7 +26,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; // 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); lazy_static!{ static ref THREAD_COUNT: AtomicUsize = AtomicUsize::new(1); } diff --git a/components/script/body.rs b/components/script/body.rs index 841868889d0..19a38cfe9f8 100644 --- a/components/script/body.rs +++ b/components/script/body.rs @@ -22,7 +22,7 @@ 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, diff --git a/components/script/build.rs b/components/script/build.rs index 040658b66f2..a19e286ba25 100644 --- a/components/script/build.rs +++ b/components/script/build.rs @@ -59,7 +59,7 @@ fn main() { 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> { diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs index 611c469fa2d..4a6307667f1 100644 --- a/components/script/document_loader.rs +++ b/components/script/document_loader.rs @@ -13,7 +13,7 @@ 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), @@ -39,7 +39,7 @@ impl LoadType { /// 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. @@ -80,7 +80,7 @@ impl Drop for LoadBlocker { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub struct DocumentLoader { resource_threads: ResourceThreads, blocking_loads: Vec, diff --git a/components/script/dom/abstractworker.rs b/components/script/dom/abstractworker.rs index 8d92680fbed..fec71495613 100644 --- a/components/script/dom/abstractworker.rs +++ b/components/script/dom/abstractworker.rs @@ -29,7 +29,7 @@ impl SimpleWorkerErrorHandler { } } -#[derive(Copy, Clone)] +#[derive(Clone, Copy)] pub struct SharedRt { rt: *mut JSRuntime } diff --git a/components/script/dom/abstractworkerglobalscope.rs b/components/script/dom/abstractworkerglobalscope.rs index 7c79a919165..020301ad8a1 100644 --- a/components/script/dom/abstractworkerglobalscope.rs +++ b/components/script/dom/abstractworkerglobalscope.rs @@ -12,7 +12,7 @@ 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 { pub sender: Sender<(Trusted, CommonScriptMsg)>, pub worker: Trusted, @@ -34,7 +34,7 @@ impl ScriptChan for SendableWorkerScriptCh /// 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 { pub sender: Sender<(Trusted, WorkerScriptMsg)>, pub worker: Trusted, diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs index e8a9683a4b2..4dfb6584989 100644 --- a/components/script/dom/bindings/callback.rs +++ b/components/script/dom/bindings/callback.rs @@ -25,7 +25,7 @@ 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, diff --git a/components/script/dom/bindings/conversions.rs b/components/script/dom/bindings/conversions.rs index 9d927a884f1..9afae9f6804 100644 --- a/components/script/dom/bindings/conversions.rs +++ b/components/script/dom/bindings/conversions.rs @@ -170,7 +170,7 @@ impl ToJSValConvertible for USVString { } /// Behavior for stringification of `JSVal`s. -#[derive(PartialEq, Clone)] +#[derive(Clone, PartialEq)] pub enum StringificationBehavior { /// Convert `null` to the string `"null"`. Default, diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index d38a55c31be..2cbbe2da647 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -25,7 +25,7 @@ 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, diff --git a/components/script/dom/bindings/interface.rs b/components/script/dom/bindings/interface.rs index 63658b3f0f9..c242bd7f065 100644 --- a/components/script/dom/bindings/interface.rs +++ b/components/script/dom/bindings/interface.rs @@ -108,7 +108,7 @@ 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, diff --git a/components/script/dom/bindings/iterable.rs b/components/script/dom/bindings/iterable.rs index 15fdd04f2a8..03fac1cb27f 100644 --- a/components/script/dom/bindings/iterable.rs +++ b/components/script/dom/bindings/iterable.rs @@ -22,7 +22,7 @@ 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, diff --git a/components/script/dom/bindings/namespace.rs b/components/script/dom/bindings/namespace.rs index 38055dea180..8ca1116ea1e 100644 --- a/components/script/dom/bindings/namespace.rs +++ b/components/script/dom/bindings/namespace.rs @@ -11,7 +11,7 @@ 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 {} diff --git a/components/script/dom/bindings/num.rs b/components/script/dom/bindings/num.rs index 03b0c743f9f..c7d24f4fb83 100644 --- a/components/script/dom/bindings/num.rs +++ b/components/script/dom/bindings/num.rs @@ -9,7 +9,7 @@ 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); impl Finite { diff --git a/components/script/dom/bindings/settings_stack.rs b/components/script/dom/bindings/settings_stack.rs index dec63924915..bf67bae5f3f 100644 --- a/components/script/dom/bindings/settings_stack.rs +++ b/components/script/dom/bindings/settings_stack.rs @@ -15,7 +15,7 @@ use std::thread; thread_local!(static STACK: RefCell> = RefCell::new(Vec::new())); -#[derive(PartialEq, Eq, Debug, JSTraceable)] +#[derive(Debug, Eq, JSTraceable, PartialEq)] enum StackEntryKind { Incumbent, Entry, diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs index 36b104eb262..ea0b4f529b0 100644 --- a/components/script/dom/bindings/str.rs +++ b/components/script/dom/bindings/str.rs @@ -18,7 +18,7 @@ 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); impl ByteString { diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs index 4792b6b7655..1c4682225b0 100644 --- a/components/script/dom/bindings/utils.rs +++ b/components/script/dom/bindings/utils.rs @@ -47,7 +47,7 @@ impl HeapSizeOf for WindowProxyHandler { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] /// Static data associated with a global object. pub struct GlobalStaticData { /// The WindowProxy proxy handler for this global. @@ -79,7 +79,7 @@ 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. diff --git a/components/script/dom/canvasgradient.rs b/components/script/dom/canvasgradient.rs index 3a0707ab5eb..e571e3afabf 100644 --- a/components/script/dom/canvasgradient.rs +++ b/components/script/dom/canvasgradient.rs @@ -24,7 +24,7 @@ pub struct CanvasGradient { stops: DOMRefCell>, } -#[derive(JSTraceable, Clone, HeapSizeOf)] +#[derive(Clone, HeapSizeOf, JSTraceable)] pub enum CanvasGradientStyle { Linear(LinearGradientStyle), Radial(RadialGradientStyle), diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index d4fcfae4ab8..6d895efa05f 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -51,7 +51,7 @@ 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), @@ -81,7 +81,7 @@ pub struct CanvasRenderingContext2D { } #[must_root] -#[derive(JSTraceable, Clone, HeapSizeOf)] +#[derive(Clone, HeapSizeOf, JSTraceable)] struct CanvasContextState { global_alpha: f64, global_composition: CompositionOrBlending, diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index f87c184ef63..cf03ff45d88 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -154,7 +154,7 @@ impl CSSStyleOwner { } } -#[derive(PartialEq, HeapSizeOf)] +#[derive(HeapSizeOf, PartialEq)] pub enum CSSModificationAccess { ReadWrite, Readonly, diff --git a/components/script/dom/customelementregistry.rs b/components/script/dom/customelementregistry.rs index e3f90217c01..de4d7753315 100644 --- a/components/script/dom/customelementregistry.rs +++ b/components/script/dom/customelementregistry.rs @@ -372,7 +372,7 @@ impl CustomElementRegistryMethods for CustomElementRegistry { } } -#[derive(HeapSizeOf, JSTraceable, Clone)] +#[derive(Clone, HeapSizeOf, JSTraceable)] pub struct LifecycleCallbacks { #[ignore_heap_size_of = "Rc"] connected_callback: Option>, @@ -387,14 +387,14 @@ pub struct LifecycleCallbacks { attribute_changed_callback: Option>, } -#[derive(HeapSizeOf, JSTraceable, Clone)] +#[derive(Clone, HeapSizeOf, JSTraceable)] pub enum ConstructionStackEntry { Element(Root), AlreadyConstructedMarker, } /// https://html.spec.whatwg.org/multipage/#custom-element-definition -#[derive(HeapSizeOf, JSTraceable, Clone)] +#[derive(Clone, HeapSizeOf, JSTraceable)] pub struct CustomElementDefinition { pub name: LocalName, @@ -620,7 +620,7 @@ pub enum CallbackReaction { } /// 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, diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 4629ff8814f..1141565784c 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -193,7 +193,7 @@ impl PendingRestyle { } } -#[derive(Clone, JSTraceable, HeapSizeOf)] +#[derive(Clone, HeapSizeOf, JSTraceable)] #[must_root] struct StyleSheetInDocument { #[ignore_heap_size_of = "Arc"] @@ -353,7 +353,7 @@ pub struct Document { form_id_listener_map: DOMRefCell>>>, } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct ImagesFilter; impl CollectionFilter for ImagesFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { @@ -361,7 +361,7 @@ impl CollectionFilter for ImagesFilter { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct EmbedsFilter; impl CollectionFilter for EmbedsFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { @@ -369,7 +369,7 @@ impl CollectionFilter for EmbedsFilter { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct LinksFilter; impl CollectionFilter for LinksFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { @@ -378,7 +378,7 @@ impl CollectionFilter for LinksFilter { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct FormsFilter; impl CollectionFilter for FormsFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { @@ -386,7 +386,7 @@ impl CollectionFilter for FormsFilter { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct ScriptsFilter; impl CollectionFilter for ScriptsFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { @@ -394,7 +394,7 @@ impl CollectionFilter for ScriptsFilter { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct AnchorsFilter; impl CollectionFilter for AnchorsFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { @@ -402,7 +402,7 @@ impl CollectionFilter for AnchorsFilter { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct AppletsFilter; impl CollectionFilter for AppletsFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { @@ -2027,7 +2027,7 @@ impl Document { } } -#[derive(PartialEq, HeapSizeOf)] +#[derive(HeapSizeOf, PartialEq)] pub enum DocumentSource { FromParser, NotFromParser, @@ -2141,7 +2141,7 @@ fn url_has_network_scheme(url: &ServoUrl) -> bool { } } -#[derive(Copy, Clone, HeapSizeOf, JSTraceable, PartialEq, Eq)] +#[derive(Clone, Copy, Eq, HeapSizeOf, JSTraceable, PartialEq)] pub enum HasBrowsingContext { No, Yes, @@ -3513,7 +3513,7 @@ impl DocumentMethods for Document { #[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> { - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct NamedElementFilter { name: Atom, } @@ -4033,7 +4033,7 @@ impl Runnable for DocumentProgressHandler { } /// 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) @@ -4051,7 +4051,7 @@ pub enum FocusEventType { /// 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"] diff --git a/components/script/dom/domexception.rs b/components/script/dom/domexception.rs index 628ae5ceed5..63be8dc83e8 100644 --- a/components/script/dom/domexception.rs +++ b/components/script/dom/domexception.rs @@ -12,7 +12,7 @@ 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, diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index eab06c5c19d..11df4f6bd42 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -170,7 +170,7 @@ impl fmt::Debug for Root { } } -#[derive(PartialEq, HeapSizeOf)] +#[derive(HeapSizeOf, PartialEq)] pub enum ElementCreator { ParserCreated(u64), ScriptCreated, @@ -182,7 +182,7 @@ pub enum CustomElementCreationMode { } /// 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, @@ -2981,7 +2981,7 @@ impl<'a> AttributeMutation<'a> { /// 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>, } diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index d6ba1d85109..56a0f8cedd3 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -294,7 +294,7 @@ impl EventMethods for Event { } } -#[derive(PartialEq, HeapSizeOf, Copy, Clone)] +#[derive(Clone, Copy, HeapSizeOf, PartialEq)] pub enum EventBubbles { Bubbles, DoesNotBubble @@ -318,7 +318,7 @@ impl From for bool { } } -#[derive(PartialEq, HeapSizeOf, Copy, Clone)] +#[derive(Clone, Copy, HeapSizeOf, PartialEq)] pub enum EventCancelable { Cancelable, NotCancelable @@ -342,7 +342,7 @@ impl From for bool { } } -#[derive(JSTraceable, Copy, Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Eq, JSTraceable, PartialEq)] #[repr(u16)] #[derive(HeapSizeOf)] pub enum EventPhase { @@ -363,7 +363,7 @@ pub enum EventPhase { /// /// [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, diff --git a/components/script/dom/eventsource.rs b/components/script/dom/eventsource.rs index b5a4bab7a40..22a49eadd81 100644 --- a/components/script/dom/eventsource.rs +++ b/components/script/dom/eventsource.rs @@ -43,10 +43,10 @@ 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, @@ -535,7 +535,7 @@ impl Runnable for ReestablishConnectionRunnable { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub struct EventSourceTimeoutCallback { #[ignore_heap_size_of = "Because it is non-owning"] event_source: Trusted, diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index f45942f0f05..eaab9f79d9b 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -44,7 +44,7 @@ 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), ErrorEventHandler(Rc), @@ -61,14 +61,14 @@ impl CommonEventHandler { } } -#[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, @@ -76,7 +76,7 @@ struct InternalRawUncompiledHandler { } /// 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), @@ -106,7 +106,7 @@ impl InlineEventListener { } } -#[derive(JSTraceable, Clone, PartialEq)] +#[derive(Clone, JSTraceable, PartialEq)] enum EventListenerType { Additive(Rc), Inline(InlineEventListener), @@ -228,7 +228,7 @@ struct EventListenerEntry { listener: EventListenerType } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] /// A mix of potentially uncompiled and compiled event listeners of the same type. struct EventListeners(Vec); diff --git a/components/script/dom/filereader.rs b/components/script/dom/filereader.rs index 61da63a57e6..4fd9013047c 100644 --- a/components/script/dom/filereader.rs +++ b/components/script/dom/filereader.rs @@ -39,7 +39,7 @@ 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, @@ -66,11 +66,11 @@ impl ReadMetaData { } } -#[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, diff --git a/components/script/dom/headers.rs b/components/script/dom/headers.rs index 516100d6edc..ce97cb860d2 100644 --- a/components/script/dom/headers.rs +++ b/components/script/dom/headers.rs @@ -26,7 +26,7 @@ pub struct Headers { } // 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, diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index ee39f3a88c9..84a1294d1c2 100755 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -29,7 +29,7 @@ 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, diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 3d89c08b230..4491c22487a 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -42,7 +42,7 @@ 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), WebGL(JS), diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index b9c402b3003..aa8fe9cf383 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -26,7 +26,7 @@ pub trait CollectionFilter : JSTraceable { // An optional u32, using maxint to represent None. // It would be nicer just to use Option for this, but that would produce word // alignment issues since Option uses 33 bits. -#[derive(Clone, Copy, JSTraceable, HeapSizeOf)] +#[derive(Clone, Copy, HeapSizeOf, JSTraceable)] struct OptionU32 { bits: u32, } @@ -119,7 +119,7 @@ impl HTMLCollection { -> Root { // 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 { @@ -129,7 +129,7 @@ impl HTMLCollection { return HTMLCollection::create(window, root, box AllFilter); } - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct HtmlDocumentFilter { qualified_name: LocalName, ascii_lower_qualified_name: LocalName, @@ -169,7 +169,7 @@ impl HTMLCollection { } pub fn by_qual_tag_name(window: &Window, root: &Node, qname: QualName) -> Root { - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct TagNameNSFilter { qname: QualName } @@ -193,7 +193,7 @@ impl HTMLCollection { pub fn by_atomic_class_name(window: &Window, root: &Node, classes: Vec) -> Root { - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct ClassNameFilter { classes: Vec } @@ -212,7 +212,7 @@ impl HTMLCollection { } pub fn children(window: &Window, root: &Node) -> Root { - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct ElementChildFilter; impl CollectionFilter for ElementChildFilter { fn filter(&self, elem: &Element, root: &Node) -> bool { diff --git a/components/script/dom/htmldatalistelement.rs b/components/script/dom/htmldatalistelement.rs index 1603ac39bf7..c7ee6c60ff8 100644 --- a/components/script/dom/htmldatalistelement.rs +++ b/components/script/dom/htmldatalistelement.rs @@ -43,7 +43,7 @@ impl HTMLDataListElement { impl HTMLDataListElementMethods for HTMLDataListElement { // https://html.spec.whatwg.org/multipage/#dom-datalist-options fn Options(&self) -> Root { - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct HTMLDataListOptionsFilter; impl CollectionFilter for HTMLDataListOptionsFilter { fn filter(&self, elem: &Element, _root: &Node) -> bool { diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs index 4deb3190340..e121a38032f 100644 --- a/components/script/dom/htmlfieldsetelement.rs +++ b/components/script/dom/htmlfieldsetelement.rs @@ -52,7 +52,7 @@ impl HTMLFieldSetElement { impl HTMLFieldSetElementMethods for HTMLFieldSetElement { // https://html.spec.whatwg.org/multipage/#dom-fieldset-elements fn Elements(&self) -> Root { - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct ElementsFilter; impl CollectionFilter for ElementsFilter { fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool { diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 53867c755f8..bf957e3b3b4 100755 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -59,7 +59,7 @@ 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] @@ -172,7 +172,7 @@ impl HTMLFormElementMethods for HTMLFormElement { return elements; } - #[derive(JSTraceable, HeapSizeOf)] + #[derive(HeapSizeOf, JSTraceable)] struct ElementsFilter { form: Root } @@ -241,13 +241,13 @@ impl HTMLFormElementMethods for HTMLFormElement { } } -#[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 @@ -674,14 +674,14 @@ impl HTMLFormElement { } } -#[derive(JSTraceable, HeapSizeOf, Clone)] +#[derive(Clone, HeapSizeOf, JSTraceable)] pub enum FormDatumValue { #[allow(dead_code)] File(Root), String(DOMString) } -#[derive(HeapSizeOf, JSTraceable, Clone)] +#[derive(Clone, HeapSizeOf, JSTraceable)] pub struct FormDatum { pub ty: DOMString, pub name: DOMString, @@ -701,14 +701,14 @@ impl FormDatum { } } -#[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, @@ -759,7 +759,7 @@ impl FormSubmittableElement { } } -#[derive(Copy, Clone, HeapSizeOf)] +#[derive(Clone, Copy, HeapSizeOf)] pub enum FormSubmitter<'a> { FormElement(&'a HTMLFormElement), InputElement(&'a HTMLInputElement), diff --git a/components/script/dom/htmlheadingelement.rs b/components/script/dom/htmlheadingelement.rs index ca60441ac93..e9cba94c2df 100644 --- a/components/script/dom/htmlheadingelement.rs +++ b/components/script/dom/htmlheadingelement.rs @@ -10,7 +10,7 @@ use dom::node::Node; use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub enum HeadingLevel { Heading1, Heading2, diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 47a1d2adfcb..4585836f7a4 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -57,7 +57,7 @@ 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, diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 5d4e6ac0258..f4bbba68252 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -58,7 +58,7 @@ 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, @@ -66,12 +66,12 @@ enum State { 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, @@ -715,7 +715,7 @@ impl HTMLImageElement { } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub enum ImageElementMicrotask { StableStateUpdateImageDataTask { elem: Root, diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index efd12589e82..26597f5a100 100755 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -60,7 +60,7 @@ 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 { diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index d7e5c071f50..059b695db05 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -38,7 +38,7 @@ 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 { diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index 49ba3f4cc8d..ccc952d1b24 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -201,7 +201,7 @@ impl HTMLMediaElementContext { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub struct VideoMedia { format: String, #[ignore_heap_size_of = "defined in time"] @@ -794,7 +794,7 @@ impl VirtualMethods for HTMLMediaElement { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub enum MediaElementMicrotask { ResourceSelectionTask { elem: Root, diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs index 1f4f3c426bf..fd5a864862a 100755 --- a/components/script/dom/htmlselectelement.rs +++ b/components/script/dom/htmlselectelement.rs @@ -37,7 +37,7 @@ 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 { diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index 7f3d9974a74..c4a6232a599 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -36,7 +36,7 @@ pub struct HTMLTableElement { } #[allow(unrooted_must_root)] -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct TableRowFilter { sections: Vec>, } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index a337caf4ef9..03719528655 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -149,7 +149,7 @@ pub struct Node { 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, @@ -203,7 +203,7 @@ impl Drop for Node { /// 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 @@ -1368,7 +1368,7 @@ impl Iterator for TreeIterator { } /// Specifies whether children must be recursively cloned or not. -#[derive(Copy, Clone, PartialEq, HeapSizeOf)] +#[derive(Clone, Copy, HeapSizeOf, PartialEq)] pub enum CloneChildrenFlag { CloneChildren, DoNotCloneChildren @@ -2531,7 +2531,7 @@ impl VirtualMethods for Node { } /// 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, diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs index c639b3fa4e9..7fdfe5b6064 100644 --- a/components/script/dom/nodelist.rs +++ b/components/script/dom/nodelist.rs @@ -12,7 +12,7 @@ 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>), @@ -109,7 +109,7 @@ impl NodeList { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] #[must_root] pub struct ChildrenList { node: JS, diff --git a/components/script/dom/paintworkletglobalscope.rs b/components/script/dom/paintworkletglobalscope.rs index 607c432c78a..0a01e62cd9b 100644 --- a/components/script/dom/paintworkletglobalscope.rs +++ b/components/script/dom/paintworkletglobalscope.rs @@ -467,7 +467,7 @@ pub enum PaintWorkletTask { /// https://drafts.css-houdini.org/css-paint-api/#paint-definition /// This type is dangerous, because it contains uboxed `Heap` values, /// which can't be moved. -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] #[must_root] struct PaintDefinition { class_constructor: Heap, diff --git a/components/script/dom/serviceworkerglobalscope.rs b/components/script/dom/serviceworkerglobalscope.rs index 1beaafc5935..e741160c226 100644 --- a/components/script/dom/serviceworkerglobalscope.rs +++ b/components/script/dom/serviceworkerglobalscope.rs @@ -50,7 +50,7 @@ pub enum MixedMessage { FromTimeoutThread(()) } -#[derive(JSTraceable, Clone)] +#[derive(Clone, JSTraceable)] pub struct ServiceWorkerChan { pub sender: Sender } diff --git a/components/script/dom/servoparser/async_html.rs b/components/script/dom/servoparser/async_html.rs index 5486731ae9a..ec4bc6e070b 100644 --- a/components/script/dom/servoparser/async_html.rs +++ b/components/script/dom/servoparser/async_html.rs @@ -495,7 +495,7 @@ fn run(sink: Sink, } } -#[derive(JSTraceable, HeapSizeOf, Default)] +#[derive(Default, HeapSizeOf, JSTraceable)] struct ParseNodeData { contents: Option, is_integration_point: bool, diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 8ea79172c78..241179ed624 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -738,7 +738,7 @@ fn insert(parent: &Node, reference_child: Option<&Node>, child: NodeOrText, @@ -804,7 +804,7 @@ impl TestBinding { 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, diff --git a/components/script/dom/validitystate.rs b/components/script/dom/validitystate.rs index 879438aa389..4b4273bf353 100755 --- a/components/script/dom/validitystate.rs +++ b/components/script/dom/validitystate.rs @@ -11,7 +11,7 @@ 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, diff --git a/components/script/dom/vrdisplay.rs b/components/script/dom/vrdisplay.rs index a36bd27ad29..853893047e0 100644 --- a/components/script/dom/vrdisplay.rs +++ b/components/script/dom/vrdisplay.rs @@ -79,7 +79,7 @@ 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, diff --git a/components/script/dom/webgl_extensions/extensions.rs b/components/script/dom/webgl_extensions/extensions.rs index 3b702bec37a..8cda0a51980 100644 --- a/components/script/dom/webgl_extensions/extensions.rs +++ b/components/script/dom/webgl_extensions/extensions.rs @@ -44,7 +44,7 @@ const DEFAULT_DISABLED_GET_PARAMETER_NAMES: [GLenum; 1] = [ ]; /// WebGL features that are enabled/disabled by WebGL Extensions. -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct WebGLExtensionFeatures { gl_extensions: HashSet, disabled_tex_types: HashSet, @@ -73,7 +73,7 @@ impl Default for WebGLExtensionFeatures { /// Handles the list of implemented, supported and enabled WebGL extensions. #[must_root] -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub struct WebGLExtensions { extensions: DOMRefCell>>, features: DOMRefCell, @@ -223,7 +223,7 @@ impl WebGLExtensions { } // Helper structs -#[derive(JSTraceable, HeapSizeOf, PartialEq, Eq, Hash)] +#[derive(Eq, Hash, HeapSizeOf, JSTraceable, PartialEq)] struct TexFormatType(u32, u32); type WebGLQueryParameterFunc = Fn(*mut JSContext, &WebGLRenderingContext) diff --git a/components/script/dom/webgl_extensions/wrapper.rs b/components/script/dom/webgl_extensions/wrapper.rs index 684daef7556..3d3f8128e33 100644 --- a/components/script/dom/webgl_extensions/wrapper.rs +++ b/components/script/dom/webgl_extensions/wrapper.rs @@ -27,7 +27,7 @@ pub trait WebGLExtensionWrapper: JSTraceable + HeapSizeOf { } #[must_root] -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub struct TypedWebGLExtensionWrapper { extension: MutNullableJS } diff --git a/components/script/dom/webgl_validations/types.rs b/components/script/dom/webgl_validations/types.rs index 3920866b0ea..9271175b462 100644 --- a/components/script/dom/webgl_validations/types.rs +++ b/components/script/dom/webgl_validations/types.rs @@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderi /// 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 { $( diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs index 7a6b1090064..d4f52452178 100644 --- a/components/script/dom/webglframebuffer.rs +++ b/components/script/dom/webglframebuffer.rs @@ -19,7 +19,7 @@ use dom_struct::dom_struct; use std::cell::Cell; #[must_root] -#[derive(JSTraceable, Clone, HeapSizeOf)] +#[derive(Clone, HeapSizeOf, JSTraceable)] enum WebGLFramebufferAttachment { Renderbuffer(JS), Texture { texture: JS, level: i32 }, diff --git a/components/script/dom/webglshader.rs b/components/script/dom/webglshader.rs index 9bf76e91051..cd33092f26e 100644 --- a/components/script/dom/webglshader.rs +++ b/components/script/dom/webglshader.rs @@ -18,7 +18,7 @@ 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, diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs index 048af5d10e0..b4466ee9396 100644 --- a/components/script/dom/webgltexture.rs +++ b/components/script/dom/webgltexture.rs @@ -382,7 +382,7 @@ impl Drop for WebGLTexture { } } -#[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)] +#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)] pub struct ImageInfo { width: u32, height: u32, diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index b533789e611..5aab5496fd5 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -42,7 +42,7 @@ 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, diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index d45a6b9bc17..806e968e6f2 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -130,7 +130,7 @@ 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. diff --git a/components/script/dom/worklet.rs b/components/script/dom/worklet.rs index 653155a9433..9783dfc14a5 100644 --- a/components/script/dom/worklet.rs +++ b/components/script/dom/worklet.rs @@ -152,7 +152,7 @@ impl WorkletMethods for Worklet { } /// 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); @@ -656,7 +656,7 @@ impl WorkletThread { } /// 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"] diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index e6652d79d70..d6abcda33f2 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -74,7 +74,7 @@ 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, @@ -83,7 +83,7 @@ enum XMLHttpRequestState { 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 @@ -1335,7 +1335,7 @@ impl XMLHttpRequest { } } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub struct XHRTimeoutCallback { #[ignore_heap_size_of = "Because it is non-owning"] xhr: Trusted, diff --git a/components/script/microtask.rs b/components/script/microtask.rs index a25b7ff3719..23288fefc8c 100644 --- a/components/script/microtask.rs +++ b/components/script/microtask.rs @@ -21,7 +21,7 @@ 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>, @@ -29,7 +29,7 @@ pub struct MicrotaskQueue { performing_a_microtask_checkpoint: Cell, } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub enum Microtask { Promise(EnqueuedPromiseCallback), MediaElement(MediaElementMicrotask), @@ -43,7 +43,7 @@ pub trait MicrotaskRunnable { } /// 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, diff --git a/components/script/serviceworkerjob.rs b/components/script/serviceworkerjob.rs index 69151c621ff..e1f43a34763 100644 --- a/components/script/serviceworkerjob.rs +++ b/components/script/serviceworkerjob.rs @@ -26,7 +26,7 @@ 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, diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs index 12deff1880e..fe25c5f2486 100644 --- a/components/script/task_source/dom_manipulation.rs +++ b/components/script/task_source/dom_manipulation.rs @@ -14,7 +14,7 @@ use std::result::Result; use std::sync::mpsc::Sender; use task_source::TaskSource; -#[derive(JSTraceable, Clone)] +#[derive(Clone, JSTraceable)] pub struct DOMManipulationTaskSource(pub Sender); impl fmt::Debug for DOMManipulationTaskSource { diff --git a/components/script/task_source/performance_timeline.rs b/components/script/task_source/performance_timeline.rs index 272d971737d..99b43bdb987 100644 --- a/components/script/task_source/performance_timeline.rs +++ b/components/script/task_source/performance_timeline.rs @@ -16,7 +16,7 @@ use std::result::Result; use std::sync::mpsc::Sender; use task_source::TaskSource; -#[derive(JSTraceable, Clone)] +#[derive(Clone, JSTraceable)] pub struct PerformanceTimelineTaskSource(pub Sender); impl fmt::Debug for PerformanceTimelineTaskSource { diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs index 2878a347eb4..c2341cbf82c 100644 --- a/components/script/task_source/user_interaction.rs +++ b/components/script/task_source/user_interaction.rs @@ -14,7 +14,7 @@ use std::result::Result; use std::sync::mpsc::Sender; use task_source::TaskSource; -#[derive(JSTraceable, Clone)] +#[derive(Clone, JSTraceable)] pub struct UserInteractionTaskSource(pub Sender); impl fmt::Debug for UserInteractionTaskSource { diff --git a/components/script/textinput.rs b/components/script/textinput.rs index d1c473f5ad8..0ac002b9b9f 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -16,13 +16,13 @@ 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, @@ -49,7 +49,7 @@ impl From for DOMString { } } -#[derive(JSTraceable, Copy, Clone, HeapSizeOf, PartialEq)] +#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)] pub struct TextPoint { /// 0-based line number pub line: usize, @@ -58,7 +58,7 @@ pub struct TextPoint { } /// Encapsulated state for handling keyboard input in a single or multiline text input control. -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub struct TextInput { /// Current text input content, split across lines without trailing '\n' lines: Vec, @@ -96,14 +96,14 @@ impl Default for TextPoint { } /// 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 diff --git a/components/script/timers.rs b/components/script/timers.rs index f3c09505ff9..7d219bbb199 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -27,7 +27,7 @@ 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)] @@ -65,7 +65,7 @@ struct OneshotTimer { // 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(self: Box, this: &T, js_timers: &JsTimers);`. -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] pub enum OneshotTimerCallback { XhrTimeout(XHRTimeoutCallback), EventSourceTimeout(EventSourceTimeoutCallback), @@ -301,7 +301,7 @@ impl OneshotTimers { } } -#[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)] @@ -314,7 +314,7 @@ pub struct JsTimers { min_duration: Cell>, } -#[derive(JSTraceable, HeapSizeOf)] +#[derive(HeapSizeOf, JSTraceable)] struct JsTimerEntry { oneshot_handle: OneshotTimerHandle, } @@ -323,7 +323,7 @@ struct JsTimerEntry { // (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, @@ -335,7 +335,7 @@ pub struct JsTimerTask { } // 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, @@ -347,7 +347,7 @@ pub enum TimerCallback { FunctionTimerCallback(Rc), } -#[derive(JSTraceable, Clone)] +#[derive(Clone, JSTraceable)] enum InternalTimerCallback { StringTimerCallback(DOMString), FunctionTimerCallback(Rc, Rc]>>), diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs index 7c0f97ef917..c8143175005 100644 --- a/components/script_layout_interface/lib.rs +++ b/components/script_layout_interface/lib.rs @@ -74,7 +74,7 @@ impl StyleData { } } -#[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 \ @@ -101,13 +101,13 @@ impl DomParallelInfo { } -#[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, @@ -141,7 +141,7 @@ pub struct SVGSVGData { } /// 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)] diff --git a/components/script_layout_interface/reporter.rs b/components/script_layout_interface/reporter.rs index 1e8462603bc..ac5706f5116 100644 --- a/components/script_layout_interface/reporter.rs +++ b/components/script_layout_interface/reporter.rs @@ -11,7 +11,7 @@ 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, diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index 8de0cfa90bc..c58b6292ef0 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -28,7 +28,7 @@ use style::selector_parser::{PseudoElement, PseudoElementCascadeType, SelectorIm use style::stylist::RuleInclusion; use webrender_api::ClipId; -#[derive(Copy, PartialEq, Clone, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum PseudoElementType { Normal, Before(T), diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 0d39e1fb524..b9d1dad4b23 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -77,7 +77,7 @@ pub use script_msg::{ServiceWorkerMsg, ScopeThings, SWManagerMsg, SWManagerSende /// 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 { @@ -196,7 +196,7 @@ pub struct NewLayoutInfo { } /// 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, @@ -210,7 +210,7 @@ pub enum DiscardBrowsingContext { /// 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, @@ -221,7 +221,7 @@ pub enum DocumentActivity { } /// 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, @@ -340,7 +340,7 @@ impl fmt::Debug for ConstellationControlMsg { } /// 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, @@ -350,7 +350,7 @@ pub enum DocumentState { /// 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, @@ -378,7 +378,7 @@ pub enum TouchEventType { /// 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. @@ -421,7 +421,7 @@ pub enum CompositorEvent { } /// 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, @@ -451,7 +451,7 @@ pub enum TimerSchedulerMsg { 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), @@ -460,7 +460,7 @@ pub enum TimerSource { } /// 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. @@ -543,7 +543,7 @@ pub trait ScriptThreadFactory { } /// 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, @@ -683,7 +683,7 @@ pub enum AnimationTickType { } /// 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, @@ -692,7 +692,7 @@ pub struct ScrollState { } /// 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 @@ -703,7 +703,7 @@ pub struct WindowSizeData { } /// 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, @@ -774,7 +774,7 @@ pub enum ConstellationMsg { } /// Resources required by workerglobalscopes -#[derive(Serialize, Deserialize, Clone)] +#[derive(Clone, Deserialize, Serialize)] pub struct WorkerGlobalScopeInit { /// Chan to a resource thread pub resource_threads: ResourceThreads, @@ -799,7 +799,7 @@ pub struct WorkerGlobalScopeInit { } /// Common entities representing a network load origin -#[derive(Deserialize, Serialize, Clone)] +#[derive(Clone, Deserialize, Serialize)] pub struct WorkerScriptLoadOrigin { /// referrer url pub referrer_url: Option, @@ -810,7 +810,7 @@ pub struct WorkerScriptLoadOrigin { } /// Errors from executing a paint worklet -#[derive(Debug, Deserialize, Serialize, Clone)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub enum PaintWorkletError { /// Execution timed out. Timeout, @@ -837,7 +837,7 @@ pub trait Painter: SpeculativePainter { /// 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, @@ -852,7 +852,7 @@ pub struct DrawAPaintImageResult { } /// 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)>, diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 2d449e986a4..30ae527562e 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -163,7 +163,7 @@ pub enum ScriptMsg { } /// Entities required to spawn service workers -#[derive(Deserialize, Serialize, Clone)] +#[derive(Clone, Deserialize, Serialize)] pub struct ScopeThings { /// script resource url pub script_url: ServoUrl, @@ -178,7 +178,7 @@ pub struct ScopeThings { } /// 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); /// Channels to allow service worker manager to communicate with constellation and resource thread diff --git a/components/selectors/attr.rs b/components/selectors/attr.rs index b71be2cca73..15e732e17d4 100644 --- a/components/selectors/attr.rs +++ b/components/selectors/attr.rs @@ -7,7 +7,7 @@ use parser::SelectorImpl; use std::ascii::AsciiExt; use std::fmt; -#[derive(Eq, PartialEq, Clone)] +#[derive(Clone, Eq, PartialEq)] pub struct AttrSelectorWithNamespace { pub namespace: NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>, pub local_name: Impl::LocalName, @@ -27,7 +27,7 @@ impl AttrSelectorWithNamespace { } } -#[derive(Eq, PartialEq, Clone)] +#[derive(Clone, Eq, PartialEq)] pub enum NamespaceConstraint { Any, @@ -35,7 +35,7 @@ pub enum NamespaceConstraint { Specific(NamespaceUrl), } -#[derive(Eq, PartialEq, Clone)] +#[derive(Clone, Eq, PartialEq)] pub enum ParsedAttrSelectorOperation { Exists, WithValue { @@ -45,7 +45,7 @@ pub enum ParsedAttrSelectorOperation { } } -#[derive(Eq, PartialEq, Clone)] +#[derive(Clone, Eq, PartialEq)] pub enum AttrSelectorOperation { Exists, WithValue { @@ -66,7 +66,7 @@ impl AttrSelectorOperation { } } -#[derive(Eq, PartialEq, Clone, Copy)] +#[derive(Clone, Copy, Eq, PartialEq)] pub enum AttrSelectorOperator { Equal, Includes, @@ -127,7 +127,7 @@ 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, @@ -150,7 +150,7 @@ impl ParsedCaseSensitivity { } } -#[derive(Eq, PartialEq, Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum CaseSensitivity { CaseSensitive, AsciiCaseInsensitive, diff --git a/components/selectors/builder.rs b/components/selectors/builder.rs index cf5d934e13f..7195d63f14c 100644 --- a/components/selectors/builder.rs +++ b/components/selectors/builder.rs @@ -183,7 +183,7 @@ fn split_from_end(s: &[T], at: usize) -> (&[T], &[T]) { 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 { diff --git a/components/selectors/context.rs b/components/selectors/context.rs index 6cf516b74fc..31ce04b37a1 100644 --- a/components/selectors/context.rs +++ b/components/selectors/context.rs @@ -9,7 +9,7 @@ use bloom::BloomFilter; /// /// 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, @@ -29,7 +29,7 @@ pub enum MatchingMode { } /// 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, @@ -48,7 +48,7 @@ pub enum VisitedHandlingMode { /// 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, diff --git a/components/selectors/gecko_like_types.rs b/components/selectors/gecko_like_types.rs index ac003151df4..e0ef0f81e9d 100644 --- a/components/selectors/gecko_like_types.rs +++ b/components/selectors/gecko_like_types.rs @@ -5,7 +5,7 @@ //! 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, @@ -13,15 +13,15 @@ pub enum PseudoClass { 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; diff --git a/components/selectors/matching.rs b/components/selectors/matching.rs index ead73c6a7fb..a29299c4794 100644 --- a/components/selectors/matching.rs +++ b/components/selectors/matching.rs @@ -215,7 +215,7 @@ fn may_match(hashes: &AncestorHashes, /// 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. @@ -352,7 +352,7 @@ impl RelevantLinkStatus { /// 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, diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index ce6bfab62c8..706e3c2ded1 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -170,7 +170,7 @@ pub trait Parser<'i> { } } -#[derive(PartialEq, Eq, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct SelectorList(pub Vec>); impl SelectorList { @@ -206,7 +206,7 @@ impl SelectorList { /// 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], } @@ -575,7 +575,7 @@ impl<'a, Impl: SelectorImpl> Iterator for AncestorIter<'a, Impl> { } } -#[derive(Eq, PartialEq, Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Combinator { Child, // > Descendant, // space @@ -613,7 +613,7 @@ impl Combinator { /// 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 { Combinator(Combinator), @@ -712,7 +712,7 @@ impl Component { } } -#[derive(Eq, PartialEq, Clone)] +#[derive(Clone, Eq, PartialEq)] pub struct LocalName { pub name: Impl::LocalName, pub lower_name: Impl::LocalName, @@ -1694,14 +1694,14 @@ pub mod tests { 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, @@ -1749,7 +1749,7 @@ pub mod tests { where V: SelectorVisitor { true } } - #[derive(Clone, PartialEq, Debug)] + #[derive(Clone, Debug, PartialEq)] pub struct DummySelectorImpl; #[derive(Default)] @@ -1786,7 +1786,7 @@ pub mod tests { } } - #[derive(Default, Debug, Clone, PartialEq, Eq, Hash)] + #[derive(Clone, Debug, Default, Eq, Hash, PartialEq)] pub struct DummyAtom(String); impl fmt::Display for DummyAtom { diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs index 182acecf885..2d0dbd8236c 100644 --- a/components/servo_arc/lib.rs +++ b/components/servo_arc/lib.rs @@ -879,7 +879,7 @@ impl Arc { /// /// 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> {} diff --git a/components/style/animation.rs b/components/style/animation.rs index 6736d39269f..05bd3de0531 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -28,7 +28,7 @@ use values::generics::transform::{StepPosition, TimingFunction as GenericTimingF /// /// 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, @@ -39,7 +39,7 @@ pub enum KeyframesIterationState { /// 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. @@ -52,7 +52,7 @@ pub enum KeyframesRunningState { /// 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, @@ -244,7 +244,7 @@ impl Animation { /// 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, @@ -254,7 +254,7 @@ pub struct AnimationFrame { } /// Represents an animation for a given property. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct PropertyAnimation { property: AnimatedProperty, timing_function: TimingFunction, diff --git a/components/style/applicable_declarations.rs b/components/style/applicable_declarations.rs index 733418b4707..ffd2c8ea180 100644 --- a/components/style/applicable_declarations.rs +++ b/components/style/applicable_declarations.rs @@ -37,7 +37,7 @@ 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 { @@ -76,7 +76,7 @@ impl Debug for SourceOrderAndCascadeLevel { /// 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")] diff --git a/components/style/context.rs b/components/style/context.rs index 07c5bb07371..591ea98a003 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -727,7 +727,7 @@ pub struct StyleContext<'a, E: TElement + 'a> { } /// 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, diff --git a/components/style/counter_style/mod.rs b/components/style/counter_style/mod.rs index df405e9f262..aff2fbc9ad3 100644 --- a/components/style/counter_style/mod.rs +++ b/components/style/counter_style/mod.rs @@ -270,7 +270,7 @@ counter_style_descriptors! { } /// https://drafts.csswg.org/css-counter-styles/#counter-style-system -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum System { /// 'cyclic' Cyclic, @@ -335,7 +335,7 @@ impl ToCss for System { } /// https://drafts.csswg.org/css-counter-styles/#typedef-symbol -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum Symbol { /// String(String), @@ -378,7 +378,7 @@ impl Symbol { } /// 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); impl Parse for Negative { @@ -393,7 +393,7 @@ impl Parse for Negative { /// 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>>); impl Parse for Ranges { @@ -482,7 +482,7 @@ impl Parse for 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); impl Parse for Symbols { diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 0a3d02bb90e..c4d979f7a7c 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -39,7 +39,7 @@ pub fn parse_name(s: &str) -> Result<&str, ()> { /// /// 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, diff --git a/components/style/dom.rs b/components/style/dom.rs index 7716a8a1e38..74f0b8b5bd4 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -46,7 +46,7 @@ pub use style_traits::UnsafeNode; /// 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); diff --git a/components/style/font_face.rs b/components/style/font_face.rs index b2d130cc510..5ec36faf9a5 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -44,7 +44,7 @@ impl OneOrMoreSeparated for Source { /// `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. @@ -225,7 +225,7 @@ macro_rules! font_face_descriptors_common { /// 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] diff --git a/components/style/font_metrics.rs b/components/style/font_metrics.rs index 64c12f898c7..26be9a17c29 100644 --- a/components/style/font_metrics.rs +++ b/components/style/font_metrics.rs @@ -16,7 +16,7 @@ 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, @@ -25,7 +25,7 @@ pub struct FontMetrics { } /// 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. diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index 28857a3c010..7c1bb6f68e3 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -20,7 +20,7 @@ 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 { diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index 4833b0489ca..9736c595ac4 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -200,7 +200,7 @@ impl Device { /// 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, @@ -242,7 +242,7 @@ impl PartialEq for Expression { } /// A resolution. -#[derive(PartialEq, Debug, Clone)] +#[derive(Clone, Debug, PartialEq)] pub enum Resolution { /// Dots per inch. Dpi(CSSFloat), @@ -295,7 +295,7 @@ impl ToCss for Resolution { } /// 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), diff --git a/components/style/gecko/pseudo_element_definition.mako.rs b/components/style/gecko/pseudo_element_definition.mako.rs index f11d46f59f3..41ac2500bbe 100644 --- a/components/style/gecko/pseudo_element_definition.mako.rs +++ b/components/style/gecko/pseudo_element_definition.mako.rs @@ -3,7 +3,7 @@ * 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} diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index b5ec344b0f2..21c12305e6a 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -35,7 +35,7 @@ macro_rules! pseudo_class_name { 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] @@ -256,7 +256,7 @@ impl NonTSPseudoClass { } /// 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 { diff --git a/components/style/gecko_bindings/sugar/ns_style_coord.rs b/components/style/gecko_bindings/sugar/ns_style_coord.rs index 001ab16b6c2..cf9b684bbb9 100644 --- a/components/style/gecko_bindings/sugar/ns_style_coord.rs +++ b/components/style/gecko_bindings/sugar/ns_style_coord.rs @@ -204,7 +204,7 @@ impl<'a> CoordDataMut for CornersDataMut<'a> { /// /// 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, diff --git a/components/style/gecko_string_cache/mod.rs b/components/style/gecko_string_cache/mod.rs index aa3c3b731ea..d8390097016 100644 --- a/components/style/gecko_string_cache/mod.rs +++ b/components/style/gecko_string_cache/mod.rs @@ -39,7 +39,7 @@ macro_rules! local_name { } /// A strong reference to a Gecko atom. -#[derive(PartialEq, Eq)] +#[derive(Eq, PartialEq)] pub struct Atom(*mut WeakAtom); /// An atom *without* a strong reference. diff --git a/components/style/gecko_string_cache/namespace.rs b/components/style/gecko_string_cache/namespace.rs index 090243204c8..c8c4deee8b6 100644 --- a/components/style/gecko_string_cache/namespace.rs +++ b/components/style/gecko_string_cache/namespace.rs @@ -18,7 +18,7 @@ macro_rules! ns { } /// 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 { diff --git a/components/style/invalidation/element/invalidator.rs b/components/style/invalidation/element/invalidator.rs index e1bb22ccb3b..7edc3609429 100644 --- a/components/style/invalidation/element/invalidator.rs +++ b/components/style/invalidation/element/invalidator.rs @@ -48,7 +48,7 @@ type InvalidationVector = SmallVec<[Invalidation; 10]>; /// /// 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, diff --git a/components/style/invalidation/media_queries.rs b/components/style/invalidation/media_queries.rs index b50f44ce919..729be73d9bb 100644 --- a/components/style/invalidation/media_queries.rs +++ b/components/style/invalidation/media_queries.rs @@ -23,7 +23,7 @@ use stylesheets::{NestedRuleIterationCondition, Stylesheet}; /// /// 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); diff --git a/components/style/invalidation/stylesheets.rs b/components/style/invalidation/stylesheets.rs index 3c071fc4a4d..b351bdd12ee 100644 --- a/components/style/invalidation/stylesheets.rs +++ b/components/style/invalidation/stylesheets.rs @@ -20,7 +20,7 @@ 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. diff --git a/components/style/logical_geometry.rs b/components/style/logical_geometry.rs index 90d0b337c5f..dd6653d25f1 100644 --- a/components/style/logical_geometry.rs +++ b/components/style/logical_geometry.rs @@ -175,12 +175,12 @@ impl fmt::Display for WritingMode { /// (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 @@ -232,7 +232,7 @@ impl Debug for DebugWritingMode { // 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, @@ -240,7 +240,7 @@ pub enum Direction { } /// 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 { pub inline: T, // inline-size, a.k.a. logical width, a.k.a. measure @@ -377,7 +377,7 @@ impl> Sub for LogicalSize { /// 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 { /// inline-axis coordinate @@ -550,7 +550,7 @@ impl> Sub> for LogicalPoint { /// 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 { pub block_start: T, @@ -854,7 +854,7 @@ impl> Sub for LogicalMargin { /// 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 { pub start: LogicalPoint, @@ -1102,7 +1102,7 @@ impl + Sub> Sub> for Lo } } -#[derive(Copy, Clone, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum PhysicalSide { Top, Right, diff --git a/components/style/matching.rs b/components/style/matching.rs index 47b03fbb477..a00871018f5 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -40,7 +40,7 @@ impl StyleDifference { } /// 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, @@ -50,7 +50,7 @@ pub enum StyleChange { /// 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 @@ -96,7 +96,7 @@ impl RulesChanged { } /// 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, diff --git a/components/style/media_queries.rs b/components/style/media_queries.rs index 9d3f113f0a9..aef18a989fa 100644 --- a/components/style/media_queries.rs +++ b/components/style/media_queries.rs @@ -23,7 +23,7 @@ pub use servo::media_queries::{Device, Expression}; 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. @@ -60,7 +60,7 @@ pub enum Qualifier { /// 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. @@ -132,7 +132,7 @@ impl ToCss for MediaQuery { } /// 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. @@ -161,7 +161,7 @@ impl MediaQueryType { } /// 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); diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index 07bc5eeab1d..5acecd4e801 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -42,7 +42,7 @@ impl AnimationRules { /// /// [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, diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index e553db36d90..ca1756098ed 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -448,7 +448,7 @@ ${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), diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 683c23555ce..f0c65e018d7 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -68,7 +68,7 @@ pub trait RepeatableListAnimatable: Animate {} /// 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: diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index b54e0648e33..f70ef7e06d4 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -64,7 +64,7 @@ ${helpers.predefined_type("background-image", "ImageLayer", 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); } diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index 6b8891ffc2c..f4326fc0399 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -82,12 +82,12 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style', 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>); } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { None, @@ -236,12 +236,12 @@ ${helpers.predefined_type("border-image-outset", "LengthOrNumberRect", 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); diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 531096dcf3b..659d8c69307 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -370,7 +370,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed", /// 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: @@ -523,7 +523,7 @@ ${helpers.predefined_type("transition-delay", 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); @@ -618,7 +618,7 @@ ${helpers.predefined_type("animation-timing-function", // 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, @@ -1855,7 +1855,7 @@ ${helpers.single_keyword("-moz-orient", pub use super::SpecifiedValue as T; } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { Auto, diff --git a/components/style/properties/longhand/counters.mako.rs b/components/style/properties/longhand/counters.mako.rs index c10d06c8036..12a4d8d4413 100644 --- a/components/style/properties/longhand/counters.mako.rs +++ b/components/style/properties/longhand/counters.mako.rs @@ -40,7 +40,7 @@ #[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. @@ -101,7 +101,7 @@ } } - #[derive(Debug, PartialEq, Eq, Clone)] + #[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum T { Normal, @@ -240,7 +240,7 @@ 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 { @@ -248,7 +248,7 @@ 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)>); diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index 70fa55e2a14..ea318ae731d 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -85,21 +85,21 @@ macro_rules! impl_gecko_keyword_conversions { 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" @@ -296,7 +296,7 @@ macro_rules! impl_gecko_keyword_conversions { } } - #[derive(Debug, Clone, PartialEq, Eq, Hash)] + #[derive(Clone, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct T(pub Vec); } @@ -314,7 +314,7 @@ macro_rules! impl_gecko_keyword_conversions { SpecifiedValue::parse(input) } - #[derive(Debug, Clone, PartialEq, Eq, Hash)] + #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum SpecifiedValue { Values(Vec), System(SystemFont), @@ -485,7 +485,7 @@ ${helpers.single_keyword_system("font-variant-caps", /// /// 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); @@ -624,7 +624,7 @@ ${helpers.single_keyword_system("font-variant-caps", } } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum SpecifiedValue { Length(specified::LengthOrPercentage), @@ -652,7 +652,7 @@ ${helpers.single_keyword_system("font-variant-caps", } /// 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 @@ -1120,7 +1120,7 @@ ${helpers.single_keyword_system("font-variant-caps", 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), @@ -1217,7 +1217,7 @@ ${helpers.single_keyword_system("font-variant-caps", 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, @@ -1325,7 +1325,7 @@ ${helpers.single_keyword_system("font-kerning", no_viewport_percentage!(SpecifiedValue); - #[derive(PartialEq, Clone, Debug)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum VariantAlternates { Stylistic(CustomIdent), @@ -1337,11 +1337,11 @@ ${helpers.single_keyword_system("font-kerning", 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), @@ -1552,7 +1552,7 @@ macro_rules! exclusive_value { } - #[derive(Debug, Clone, PartialEq, ToCss)] + #[derive(Clone, Debug, PartialEq, ToCss)] pub enum SpecifiedValue { Value(VariantEastAsian), System(SystemFont) @@ -1698,7 +1698,7 @@ macro_rules! exclusive_value { } - #[derive(Debug, Clone, PartialEq, ToCss)] + #[derive(Clone, Debug, PartialEq, ToCss)] pub enum SpecifiedValue { Value(VariantLigatures), System(SystemFont) @@ -1858,7 +1858,7 @@ macro_rules! exclusive_value { - #[derive(Debug, Clone, PartialEq, ToCss)] + #[derive(Clone, Debug, PartialEq, ToCss)] pub enum SpecifiedValue { Value(VariantNumeric), System(SystemFont) @@ -1997,7 +1997,7 @@ ${helpers.single_keyword_system("font-variant-position", 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) @@ -2074,7 +2074,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control- 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, @@ -2131,7 +2131,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control- // 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); } @@ -2304,7 +2304,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control- 0 } - #[derive(Copy, Clone, PartialEq, Debug)] + #[derive(Clone, Copy, Debug, PartialEq)] pub enum SpecifiedValue { Relative(i32), Absolute(i32), @@ -2643,7 +2643,7 @@ ${helpers.single_keyword("-moz-math-variant", // 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 {} diff --git a/components/style/properties/longhand/inherited_box.mako.rs b/components/style/properties/longhand/inherited_box.mako.rs index 99d9216fce3..32c9c4440ce 100644 --- a/components/style/properties/longhand/inherited_box.mako.rs +++ b/components/style/properties/longhand/inherited_box.mako.rs @@ -71,7 +71,7 @@ ${helpers.single_keyword("image-rendering", 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, @@ -102,7 +102,7 @@ ${helpers.single_keyword("image-rendering", 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, @@ -134,7 +134,7 @@ ${helpers.single_keyword("image-rendering", } } - #[derive(Clone, PartialEq, Copy, Debug)] + #[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum T { FromImage, @@ -261,7 +261,7 @@ ${helpers.single_keyword("image-rendering", 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); diff --git a/components/style/properties/longhand/inherited_svg.mako.rs b/components/style/properties/longhand/inherited_svg.mako.rs index 533c2f62e68..36ad2598a7b 100644 --- a/components/style/properties/longhand/inherited_svg.mako.rs +++ b/components/style/properties/longhand/inherited_svg.mako.rs @@ -164,7 +164,7 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)", /// /// 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); diff --git a/components/style/properties/longhand/inherited_text.mako.rs b/components/style/properties/longhand/inherited_text.mako.rs index 7f8e032f021..0e74957c499 100644 --- a/components/style/properties/longhand/inherited_text.mako.rs +++ b/components/style/properties/longhand/inherited_text.mako.rs @@ -177,7 +177,7 @@ ${helpers.single_keyword("text-align-last", 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, @@ -294,7 +294,7 @@ ${helpers.predefined_type("word-spacing", 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, @@ -446,7 +446,7 @@ ${helpers.predefined_type( String(String), } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct KeywordValue { pub fill: bool, @@ -462,7 +462,7 @@ ${helpers.predefined_type( String(String), } - #[derive(Debug, Clone, PartialEq)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum KeywordValue { Fill(bool), @@ -630,7 +630,7 @@ ${helpers.predefined_type( "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 { diff --git a/components/style/properties/longhand/list.mako.rs b/components/style/properties/longhand/list.mako.rs index 81223ab4f9b..f18d92ebb13 100644 --- a/components/style/properties/longhand/list.mako.rs +++ b/components/style/properties/longhand/list.mako.rs @@ -42,7 +42,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu use values::generics::CounterStyleOrNone; /// | | none - #[derive(Debug, Clone, Eq, PartialEq, ToCss)] + #[derive(Clone, Debug, Eq, PartialEq, ToCss)] pub enum T { CounterStyle(CounterStyleOrNone), String(String), @@ -110,7 +110,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu 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); } @@ -151,7 +151,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu 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)>); } diff --git a/components/style/properties/longhand/pointing.mako.rs b/components/style/properties/longhand/pointing.mako.rs index 026275d3b17..dd8f40fd76f 100644 --- a/components/style/properties/longhand/pointing.mako.rs +++ b/components/style/properties/longhand/pointing.mako.rs @@ -36,14 +36,14 @@ 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, pub keyword: Keyword, diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index e0f34ed0d73..68f3c0b2719 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -296,14 +296,14 @@ ${helpers.predefined_type("object-position", 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, diff --git a/components/style/properties/longhand/table.mako.rs b/components/style/properties/longhand/table.mako.rs index 584d08032ec..48984916fd6 100644 --- a/components/style/properties/longhand/table.mako.rs +++ b/components/style/properties/longhand/table.mako.rs @@ -23,7 +23,7 @@ ${helpers.single_keyword("table-layout", "auto fixed", 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); diff --git a/components/style/properties/longhand/text.mako.rs b/components/style/properties/longhand/text.mako.rs index 7f7a22fc38a..2f39d38302c 100644 --- a/components/style/properties/longhand/text.mako.rs +++ b/components/style/properties/longhand/text.mako.rs @@ -38,7 +38,7 @@ 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" diff --git a/components/style/properties/longhand/ui.mako.rs b/components/style/properties/longhand/ui.mako.rs index b3a279aba7a..1663c379e3c 100644 --- a/components/style/properties/longhand/ui.mako.rs +++ b/components/style/properties/longhand/ui.mako.rs @@ -54,7 +54,7 @@ ${helpers.single_keyword("-moz-window-shadow", "none default menu tooltip sheet" 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); } diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index f64117e1bfc..a962594e80b 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -231,7 +231,7 @@ pub mod animated_properties { } /// A longhand or shorthand porperty -#[derive(Copy, Clone, Debug)] +#[derive(Clone, Copy, Debug)] pub struct NonCustomPropertyId(usize); impl From for NonCustomPropertyId { @@ -396,7 +396,7 @@ 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, @@ -459,7 +459,7 @@ bitflags! { } /// 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): @@ -771,7 +771,7 @@ impl ShorthandId { /// 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), @@ -785,7 +785,7 @@ pub enum DeclaredValue<'a, T: 'a> { /// 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 { /// A known specified value from the stylesheet. Value(T), @@ -807,7 +807,7 @@ impl DeclaredValueOwned { } /// 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, @@ -910,7 +910,7 @@ impl<'a, T: ToCss> ToCss for DeclaredValue<'a, T> { /// 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. @@ -975,7 +975,7 @@ impl<'a> PropertyDeclarationId<'a> { /// 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), @@ -1284,7 +1284,7 @@ impl PropertyParserContext { } /// Servo's representation for a property declaration. -#[derive(PartialEq, Clone)] +#[derive(Clone, PartialEq)] pub enum PropertyDeclaration { % for property in data.longhands: /// ${property.name} @@ -1724,7 +1724,7 @@ pub mod 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. @@ -3495,7 +3495,7 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc, } /// 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()): diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 1b1062d255a..ceb94aa15f6 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -69,7 +69,7 @@ impl Drop for RuleTree { /// 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>), @@ -442,7 +442,7 @@ const RULE_TREE_GC_INTERVAL: usize = 300; /// /// [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. diff --git a/components/style/selector_parser.rs b/components/style/selector_parser.rs index 1960f9b8010..e469e43d1de 100644 --- a/components/style/selector_parser.rs +++ b/components/style/selector_parser.rs @@ -80,7 +80,7 @@ impl<'a> SelectorParser<'a> { /// /// 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 diff --git a/components/style/servo/media_queries.rs b/components/style/servo/media_queries.rs index 9b47d231c97..4a75a112906 100644 --- a/components/style/servo/media_queries.rs +++ b/components/style/servo/media_queries.rs @@ -133,7 +133,7 @@ impl Device { /// 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 @@ -143,7 +143,7 @@ pub enum ExpressionKind { /// 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); @@ -221,7 +221,7 @@ impl ToCss for Expression { /// /// 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 { /// At least the inner value. diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs index 9fcce17bde2..201fbd1b6fe 100644 --- a/components/style/servo/selector_parser.rs +++ b/components/style/servo/selector_parser.rs @@ -31,7 +31,7 @@ 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)] @@ -252,7 +252,7 @@ pub type PseudoClassStringArg = Box; /// 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 { diff --git a/components/style/servo/url.rs b/components/style/servo/url.rs index 4736f2967d8..2d7844f5374 100644 --- a/components/style/servo/url.rs +++ b/components/style/servo/url.rs @@ -22,7 +22,7 @@ use values::computed::{Context, ToComputedValue, ComputedUrl}; /// /// 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 diff --git a/components/style/stylesheets/keyframes_rule.rs b/components/style/stylesheets/keyframes_rule.rs index 7fc292a339e..423e14db589 100644 --- a/components/style/stylesheets/keyframes_rule.rs +++ b/components/style/stylesheets/keyframes_rule.rs @@ -99,7 +99,7 @@ impl DeepCloneWithLock for KeyframesRule { /// 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); @@ -147,7 +147,7 @@ impl KeyframePercentage { /// 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); impl ToCss for KeyframeSelector { diff --git a/components/style/stylesheets/mod.rs b/components/style/stylesheets/mod.rs index 1ec7cbbfb06..358619c8d42 100644 --- a/components/style/stylesheets/mod.rs +++ b/components/style/stylesheets/mod.rs @@ -88,7 +88,7 @@ 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 @@ -135,7 +135,7 @@ impl MallocSizeOfWithGuard for CssRule { } #[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, diff --git a/components/style/stylesheets/origin.rs b/components/style/stylesheets/origin.rs index 29f5fdae16b..9a875731e9b 100644 --- a/components/style/stylesheets/origin.rs +++ b/components/style/stylesheets/origin.rs @@ -10,7 +10,7 @@ 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 { diff --git a/components/style/stylesheets/rule_parser.rs b/components/style/stylesheets/rule_parser.rs index 4f9fe566c90..6af3bb63a62 100644 --- a/components/style/stylesheets/rule_parser.rs +++ b/components/style/stylesheets/rule_parser.rs @@ -86,7 +86,7 @@ impl<'b> TopLevelRuleParser<'b> { } /// 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, diff --git a/components/style/stylesheets/stylesheet.rs b/components/style/stylesheets/stylesheet.rs index 9dc8446f6b6..cb85de131b9 100644 --- a/components/style/stylesheets/stylesheet.rs +++ b/components/style/stylesheets/stylesheet.rs @@ -36,7 +36,7 @@ pub struct UserAgentStylesheets { /// 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)>, diff --git a/components/style/stylist.rs b/components/style/stylist.rs index bd3c30cce05..b8e587dad92 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -426,7 +426,7 @@ pub struct Stylist { } /// 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. diff --git a/components/style/timer.rs b/components/style/timer.rs index b77563b5ffb..3f6e8047743 100644 --- a/components/style/timer.rs +++ b/components/style/timer.rs @@ -9,7 +9,7 @@ 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), @@ -20,7 +20,7 @@ enum TimerMode { /// 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, } diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 2882d7d4d5f..b4d409ad79c 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -40,7 +40,7 @@ impl PreTraverseToken { } /// The kind of traversals we could perform. -#[derive(Debug, Copy, Clone)] +#[derive(Clone, Copy, Debug)] pub enum TraversalDriver { /// A potentially parallel traversal. Parallel, diff --git a/components/style/values/computed/align.rs b/components/style/values/computed/align.rs index 3d997915cad..d90ab28782c 100644 --- a/components/style/values/computed/align.rs +++ b/components/style/values/computed/align.rs @@ -17,7 +17,7 @@ pub use super::specified::{AlignItems, AlignJustifyContent, AlignJustifySelf}; /// /// 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, diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index 945ce8b841f..a2145d37745 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -64,7 +64,7 @@ impl ToComputedValue for specified::Length { } } -#[derive(Clone, PartialEq, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub struct CalcLengthOrPercentage { diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 912c35238a9..22d958f90a6 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -554,7 +554,7 @@ impl From for NonNegativeAu { /// 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), diff --git a/components/style/values/computed/time.rs b/components/style/values/computed/time.rs index f1e463882cc..5b5af99fc7c 100644 --- a/components/style/values/computed/time.rs +++ b/components/style/values/computed/time.rs @@ -9,7 +9,7 @@ use style_traits::ToCss; use values::CSSFloat; /// A computed `