Auto merge of #18179 - davidcl:master, r=jdm

Automatically verify that derive() lists are alphabetically ordered #…

<!-- Please describe your changes on the following line: -->
Automatically verify that derive() lists are alphabetically ordered #18172

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18172 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18179)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-23 17:18:31 -05:00 committed by GitHub
commit 4743696189
197 changed files with 568 additions and 552 deletions

View file

@ -81,13 +81,13 @@ pub enum FromScriptMsg {
SendPixels(IpcSender<Option<Vec<u8>>>), SendPixels(IpcSender<Option<Vec<u8>>>),
} }
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct CanvasGradientStop { pub struct CanvasGradientStop {
pub offset: f64, pub offset: f64,
pub color: RGBA, pub color: RGBA,
} }
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct LinearGradientStyle { pub struct LinearGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -109,7 +109,7 @@ impl LinearGradientStyle {
} }
} }
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct RadialGradientStyle { pub struct RadialGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -164,7 +164,7 @@ pub enum FillOrStrokeStyle {
Surface(SurfaceStyle), Surface(SurfaceStyle),
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
pub enum LineCapStyle { pub enum LineCapStyle {
Butt = 0, Butt = 0,
Round = 1, Round = 1,
@ -184,7 +184,7 @@ impl FromStr for LineCapStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
pub enum LineJoinStyle { pub enum LineJoinStyle {
Round = 0, Round = 0,
Bevel = 1, Bevel = 1,
@ -204,7 +204,7 @@ impl FromStr for LineJoinStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] #[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
pub enum RepetitionStyle { pub enum RepetitionStyle {
Repeat, Repeat,
RepeatX, RepeatX,
@ -226,7 +226,7 @@ impl FromStr for RepetitionStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
pub enum CompositionStyle { pub enum CompositionStyle {
SrcIn, SrcIn,
SrcOut, SrcOut,
@ -280,7 +280,7 @@ impl CompositionStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
pub enum BlendingStyle { pub enum BlendingStyle {
Multiply, Multiply,
Screen, Screen,
@ -346,7 +346,7 @@ impl BlendingStyle {
} }
} }
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
pub enum CompositionOrBlending { pub enum CompositionOrBlending {
Composition(CompositionStyle), Composition(CompositionStyle),
Blending(BlendingStyle), Blending(BlendingStyle),

View file

@ -68,14 +68,14 @@ impl ConvertPipelineIdFromWebRender for webrender_api::PipelineId {
/// Holds the state when running reftests that determines when it is /// Holds the state when running reftests that determines when it is
/// safe to save the output image. /// safe to save the output image.
#[derive(Copy, Clone, PartialEq)] #[derive(Clone, Copy, PartialEq)]
enum ReadyState { enum ReadyState {
Unknown, Unknown,
WaitingForConstellationReply, WaitingForConstellationReply,
ReadyToSaveImage, ReadyToSaveImage,
} }
#[derive(PartialEq, Eq, Debug, Copy, Clone)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
struct FrameTreeId(u32); struct FrameTreeId(u32);
impl FrameTreeId { impl FrameTreeId {
@ -88,7 +88,7 @@ impl FrameTreeId {
/// ///
/// This unit corresponds to a "pixel" in layer coordinate space, which after scaling and /// This unit corresponds to a "pixel" in layer coordinate space, which after scaling and
/// transformation becomes a device pixel. /// transformation becomes a device pixel.
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
enum LayerPixel {} enum LayerPixel {}
/// NB: Never block on the constellation, because sometimes the constellation blocks on us. /// NB: Never block on the constellation, because sometimes the constellation blocks on us.
@ -195,7 +195,7 @@ pub struct IOCompositor<Window: WindowMethods> {
pending_paint_metrics: HashMap<PipelineId, Epoch>, pending_paint_metrics: HashMap<PipelineId, Epoch>,
} }
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
struct ScrollZoomEvent { struct ScrollZoomEvent {
/// Change the pinch zoom level by this factor /// Change the pinch zoom level by this factor
magnification: f32, magnification: f32,
@ -209,13 +209,13 @@ struct ScrollZoomEvent {
event_count: u32, event_count: u32,
} }
#[derive(PartialEq, Debug)] #[derive(Debug, PartialEq)]
enum CompositionRequest { enum CompositionRequest {
NoCompositingNecessary, NoCompositingNecessary,
CompositeNow(CompositingReason), CompositeNow(CompositingReason),
} }
#[derive(Clone, Copy, PartialEq, Debug)] #[derive(Clone, Copy, Debug, PartialEq)]
enum ShutdownState { enum ShutdownState {
NotShuttingDown, NotShuttingDown,
ShuttingDown, ShuttingDown,
@ -247,7 +247,7 @@ impl PipelineDetails {
} }
} }
#[derive(Clone, Copy, PartialEq, Debug)] #[derive(Clone, Copy, Debug, PartialEq)]
enum CompositeTarget { enum CompositeTarget {
/// Normal composition to a window /// Normal composition to a window
Window, Window,
@ -1657,7 +1657,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
} }
/// Why we performed a composite. This is used for debugging. /// Why we performed a composite. This is used for debugging.
#[derive(Copy, Clone, PartialEq, Debug)] #[derive(Clone, Copy, Debug, PartialEq)]
pub enum CompositingReason { pub enum CompositingReason {
/// We hit the delayed composition timeout. (See `delayed_composition.rs`.) /// We hit the delayed composition timeout. (See `delayed_composition.rs`.)
DelayedCompositeTimeout, DelayedCompositeTimeout,

View file

@ -115,7 +115,7 @@ impl Debug for WindowEvent {
} }
} }
#[derive(Debug, Copy, Clone, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
pub enum AnimationState { pub enum AnimationState {
Idle, Idle,
Animating, Animating,

View file

@ -25,7 +25,7 @@ lazy_static! {
}; };
} }
#[derive(PartialEq, Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub enum PrefValue { pub enum PrefValue {
Boolean(bool), Boolean(bool),
String(String), String(String),

View file

@ -40,7 +40,7 @@ pub struct DevtoolsPageInfo {
pub url: ServoUrl, pub url: ServoUrl,
} }
#[derive(Debug, Deserialize, HeapSizeOf, Serialize, Clone)] #[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
pub struct CSSError { pub struct CSSError {
pub filename: String, pub filename: String,
pub line: u32, pub line: u32,
@ -144,7 +144,7 @@ pub struct TimelineMarker {
pub end_stack: Option<Vec<()>>, pub end_stack: Option<Vec<()>>,
} }
#[derive(Debug, PartialEq, Eq, Hash, Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
pub enum TimelineMarkerType { pub enum TimelineMarkerType {
Reflow, Reflow,
DOMEvent, DOMEvent,
@ -223,7 +223,7 @@ pub struct Modification {
pub newValue: Option<String>, pub newValue: Option<String>,
} }
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum LogLevel { pub enum LogLevel {
Log, Log,
Debug, Debug,
@ -232,7 +232,7 @@ pub enum LogLevel {
Error, Error,
} }
#[derive(Debug, Clone, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ConsoleMessage { pub struct ConsoleMessage {
pub message: String, pub message: String,
pub logLevel: LogLevel, pub logLevel: LogLevel,
@ -342,7 +342,7 @@ impl StartedTimelineMarker {
/// library, which definitely can't have any dependencies on `serde`. But `serde` can't implement /// 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 /// `Deserialize` and `Serialize` itself, because `time::PreciseTime` is opaque! A Catch-22. So I'm
/// duplicating the definition here. /// duplicating the definition here.
#[derive(Debug, Copy, Clone, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub struct PreciseTime(u64); pub struct PreciseTime(u64);
impl PreciseTime { 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); pub struct WorkerId(pub u32);

View file

@ -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. /// items that involve a blur. This ensures that the display item boundaries include all the ink.
pub static BLUR_INFLATION_FACTOR: i32 = 3; pub static BLUR_INFLATION_FACTOR: i32 = 3;
#[derive(HeapSizeOf, Deserialize, Serialize)] #[derive(Deserialize, HeapSizeOf, Serialize)]
pub struct DisplayList { pub struct DisplayList {
pub list: Vec<DisplayItem>, pub list: Vec<DisplayItem>,
} }
@ -401,7 +401,7 @@ pub enum StackingContextType {
PseudoFloat, 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. /// Represents one CSS stacking context, which may or may not have a hardware layer.
pub struct StackingContext { pub struct StackingContext {
/// The ID of this StackingContext for uniquely identifying it. /// 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 { pub enum ScrollRootType {
ScrollFrame(ScrollSensitivity), ScrollFrame(ScrollSensitivity),
Clip, Clip,
} }
/// Defines a stacking context. /// Defines a stacking context.
#[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
pub struct ScrollRoot { pub struct ScrollRoot {
/// The WebRender clip id of this scroll root based on the source of this clip /// The WebRender clip id of this scroll root based on the source of this clip
/// and information about the fragment. /// and information about the fragment.
@ -671,7 +671,7 @@ impl BaseDisplayItem {
/// A clipping region for a display item. Currently, this can describe rectangles, rounded /// 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 /// 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. /// 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 { pub struct ClippingRegion {
/// The main rectangular region. This does not include any corners. /// The main rectangular region. This does not include any corners.
pub main: Rect<Au>, pub main: Rect<Au>,
@ -685,7 +685,7 @@ pub struct ClippingRegion {
/// A complex clipping region. These don't as easily admit arbitrary intersection operations, so /// 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 /// 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. /// 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 { pub struct ComplexClippingRegion {
/// The boundaries of the rectangle. /// The boundaries of the rectangle.
pub rect: Rect<Au>, pub rect: Rect<Au>,
@ -855,7 +855,7 @@ impl ComplexClippingRegion {
/// Metadata attached to each display item. This is useful for performing auxiliary threads with /// 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 /// the display list involving hit testing: finding the originating DOM node and determining the
/// cursor to use when the element is hovered over. /// cursor to use when the element is hovered over.
#[derive(Clone, Copy, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
pub struct DisplayItemMetadata { pub struct DisplayItemMetadata {
/// The DOM node from which this display item originated. /// The DOM node from which this display item originated.
pub node: OpaqueNode, pub node: OpaqueNode,
@ -865,7 +865,7 @@ pub struct DisplayItemMetadata {
} }
/// Paints a solid color. /// Paints a solid color.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct SolidColorDisplayItem { pub struct SolidColorDisplayItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -875,7 +875,7 @@ pub struct SolidColorDisplayItem {
} }
/// Paints text. /// Paints text.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct TextDisplayItem { pub struct TextDisplayItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -897,7 +897,7 @@ pub struct TextDisplayItem {
pub orientation: TextOrientation, pub orientation: TextOrientation,
} }
#[derive(Clone, Eq, PartialEq, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
pub enum TextOrientation { pub enum TextOrientation {
Upright, Upright,
SidewaysLeft, SidewaysLeft,
@ -905,7 +905,7 @@ pub enum TextOrientation {
} }
/// Paints an image. /// Paints an image.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct ImageDisplayItem { pub struct ImageDisplayItem {
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -928,7 +928,7 @@ pub struct ImageDisplayItem {
pub image_rendering: image_rendering::T, pub image_rendering: image_rendering::T,
} }
/// Paints an iframe. /// Paints an iframe.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct IframeDisplayItem { pub struct IframeDisplayItem {
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
pub iframe: PipelineId, pub iframe: PipelineId,
@ -985,7 +985,7 @@ pub struct RadialGradientDisplayItem {
} }
/// A normal border, supporting CSS border styles. /// A normal border, supporting CSS border styles.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct NormalBorder { pub struct NormalBorder {
/// Border colors. /// Border colors.
pub color: SideOffsets2D<ColorF>, pub color: SideOffsets2D<ColorF>,
@ -1000,7 +1000,7 @@ pub struct NormalBorder {
} }
/// A border that is made of image segments. /// A border that is made of image segments.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct ImageBorder { pub struct ImageBorder {
/// The image this border uses, border-image-source. /// The image this border uses, border-image-source.
pub image: WebRenderImageInfo, pub image: WebRenderImageInfo,
@ -1022,7 +1022,7 @@ pub struct ImageBorder {
} }
/// A border that is made of linear gradient /// A border that is made of linear gradient
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct GradientBorder { pub struct GradientBorder {
/// The gradient info that this border uses, border-image-source. /// The gradient info that this border uses, border-image-source.
pub gradient: Gradient, pub gradient: Gradient,
@ -1032,7 +1032,7 @@ pub struct GradientBorder {
} }
/// A border that is made of radial gradient /// A border that is made of radial gradient
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct RadialGradientBorder { pub struct RadialGradientBorder {
/// The gradient info that this border uses, border-image-source. /// The gradient info that this border uses, border-image-source.
pub gradient: RadialGradient, pub gradient: RadialGradient,
@ -1042,7 +1042,7 @@ pub struct RadialGradientBorder {
} }
/// Specifies the type of border /// Specifies the type of border
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub enum BorderDetails { pub enum BorderDetails {
Normal(NormalBorder), Normal(NormalBorder),
Image(ImageBorder), Image(ImageBorder),
@ -1051,7 +1051,7 @@ pub enum BorderDetails {
} }
/// Paints a border. /// Paints a border.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct BorderDisplayItem { pub struct BorderDisplayItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -1066,7 +1066,7 @@ pub struct BorderDisplayItem {
/// Information about the border radii. /// Information about the border radii.
/// ///
/// TODO(pcwalton): Elliptical radii. /// TODO(pcwalton): Elliptical radii.
#[derive(Clone, PartialEq, Debug, Copy, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
pub struct BorderRadii<T> { pub struct BorderRadii<T> {
pub top_left: Size2D<T>, pub top_left: Size2D<T>,
pub top_right: Size2D<T>, pub top_right: Size2D<T>,
@ -1128,7 +1128,7 @@ impl<T> BorderRadii<T> where T: PartialEq + Zero + Clone {
} }
/// Paints a line segment. /// Paints a line segment.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct LineDisplayItem { pub struct LineDisplayItem {
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -1141,7 +1141,7 @@ pub struct LineDisplayItem {
} }
/// Paints a box shadow per CSS-BACKGROUNDS. /// Paints a box shadow per CSS-BACKGROUNDS.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct BoxShadowDisplayItem { pub struct BoxShadowDisplayItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -1171,7 +1171,7 @@ pub struct BoxShadowDisplayItem {
} }
/// Defines a text shadow that affects all items until the paired PopTextShadow. /// 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 { pub struct PushTextShadowDisplayItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -1187,14 +1187,14 @@ pub struct PushTextShadowDisplayItem {
} }
/// Defines a text shadow that affects all items until the next PopTextShadow. /// 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 { pub struct PopTextShadowDisplayItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
} }
/// Defines a stacking context. /// Defines a stacking context.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct PushStackingContextItem { pub struct PushStackingContextItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -1203,7 +1203,7 @@ pub struct PushStackingContextItem {
} }
/// Defines a stacking context. /// Defines a stacking context.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct PopStackingContextItem { pub struct PopStackingContextItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -1212,7 +1212,7 @@ pub struct PopStackingContextItem {
} }
/// Starts a group of items inside a particular scroll root. /// Starts a group of items inside a particular scroll root.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct DefineClipItem { pub struct DefineClipItem {
/// Fields common to all display items. /// Fields common to all display items.
pub base: BaseDisplayItem, pub base: BaseDisplayItem,
@ -1222,7 +1222,7 @@ pub struct DefineClipItem {
} }
/// How a box shadow should be clipped. /// 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 { pub enum BoxShadowClipMode {
/// No special clipping should occur. This is used for (shadowed) text decorations. /// No special clipping should occur. This is used for (shadowed) text decorations.
None, 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 struct WebRenderImageInfo {
pub width: u32, pub width: u32,
pub height: u32, pub height: u32,

View file

@ -154,7 +154,7 @@ bitflags! {
} }
/// Various options that control text shaping. /// Various options that control text shaping.
#[derive(Clone, Eq, PartialEq, Hash, Copy, Debug)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct ShapingOptions { pub struct ShapingOptions {
/// Spacing to add between each letter. Corresponds to the CSS 2.1 `letter-spacing` property. /// 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. /// 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. /// An entry in the shape cache.
#[derive(Clone, Eq, PartialEq, Hash, Debug)] #[derive(Clone, Debug, Eq, Hash, PartialEq)]
struct ShapeCacheEntry { struct ShapeCacheEntry {
text: String, text: String,
options: ShapingOptions, options: ShapingOptions,

View file

@ -33,7 +33,7 @@ struct FontTemplates {
templates: Vec<FontTemplate>, templates: Vec<FontTemplate>,
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
pub struct FontTemplateInfo { pub struct FontTemplateInfo {
pub font_template: Arc<FontTemplateData>, pub font_template: Arc<FontTemplateData>,
pub font_key: Option<webrender_api::FontKey>, pub font_key: Option<webrender_api::FontKey>,
@ -102,7 +102,7 @@ impl FontTemplates {
} }
/// Commands that the FontContext sends to the font cache thread. /// Commands that the FontContext sends to the font cache thread.
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
pub enum Command { pub enum Command {
GetFontTemplate(FontFamily, FontTemplateDescriptor, IpcSender<Reply>), GetFontTemplate(FontFamily, FontTemplateDescriptor, IpcSender<Reply>),
GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender<Reply>), GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender<Reply>),
@ -112,7 +112,7 @@ pub enum Command {
} }
/// Reply messages sent from the font cache thread to the FontContext caller. /// Reply messages sent from the font cache thread to the FontContext caller.
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
pub enum Reply { pub enum Reply {
GetFontTemplateReply(Option<FontTemplateInfo>), GetFontTemplateReply(Option<FontTemplateInfo>),
} }
@ -396,7 +396,7 @@ impl FontCache {
/// The public interface to the font cache thread, used exclusively by /// The public interface to the font cache thread, used exclusively by
/// the per-thread/thread FontContext structures. /// the per-thread/thread FontContext structures.
#[derive(Clone, Deserialize, Serialize, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct FontCacheThread { pub struct FontCacheThread {
chan: IpcSender<Command>, chan: IpcSender<Command>,
} }
@ -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 { pub struct LowercaseString {
inner: String, inner: String,
} }

View file

@ -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. /// 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()`. /// 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 struct FontTemplateDescriptor {
pub weight: font_weight::T, pub weight: font_weight::T,
pub stretch: font_stretch::T, pub stretch: font_stretch::T,

View file

@ -11,7 +11,7 @@ use webrender_api::NativeFontHandle;
/// The identifier is an absolute path, and the bytes /// The identifier is an absolute path, and the bytes
/// field is the loaded data that can be passed to /// field is the loaded data that can be passed to
/// freetype and azure directly. /// freetype and azure directly.
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
pub struct FontTemplateData { pub struct FontTemplateData {
pub bytes: Vec<u8>, pub bytes: Vec<u8>,
pub identifier: Atom, pub identifier: Atom,

View file

@ -24,7 +24,7 @@ use webrender_api::NativeFontHandle;
/// The identifier is a PostScript font name. The /// The identifier is a PostScript font name. The
/// CTFont object is cached here for use by the /// CTFont object is cached here for use by the
/// paint functions that create CGFont references. /// paint functions that create CGFont references.
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
pub struct FontTemplateData { pub struct FontTemplateData {
/// The `CTFont` object, if present. This is cached here so that we don't have to keep creating /// 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 /// `CTFont` instances over and over. It can always be recreated from the `identifier` and/or

View file

@ -7,7 +7,7 @@ use servo_atoms::Atom;
use std::io; use std::io;
use webrender_api::NativeFontHandle; use webrender_api::NativeFontHandle;
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
pub struct FontTemplateData { pub struct FontTemplateData {
pub bytes: Option<Vec<u8>>, pub bytes: Option<Vec<u8>>,
pub identifier: Atom, pub identifier: Atom,

View file

@ -21,7 +21,7 @@ pub use gfx_traits::ByteIndex;
/// In the uncommon case (multiple glyphs per unicode character, large glyph index/advance, or /// 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 /// glyph offsets), we pack the glyph count into GlyphEntry, and store the other glyph information
/// in DetailedGlyphStore. /// in DetailedGlyphStore.
#[derive(Clone, Debug, Copy, Deserialize, Serialize, PartialEq)] #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub struct GlyphEntry { pub struct GlyphEntry {
value: u32, value: u32,
} }
@ -147,7 +147,7 @@ impl GlyphEntry {
// Stores data for a detailed glyph, in the case that several glyphs // 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. // 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 { struct DetailedGlyph {
id: GlyphId, id: GlyphId,
// glyph's advance, in the text's direction (LTR or RTL) // 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 { struct DetailedGlyphRecord {
// source string offset/GlyphEntry offset in the TextRun // source string offset/GlyphEntry offset in the TextRun
entry_offset: ByteIndex, entry_offset: ByteIndex,
@ -308,7 +308,7 @@ impl<'a> DetailedGlyphStore {
// This struct is used by GlyphStore clients to provide new glyph data. // 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. // It should be allocated on the stack and passed by reference to GlyphStore.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct GlyphData { pub struct GlyphData {
id: GlyphId, id: GlyphId,
advance: Au, advance: Au,
@ -339,7 +339,7 @@ impl GlyphData {
// through glyphs (either for a particular TextRun offset, or all glyphs). // through glyphs (either for a particular TextRun offset, or all glyphs).
// Rather than eagerly assembling and copying glyph data, it only retrieves // Rather than eagerly assembling and copying glyph data, it only retrieves
// values as they are needed from the GlyphStore, using provided offsets. // values as they are needed from the GlyphStore, using provided offsets.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub enum GlyphInfo<'a> { pub enum GlyphInfo<'a> {
Simple(&'a GlyphStore, ByteIndex), Simple(&'a GlyphStore, ByteIndex),
Detail(&'a GlyphStore, ByteIndex, u16), Detail(&'a GlyphStore, ByteIndex, u16),

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * 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 { pub enum CompressionMode {
CompressNone, CompressNone,
CompressWhitespace, CompressWhitespace,

View file

@ -18,7 +18,7 @@ use range::RangeIndex;
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering}; use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
/// A newtype struct for denoting the age of messages; prevents race conditions. /// 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); pub struct Epoch(pub u32);
impl Epoch { 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 /// 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 /// into the lower 2 bits of the `StackingContextId`, which otherwise contains a 32-bit-aligned
/// heap address. /// 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 { pub enum FragmentType {
/// A StackingContext for the fragment body itself. /// A StackingContext for the fragment body itself.
FragmentBody, FragmentBody,

View file

@ -86,7 +86,7 @@ impl FloatedBlockInfo {
} }
/// The solutions for the block-size-and-margins constraint equation. /// The solutions for the block-size-and-margins constraint equation.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
struct BSizeConstraintSolution { struct BSizeConstraintSolution {
block_start: Au, block_start: Au,
block_size: Au, block_size: Au,
@ -2196,7 +2196,7 @@ impl fmt::Debug for BlockFlow {
} }
/// The inputs for the inline-sizes-and-margins constraint equation. /// The inputs for the inline-sizes-and-margins constraint equation.
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct ISizeConstraintInput { pub struct ISizeConstraintInput {
pub computed_inline_size: MaybeAuto, pub computed_inline_size: MaybeAuto,
pub inline_start_margin: MaybeAuto, pub inline_start_margin: MaybeAuto,
@ -2229,7 +2229,7 @@ impl ISizeConstraintInput {
} }
/// The solutions for the inline-size-and-margins constraint equation. /// The solutions for the inline-size-and-margins constraint equation.
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
pub struct ISizeConstraintSolution { pub struct ISizeConstraintSolution {
pub inline_start: Au, pub inline_start: Au,
pub inline_size: 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. /// A stacking context, a pseudo-stacking context, or a non-stacking context.
#[derive(Copy, Clone, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum BlockStackingContextType { pub enum BlockStackingContextType {
NonstackingContext, NonstackingContext,
PseudoStackingContext, PseudoStackingContext,

View file

@ -2915,7 +2915,7 @@ impl ComputedValuesCursorUtility for ComputedValues {
} }
// A helper data structure for gradients. // A helper data structure for gradients.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
struct StopRun { struct StopRun {
start_offset: f32, start_offset: f32,
end_offset: f32, end_offset: f32,
@ -2953,7 +2953,7 @@ impl ToGfxColor for RGBA {
} }
/// Describes how to paint the borders. /// Describes how to paint the borders.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub enum BorderPaintingMode<'a> { pub enum BorderPaintingMode<'a> {
/// Paint borders separately (`border-collapse: separate`). /// Paint borders separately (`border-collapse: separate`).
Separate, Separate,
@ -2963,7 +2963,7 @@ pub enum BorderPaintingMode<'a> {
Hidden, Hidden,
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum StackingContextCreationMode { pub enum StackingContextCreationMode {
Normal, Normal,
PseudoPositioned, PseudoPositioned,

View file

@ -13,7 +13,7 @@ use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use style::values::computed::LengthOrPercentageOrAuto; use style::values::computed::LengthOrPercentageOrAuto;
/// The kind of float: left or right. /// The kind of float: left or right.
#[derive(Clone, Serialize, Debug, Copy)] #[derive(Clone, Copy, Debug, Serialize)]
pub enum FloatKind { pub enum FloatKind {
Left, Left,
Right Right
@ -30,7 +30,7 @@ impl FloatKind {
} }
/// The kind of clearance: left, right, or both. /// The kind of clearance: left, right, or both.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub enum ClearType { pub enum ClearType {
Left, Left,
Right, Right,
@ -431,7 +431,7 @@ impl Floats {
/// This is used for two purposes: (a) determining whether we can lay out blocks in parallel; (b) /// 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 /// guessing the inline-sizes of block formatting contexts in an effort to lay them out in
/// parallel. /// parallel.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct SpeculatedFloatPlacement { pub struct SpeculatedFloatPlacement {
/// The estimated inline size (an upper bound) of the left floats flowing through this flow. /// The estimated inline size (an upper bound) of the left floats flowing through this flow.
pub left: Au, pub left: Au,

View file

@ -559,7 +559,7 @@ pub trait MutableOwnedFlowUtils {
absolute_descendants: &mut AbsoluteDescendants); absolute_descendants: &mut AbsoluteDescendants);
} }
#[derive(Copy, Clone, Serialize, PartialEq, Debug)] #[derive(Clone, Copy, Debug, PartialEq, Serialize)]
pub enum FlowClass { pub enum FlowClass {
Block, Block,
Inline, Inline,
@ -771,7 +771,7 @@ pub type AbsoluteDescendantOffsetIter<'a> = Zip<AbsoluteDescendantIter<'a>, Iter
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be /// 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. /// confused with absolutely-positioned flows) that is computed during block-size assignment.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct EarlyAbsolutePositionInfo { pub struct EarlyAbsolutePositionInfo {
/// The size of the containing block for relatively-positioned descendants. /// The size of the containing block for relatively-positioned descendants.
pub relative_containing_block_size: LogicalSize<Au>, pub relative_containing_block_size: LogicalSize<Au>,
@ -793,7 +793,7 @@ impl EarlyAbsolutePositionInfo {
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be /// 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. /// confused with absolutely-positioned flows) that is computed during final position assignment.
#[derive(Serialize, Copy, Clone)] #[derive(Clone, Copy, Serialize)]
pub struct LateAbsolutePositionInfo { pub struct LateAbsolutePositionInfo {
/// The position of the absolute containing block relative to the nearest ancestor stacking /// 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, /// 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 struct FragmentationContext {
pub available_block_size: Au, pub available_block_size: Au,
pub this_fragment_is_empty: bool, 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 /// 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. /// 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); pub struct OpaqueFlow(pub usize);
impl OpaqueFlow { impl OpaqueFlow {

View file

@ -13,7 +13,7 @@ use flow::Flow;
use std::ops::Deref; use std::ops::Deref;
use std::sync::{Arc, Weak}; use std::sync::{Arc, Weak};
#[derive(Clone,Debug)] #[derive(Clone, Debug)]
pub struct FlowRef(Arc<Flow>); pub struct FlowRef(Arc<Flow>);
impl Deref for FlowRef { impl Deref for FlowRef {
@ -55,7 +55,7 @@ impl FlowRef {
} }
} }
#[derive(Clone,Debug)] #[derive(Clone, Debug)]
pub struct WeakFlowRef(Weak<Flow>); pub struct WeakFlowRef(Weak<Flow>);
impl WeakFlowRef { impl WeakFlowRef {

View file

@ -574,7 +574,7 @@ impl ScannedTextFragmentInfo {
/// Describes how to split a fragment. This is used during line breaking as part of the return /// 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()`. /// value of `find_split_info_for_inline_size()`.
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct SplitInfo { pub struct SplitInfo {
// TODO(bjz): this should only need to be a single character index, but both values are // 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. // currently needed for splitting in the `inline::try_append_*` functions.
@ -633,7 +633,7 @@ impl UnscannedTextFragmentInfo {
} }
/// A fragment that represents a table column. /// A fragment that represents a table column.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct TableColumnFragmentInfo { pub struct TableColumnFragmentInfo {
/// the number of columns a <col> element should span /// the number of columns a <col> element should span
pub span: u32, pub span: u32,
@ -3049,7 +3049,7 @@ pub trait FragmentBorderBoxIterator {
/// The coordinate system used in `stacking_relative_border_box()`. See the documentation of that /// The coordinate system used in `stacking_relative_border_box()`. See the documentation of that
/// method for details. /// method for details.
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, Debug, PartialEq)]
pub enum CoordinateSystem { pub enum CoordinateSystem {
/// The border box returned is relative to the fragment's parent stacking context. /// The border box returned is relative to the fragment's parent stacking context.
Parent, Parent,
@ -3094,7 +3094,7 @@ impl<'a> InlineStyleIterator<'a> {
} }
} }
#[derive(Copy, Clone, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
pub enum WhitespaceStrippingResult { pub enum WhitespaceStrippingResult {
RetainFragment, RetainFragment,
FragmentContainedOnlyBidiControlCharacters, FragmentContainedOnlyBidiControlCharacters,
@ -3116,7 +3116,7 @@ impl WhitespaceStrippingResult {
/// The overflow area. We need two different notions of overflow: paint overflow and scrollable /// The overflow area. We need two different notions of overflow: paint overflow and scrollable
/// overflow. /// overflow.
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
pub struct Overflow { pub struct Overflow {
pub scroll: Rect<Au>, pub scroll: Rect<Au>,
pub paint: Rect<Au>, pub paint: Rect<Au>,
@ -3163,7 +3163,7 @@ bitflags! {
/// Specified distances from the margin edge of a block to its content in the inline direction. /// 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 /// These are returned by `guess_inline_content_edge_offsets()` and are used in the float placement
/// speculation logic. /// speculation logic.
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
pub struct SpeculatedInlineContentEdgeOffsets { pub struct SpeculatedInlineContentEdgeOffsets {
pub start: Au, pub start: Au,
pub end: Au, pub end: Au,

View file

@ -63,7 +63,7 @@ use unicode_bidi as bidi;
/// with a float or a horizontal wall of the containing block. The block-start /// 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 /// 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. /// the green zone can be taller and wider than the line itself.
#[derive(Serialize, Debug, Clone)] #[derive(Clone, Debug, Serialize)]
pub struct Line { pub struct Line {
/// A range of line indices that describe line breaks. /// A range of line indices that describe line breaks.
/// ///
@ -823,7 +823,7 @@ impl LineBreaker {
} }
/// Represents a list of inline fragments, including element ranges. /// Represents a list of inline fragments, including element ranges.
#[derive(Serialize, Clone)] #[derive(Clone, Serialize)]
pub struct InlineFragments { pub struct InlineFragments {
/// The fragments themselves. /// The fragments themselves.
pub fragments: Vec<Fragment>, pub fragments: Vec<Fragment>,
@ -1864,13 +1864,13 @@ impl InlineMetrics {
} }
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Clone, Copy, PartialEq)]
enum LineFlushMode { enum LineFlushMode {
No, No,
Flush, Flush,
} }
#[derive(Copy, Clone, Debug, Serialize)] #[derive(Clone, Copy, Debug, Serialize)]
pub struct LineMetrics { pub struct LineMetrics {
pub space_above_baseline: Au, pub space_above_baseline: Au,
pub space_below_baseline: Au, pub space_below_baseline: Au,

View file

@ -18,7 +18,7 @@ use style::values::computed::{BorderCornerRadius, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone};
/// A collapsible margin. See CSS 2.1 § 8.3.1. /// A collapsible margin. See CSS 2.1 § 8.3.1.
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
pub struct AdjoiningMargins { pub struct AdjoiningMargins {
/// The value of the greatest positive margin. /// The value of the greatest positive margin.
pub most_positive: Au, 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. /// 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 { pub enum CollapsibleMargins {
/// Margins may not collapse with this flow. /// Margins may not collapse with this flow.
None(Au, Au), None(Au, Au),
@ -295,7 +295,7 @@ impl MarginCollapseInfo {
} }
} }
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
pub enum MarginCollapseState { pub enum MarginCollapseState {
/// We are accumulating margin on the logical top of this flow. /// We are accumulating margin on the logical top of this flow.
AccumulatingCollapsibleTopMargin, AccumulatingCollapsibleTopMargin,
@ -304,7 +304,7 @@ pub enum MarginCollapseState {
} }
/// Intrinsic inline-sizes, which consist of minimum and preferred. /// Intrinsic inline-sizes, which consist of minimum and preferred.
#[derive(Serialize, Copy, Clone)] #[derive(Clone, Copy, Serialize)]
pub struct IntrinsicISizes { pub struct IntrinsicISizes {
/// The *minimum inline-size* of the content. /// The *minimum inline-size* of the content.
pub minimum_inline_size: Au, pub minimum_inline_size: Au,
@ -395,7 +395,7 @@ impl IntrinsicISizesContribution {
} }
/// Useful helper data type when computing values for blocks and positioned elements. /// 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 { pub enum MaybeAuto {
Auto, Auto,
Specified(Au), Specified(Au),

View file

@ -588,7 +588,7 @@ impl ISizeAndMarginsComputer for InternalTable {
/// maximum of 100 pixels and 20% of the table), the preceding constraint means that we must /// 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 /// 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. /// assignment phase of layout will know which one to pick.
#[derive(Clone, Serialize, Debug, Copy)] #[derive(Clone, Copy, Debug, Serialize)]
pub struct ColumnIntrinsicInlineSize { pub struct ColumnIntrinsicInlineSize {
/// The preferred intrinsic inline size. /// The preferred intrinsic inline size.
pub preferred: Au, pub preferred: Au,
@ -625,7 +625,7 @@ impl ColumnIntrinsicInlineSize {
/// ///
/// TODO(pcwalton): There will probably be some `border-collapse`-related info in here too /// TODO(pcwalton): There will probably be some `border-collapse`-related info in here too
/// eventually. /// eventually.
#[derive(Serialize, Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, Serialize)]
pub struct ColumnComputedInlineSize { pub struct ColumnComputedInlineSize {
/// The computed size of this inline column. /// The computed size of this inline column.
pub size: Au, pub size: Au,

View file

@ -305,7 +305,7 @@ impl fmt::Debug for TableCellFlow {
} }
} }
#[derive(Copy, Clone, Debug, Serialize)] #[derive(Clone, Copy, Debug, Serialize)]
pub struct CollapsedBordersForCell { pub struct CollapsedBordersForCell {
pub inline_start_border: CollapsedBorder, pub inline_start_border: CollapsedBorder,
pub inline_end_border: CollapsedBorder, pub inline_end_border: CollapsedBorder,

View file

@ -73,7 +73,7 @@ impl Serialize for TableRowFlow {
} }
/// Information about the column inline size and span for each cell. /// Information about the column inline size and span for each cell.
#[derive(Serialize, Copy, Clone)] #[derive(Clone, Copy, Serialize)]
pub struct CellIntrinsicInlineSize { pub struct CellIntrinsicInlineSize {
/// Inline sizes that this cell contributes to the column. /// Inline sizes that this cell contributes to the column.
pub column_size: ColumnIntrinsicInlineSize, 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. /// 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 { pub struct CollapsedBorder {
/// The style of the border. /// The style of the border.
pub style: border_top_style::T, pub style: border_top_style::T,
@ -596,7 +596,7 @@ impl Serialize for CollapsedBorder {
// FIXME(#8586): FromTableRow, FromTableRowGroup, FromTableColumn, // FIXME(#8586): FromTableRow, FromTableRowGroup, FromTableColumn,
// FromTableColumnGroup are unused // FromTableColumnGroup are unused
#[allow(dead_code)] #[allow(dead_code)]
#[derive(Copy, Clone, Debug, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Serialize)]
pub enum CollapsedBorderProvenance { pub enum CollapsedBorderProvenance {
FromPreviousTableCell = 6, FromPreviousTableCell = 6,
FromNextTableCell = 5, FromNextTableCell = 5,
@ -906,7 +906,7 @@ fn set_inline_position_of_child_flow(
} }
} }
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct BorderCollapseInfoForChildTableCell<'a> { pub struct BorderCollapseInfoForChildTableCell<'a> {
collapsed_borders_for_row: &'a CollapsedBordersForRow, collapsed_borders_for_row: &'a CollapsedBordersForRow,
collapsed_border_spacing_for_row: &'a CollapsedBorderSpacingForRow, collapsed_border_spacing_for_row: &'a CollapsedBorderSpacingForRow,

View file

@ -35,7 +35,7 @@ use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto; use style::values::computed::LengthOrPercentageOrAuto;
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize}; use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
#[derive(Copy, Clone, Serialize, Debug)] #[derive(Clone, Copy, Debug, Serialize)]
pub enum TableLayout { pub enum TableLayout {
Fixed, Fixed,
Auto 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 /// The `CSSFloat` member specifies the weight of the smaller of the two guesses, on a scale from
/// 0.0 to 1.0. /// 0.0 to 1.0.
#[derive(Copy, Clone, PartialEq, Debug)] #[derive(Clone, Copy, Debug, PartialEq)]
enum SelectedAutoLayoutCandidateGuess { enum SelectedAutoLayoutCandidateGuess {
UseMinimumGuess, UseMinimumGuess,
InterpolateBetweenMinimumGuessAndMinimumPercentageGuess(CSSFloat), InterpolateBetweenMinimumGuessAndMinimumPercentageGuess(CSSFloat),

View file

@ -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 /// A mapping from a portion of an unscanned text fragment to the text run we're going to create
/// for it. /// for it.
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
struct RunMapping { struct RunMapping {
/// The range of byte indices within the text fragment. /// The range of byte indices within the text fragment.
byte_range: Range<usize>, byte_range: Range<usize>,

View file

@ -243,7 +243,7 @@ impl<'a> PostorderFlowTraversal for BubbleISizes<'a> {
} }
/// The assign-inline-sizes traversal. In Gecko this corresponds to `Reflow`. /// The assign-inline-sizes traversal. In Gecko this corresponds to `Reflow`.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct AssignISizes<'a> { pub struct AssignISizes<'a> {
pub layout_context: &'a LayoutContext<'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 /// 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 /// layout computation. Determines the final block-sizes for all layout objects and computes
/// positions. In Gecko this corresponds to `Reflow`. /// positions. In Gecko this corresponds to `Reflow`.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct AssignBSizes<'a> { pub struct AssignBSizes<'a> {
pub layout_context: &'a LayoutContext<'a>, pub layout_context: &'a LayoutContext<'a>,
} }

View file

@ -85,7 +85,7 @@ pub unsafe fn drop_style_and_layout_data(data: OpaqueStyleAndLayoutData) {
let _ = Box::from_raw(non_opaque); let _ = Box::from_raw(non_opaque);
} }
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct ServoLayoutNode<'a> { pub struct ServoLayoutNode<'a> {
/// The wrapped node. /// The wrapped node.
node: LayoutJS<Node>, node: LayoutJS<Node>,
@ -329,7 +329,7 @@ impl<'ln> ServoLayoutNode<'ln> {
} }
// A wrapper around documents that ensures ayout can only ever access safe properties. // A wrapper around documents that ensures ayout can only ever access safe properties.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct ServoLayoutDocument<'ld> { pub struct ServoLayoutDocument<'ld> {
document: LayoutJS<Document>, document: LayoutJS<Document>,
chain: PhantomData<&'ld ()>, chain: PhantomData<&'ld ()>,
@ -374,7 +374,7 @@ impl<'ld> ServoLayoutDocument<'ld> {
} }
/// A wrapper around elements that ensures layout can only ever access safe properties. /// A wrapper around elements that ensures layout can only ever access safe properties.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct ServoLayoutElement<'le> { pub struct ServoLayoutElement<'le> {
element: LayoutJS<Element>, element: LayoutJS<Element>,
chain: PhantomData<&'le ()>, 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> { pub struct ServoThreadSafeLayoutNode<'ln> {
/// The wrapped node. /// The wrapped node.
node: ServoLayoutNode<'ln>, node: ServoLayoutNode<'ln>,
@ -1103,7 +1103,7 @@ impl<ConcreteNode> Iterator for ThreadSafeLayoutNodeChildrenIterator<ConcreteNod
/// A wrapper around elements that ensures layout can only /// A wrapper around elements that ensures layout can only
/// ever access safe properties and cannot race on elements. /// ever access safe properties and cannot race on elements.
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
pub struct ServoThreadSafeLayoutElement<'le> { pub struct ServoThreadSafeLayoutElement<'le> {
element: ServoLayoutElement<'le>, element: ServoLayoutElement<'le>,

View file

@ -9,7 +9,7 @@ use std::cell::Cell;
use std::fmt; use std::fmt;
use webrender_api; use webrender_api;
#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub enum KeyState { pub enum KeyState {
Pressed, Pressed,
Released, Released,
@ -17,7 +17,7 @@ pub enum KeyState {
} }
//N.B. Based on the glutin key enum //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 { pub enum Key {
Space, Space,
Apostrophe, 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 { pub enum TraversalDirection {
Forward(usize), Forward(usize),
Back(usize), Back(usize),
@ -217,13 +217,13 @@ impl PipelineNamespace {
thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = Cell::new(None)); thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = Cell::new(None));
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
pub struct PipelineNamespaceId(pub u32); 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); 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 struct PipelineId {
pub namespace_id: PipelineNamespaceId, pub namespace_id: PipelineNamespaceId,
pub index: PipelineIndex 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); 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 struct BrowsingContextId {
pub namespace_id: PipelineNamespaceId, pub namespace_id: PipelineNamespaceId,
pub index: BrowsingContextIndex pub index: BrowsingContextIndex
@ -292,7 +292,7 @@ impl fmt::Display for BrowsingContextId {
thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrowsingContextId>> = Cell::new(None)); thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrowsingContextId>> = Cell::new(None));
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
pub struct TopLevelBrowsingContextId(BrowsingContextId); pub struct TopLevelBrowsingContextId(BrowsingContextId);
impl TopLevelBrowsingContextId { impl TopLevelBrowsingContextId {
@ -342,7 +342,7 @@ pub const TEST_BROWSING_CONTEXT_INDEX: BrowsingContextIndex = BrowsingContextInd
pub const TEST_BROWSING_CONTEXT_ID: BrowsingContextId = pub const TEST_BROWSING_CONTEXT_ID: BrowsingContextId =
BrowsingContextId { namespace_id: TEST_NAMESPACE, index: TEST_BROWSING_CONTEXT_INDEX }; 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 { pub enum FrameType {
IFrame, IFrame,
MozBrowserIFrame, MozBrowserIFrame,

View file

@ -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) /// 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`. /// is sufficient since a valid header implies that we use `nosniff`.
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
struct XContentTypeOptions; struct XContentTypeOptions;
impl Header for XContentTypeOptions { impl Header for XContentTypeOptions {

View file

@ -9,7 +9,7 @@ use url::Url;
use uuid::Uuid; use uuid::Uuid;
/// Errors returned to Blob URL Store request /// Errors returned to Blob URL Store request
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub enum BlobURLStoreError { pub enum BlobURLStoreError {
/// Invalid File UUID /// Invalid File UUID
InvalidFileID, InvalidFileID,
@ -22,7 +22,7 @@ pub enum BlobURLStoreError {
} }
/// Standalone blob buffer object /// Standalone blob buffer object
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct BlobBuf { pub struct BlobBuf {
pub filename: Option<String>, pub filename: Option<String>,
/// MIME type string /// MIME type string

View file

@ -7,7 +7,7 @@ use piston_image::{self, DynamicImage, ImageFormat};
use std::fmt; use std::fmt;
use webrender_api; use webrender_api;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
pub enum PixelFormat { pub enum PixelFormat {
/// Luminance channel only /// Luminance channel only
K8, K8,
@ -19,7 +19,7 @@ pub enum PixelFormat {
BGRA8, BGRA8,
} }
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct Image { pub struct Image {
pub width: u32, pub width: u32,
pub height: 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 struct ImageMetadata {
pub width: u32, pub width: u32,
pub height: u32, pub height: u32,

View file

@ -16,14 +16,14 @@ use webrender_api;
/// Whether a consumer is in a position to request images or not. This can occur /// 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 /// when animations are being processed by the layout thread while the script
/// thread is executing in parallel. /// thread is executing in parallel.
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)] #[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
pub enum CanRequestImages { pub enum CanRequestImages {
No, No,
Yes, Yes,
} }
/// Indicating either entire image or just metadata availability /// Indicating either entire image or just metadata availability
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub enum ImageOrMetadataAvailable { pub enum ImageOrMetadataAvailable {
ImageAvailable(Arc<Image>, ServoUrl), ImageAvailable(Arc<Image>, ServoUrl),
MetadataAvailable(ImageMetadata), MetadataAvailable(ImageMetadata),
@ -60,7 +60,7 @@ impl ImageResponder {
} }
/// The returned image. /// The returned image.
#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
pub enum ImageResponse { pub enum ImageResponse {
/// The requested image was loaded. /// The requested image was loaded.
Loaded(Arc<Image>, ServoUrl), Loaded(Arc<Image>, ServoUrl),
@ -73,7 +73,7 @@ pub enum ImageResponse {
} }
/// The current state of an image in the cache. /// The current state of an image in the cache.
#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)] #[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
pub enum ImageState { pub enum ImageState {
Pending(PendingImageId), Pending(PendingImageId),
LoadError, LoadError,
@ -81,7 +81,7 @@ pub enum ImageState {
} }
/// The unique id for an image that has previously been requested. /// 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); pub struct PendingImageId(pub u64);
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
@ -90,7 +90,7 @@ pub struct PendingImageResponse {
pub id: PendingImageId, pub id: PendingImageId,
} }
#[derive(Copy, Clone, PartialEq, Hash, Eq, Deserialize, Serialize)] #[derive(Clone, Copy, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum UsePlaceholder { pub enum UsePlaceholder {
No, No,
Yes, Yes,

View file

@ -62,7 +62,7 @@ pub mod image {
/// A loading context, for context-specific sniffing, as defined in /// A loading context, for context-specific sniffing, as defined in
/// https://mimesniff.spec.whatwg.org/#context-specific-sniffing /// https://mimesniff.spec.whatwg.org/#context-specific-sniffing
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub enum LoadContext { pub enum LoadContext {
Browsing, Browsing,
Image, Image,
@ -75,7 +75,7 @@ pub enum LoadContext {
CacheManifest, CacheManifest,
} }
#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
pub struct CustomResponse { pub struct CustomResponse {
#[ignore_heap_size_of = "Defined in hyper"] #[ignore_heap_size_of = "Defined in hyper"]
#[serde(deserialize_with = "::hyper_serde::deserialize", #[serde(deserialize_with = "::hyper_serde::deserialize",
@ -185,7 +185,7 @@ pub trait FetchTaskTarget {
fn process_response_eof(&mut self, response: &Response); fn process_response_eof(&mut self, response: &Response);
} }
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Deserialize, Serialize)]
pub enum FilteredMetadata { pub enum FilteredMetadata {
Basic(Metadata), Basic(Metadata),
Cors(Metadata), Cors(Metadata),
@ -193,7 +193,7 @@ pub enum FilteredMetadata {
OpaqueRedirect OpaqueRedirect
} }
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Deserialize, Serialize)]
pub enum FetchMetadata { pub enum FetchMetadata {
Unfiltered(Metadata), Unfiltered(Metadata),
Filtered { Filtered {
@ -276,7 +276,7 @@ pub trait IpcSend<T>
// the "Arc" hack implicitly in future. // 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 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 // 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 { pub struct ResourceThreads {
core_thread: CoreResourceThread, core_thread: CoreResourceThread,
storage_thread: IpcSender<StorageThreadMsg>, storage_thread: IpcSender<StorageThreadMsg>,
@ -318,13 +318,13 @@ impl HeapSizeOf for ResourceThreads {
} }
} }
#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)] #[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
pub enum IncludeSubdomains { pub enum IncludeSubdomains {
Included, Included,
NotIncluded, NotIncluded,
} }
#[derive(HeapSizeOf, Deserialize, Serialize)] #[derive(Deserialize, HeapSizeOf, Serialize)]
pub enum MessageData { pub enum MessageData {
Text(String), Text(String),
Binary(Vec<u8>), Binary(Vec<u8>),
@ -397,7 +397,7 @@ pub fn fetch_async<F>(request: RequestInit, core_resource_thread: &CoreResourceT
core_resource_thread.send(CoreResourceMsg::Fetch(request, action_sender)).unwrap(); core_resource_thread.send(CoreResourceMsg::Fetch(request, action_sender)).unwrap();
} }
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct ResourceCorsData { pub struct ResourceCorsData {
/// CORS Preflight flag /// CORS Preflight flag
pub preflight: bool, pub preflight: bool,
@ -406,7 +406,7 @@ pub struct ResourceCorsData {
} }
/// Metadata about a loaded resource, such as is obtained from HTTP headers. /// 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 { pub struct Metadata {
/// Final URL after redirects. /// Final URL after redirects.
pub final_url: ServoUrl, pub final_url: ServoUrl,
@ -475,7 +475,7 @@ impl Metadata {
} }
/// The creator of a given cookie /// The creator of a given cookie
#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)] #[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
pub enum CookieSource { pub enum CookieSource {
/// An HTTP API /// An HTTP API
HTTP, 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 /// 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); pub struct ResourceId(pub u32);
/// Network errors that have to be exported out of the loaders /// 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 { pub enum NetworkError {
/// Could be any of the internal errors, like unsupported scheme, connection errors, etc. /// Could be any of the internal errors, like unsupported scheme, connection errors, etc.
Internal(String), Internal(String),

View file

@ -20,7 +20,7 @@ use std::collections::HashSet;
use std::iter::FromIterator; use std::iter::FromIterator;
use std::str::from_utf8; use std::str::from_utf8;
#[derive(Clone,Debug)] #[derive(Clone, Debug)]
pub struct PubDomainRules { pub struct PubDomainRules {
rules: HashSet<String>, rules: HashSet<String>,
wildcards: HashSet<String>, wildcards: HashSet<String>,

View file

@ -10,7 +10,7 @@ use servo_url::{ImmutableOrigin, ServoUrl};
use std::default::Default; use std::default::Default;
/// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator) /// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator)
#[derive(Copy, Clone, PartialEq, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum Initiator { pub enum Initiator {
None, None,
Download, Download,
@ -20,7 +20,7 @@ pub enum Initiator {
} }
/// A request [type](https://fetch.spec.whatwg.org/#concept-request-type) /// 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 { pub enum Type {
None, None,
Audio, Audio,
@ -33,7 +33,7 @@ pub enum Type {
} }
/// A request [destination](https://fetch.spec.whatwg.org/#concept-request-destination) /// 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 { pub enum Destination {
None, None,
Document, Document,
@ -53,14 +53,14 @@ pub enum Destination {
} }
/// A request [origin](https://fetch.spec.whatwg.org/#concept-request-origin) /// 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 { pub enum Origin {
Client, Client,
Origin(ImmutableOrigin), Origin(ImmutableOrigin),
} }
/// A [referer](https://fetch.spec.whatwg.org/#concept-request-referrer) /// 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 { pub enum Referrer {
NoReferrer, NoReferrer,
/// Default referrer if nothing is specified /// Default referrer if nothing is specified
@ -69,7 +69,7 @@ pub enum Referrer {
} }
/// A [request mode](https://fetch.spec.whatwg.org/#concept-request-mode) /// 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 { pub enum RequestMode {
Navigate, Navigate,
SameOrigin, SameOrigin,
@ -79,7 +79,7 @@ pub enum RequestMode {
} }
/// Request [credentials mode](https://fetch.spec.whatwg.org/#concept-request-credentials-mode) /// 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 { pub enum CredentialsMode {
Omit, Omit,
CredentialsSameOrigin, CredentialsSameOrigin,
@ -87,7 +87,7 @@ pub enum CredentialsMode {
} }
/// [Cache mode](https://fetch.spec.whatwg.org/#concept-request-cache-mode) /// [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 { pub enum CacheMode {
Default, Default,
NoStore, NoStore,
@ -98,7 +98,7 @@ pub enum CacheMode {
} }
/// [Service-workers mode](https://fetch.spec.whatwg.org/#request-service-workers-mode) /// [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 { pub enum ServiceWorkersMode {
All, All,
Foreign, Foreign,
@ -106,7 +106,7 @@ pub enum ServiceWorkersMode {
} }
/// [Redirect mode](https://fetch.spec.whatwg.org/#concept-request-redirect-mode) /// [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 { pub enum RedirectMode {
Follow, Follow,
Error, Error,
@ -114,7 +114,7 @@ pub enum RedirectMode {
} }
/// [Response tainting](https://fetch.spec.whatwg.org/#concept-request-response-tainting) /// [Response tainting](https://fetch.spec.whatwg.org/#concept-request-response-tainting)
#[derive(Copy, Clone, PartialEq, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum ResponseTainting { pub enum ResponseTainting {
Basic, Basic,
CorsTainting, CorsTainting,
@ -122,20 +122,20 @@ pub enum ResponseTainting {
} }
/// [Window](https://fetch.spec.whatwg.org/#concept-request-window) /// [Window](https://fetch.spec.whatwg.org/#concept-request-window)
#[derive(Copy, Clone, PartialEq, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum Window { pub enum Window {
NoWindow, NoWindow,
Client, // TODO: Environmental settings object Client, // TODO: Environmental settings object
} }
/// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous) /// [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 { pub enum CorsSettings {
Anonymous, Anonymous,
UseCredentials, UseCredentials,
} }
#[derive(Serialize, Deserialize, Clone, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct RequestInit { pub struct RequestInit {
#[serde(deserialize_with = "::hyper_serde::deserialize", #[serde(deserialize_with = "::hyper_serde::deserialize",
serialize_with = "::hyper_serde::serialize")] serialize_with = "::hyper_serde::serialize")]

View file

@ -13,7 +13,7 @@ use std::ascii::AsciiExt;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
/// [Response type](https://fetch.spec.whatwg.org/#concept-response-type) /// [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 { pub enum ResponseType {
Basic, Basic,
Cors, Cors,
@ -24,7 +24,7 @@ pub enum ResponseType {
} }
/// [Response termination reason](https://fetch.spec.whatwg.org/#concept-response-termination-reason) /// [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 { pub enum TerminationReason {
EndUserAbort, EndUserAbort,
Fatal, Fatal,
@ -33,7 +33,7 @@ pub enum TerminationReason {
/// The response body can still be pushed to after fetch /// The response body can still be pushed to after fetch
/// This provides a way to store unfinished response bodies /// This provides a way to store unfinished response bodies
#[derive(Clone, Debug, PartialEq, HeapSizeOf)] #[derive(Clone, Debug, HeapSizeOf, PartialEq)]
pub enum ResponseBody { pub enum ResponseBody {
Empty, // XXXManishearth is this necessary, or is Done(vec![]) enough? Empty, // XXXManishearth is this necessary, or is Done(vec![]) enough?
Receiving(Vec<u8>), Receiving(Vec<u8>),
@ -52,7 +52,7 @@ impl ResponseBody {
/// [Cache state](https://fetch.spec.whatwg.org/#concept-response-cache-state) /// [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 { pub enum CacheState {
None, None,
Local, Local,
@ -61,7 +61,7 @@ pub enum CacheState {
} }
/// [Https state](https://fetch.spec.whatwg.org/#concept-response-https-state) /// [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 { pub enum HttpsState {
None, None,
Deprecated, Deprecated,
@ -74,7 +74,7 @@ pub enum ResponseMsg {
Errored, Errored,
} }
#[derive(Serialize, Deserialize, Clone, HeapSizeOf)] #[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct ResponseInit { pub struct ResponseInit {
pub url: ServoUrl, pub url: ServoUrl,
#[serde(deserialize_with = "::hyper_serde::deserialize", #[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 /// 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 struct Response {
pub response_type: ResponseType, pub response_type: ResponseType,
pub termination_reason: Option<TerminationReason>, pub termination_reason: Option<TerminationReason>,

View file

@ -5,7 +5,7 @@
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use servo_url::ServoUrl; use servo_url::ServoUrl;
#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
pub enum StorageType { pub enum StorageType {
Session, Session,
Local, Local,

View file

@ -10,7 +10,7 @@ use self::std_time::precise_time_ns;
use servo_config::opts; use servo_config::opts;
use signpost; use signpost;
#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
pub struct TimerMetadata { pub struct TimerMetadata {
pub url: String, pub url: String,
pub iframe: TimerMetadataFrameType, pub iframe: TimerMetadataFrameType,
@ -39,7 +39,7 @@ pub enum ProfilerMsg {
} }
#[repr(u32)] #[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 { pub enum ProfilerCategory {
Compositing = 0x00, Compositing = 0x00,
LayoutPerform = 0x10, LayoutPerform = 0x10,
@ -95,13 +95,13 @@ pub enum ProfilerCategory {
ApplicationHeartbeat = 0x90, ApplicationHeartbeat = 0x90,
} }
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
pub enum TimerMetadataFrameType { pub enum TimerMetadataFrameType {
RootWindow, RootWindow,
IFrame, IFrame,
} }
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
pub enum TimerMetadataReflowType { pub enum TimerMetadataReflowType {
Incremental, Incremental,
FirstReflow, FirstReflow,

View file

@ -78,7 +78,7 @@ impl RangeIndex for usize {
#[macro_export] #[macro_export]
macro_rules! int_range_index { macro_rules! int_range_index {
($(#[$attr:meta])* struct $Self_:ident($T:ty)) => ( ($(#[$attr:meta])* struct $Self_:ident($T:ty)) => (
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Copy)] #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
$(#[$attr])* $(#[$attr])*
pub struct $Self_(pub $T); pub struct $Self_(pub $T);

View file

@ -26,7 +26,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
// TODO: can we use the thread-id crate for this? // TODO: can we use the thread-id crate for this?
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ThreadId(NonZero<usize>); pub struct ThreadId(NonZero<usize>);
lazy_static!{ static ref THREAD_COUNT: AtomicUsize = AtomicUsize::new(1); } lazy_static!{ static ref THREAD_COUNT: AtomicUsize = AtomicUsize::new(1); }

View file

@ -22,7 +22,7 @@ use std::rc::Rc;
use std::str; use std::str;
use url::form_urlencoded; use url::form_urlencoded;
#[derive(Copy, Clone, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
pub enum BodyType { pub enum BodyType {
Blob, Blob,
FormData, FormData,

View file

@ -59,7 +59,7 @@ fn main() {
write!(&mut phf, ";\n").unwrap(); write!(&mut phf, ";\n").unwrap();
} }
#[derive(Eq, PartialEq, Hash)] #[derive(Eq, Hash, PartialEq)]
struct Bytes<'a>(&'a str); struct Bytes<'a>(&'a str);
impl<'a> fmt::Debug for Bytes<'a> { impl<'a> fmt::Debug for Bytes<'a> {

View file

@ -13,7 +13,7 @@ use net_traits::request::RequestInit;
use servo_url::ServoUrl; use servo_url::ServoUrl;
use std::thread; use std::thread;
#[derive(JSTraceable, PartialEq, Clone, Debug, HeapSizeOf)] #[derive(Clone, Debug, HeapSizeOf, JSTraceable, PartialEq)]
pub enum LoadType { pub enum LoadType {
Image(ServoUrl), Image(ServoUrl),
Script(ServoUrl), Script(ServoUrl),
@ -39,7 +39,7 @@ impl LoadType {
/// Canary value ensuring that manually added blocking loads (ie. ones that weren't /// Canary value ensuring that manually added blocking loads (ie. ones that weren't
/// created via DocumentLoader::fetch_async) are always removed by the time /// created via DocumentLoader::fetch_async) are always removed by the time
/// that the owner is destroyed. /// that the owner is destroyed.
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
pub struct LoadBlocker { pub struct LoadBlocker {
/// The document whose load event is blocked by this object existing. /// 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 { pub struct DocumentLoader {
resource_threads: ResourceThreads, resource_threads: ResourceThreads,
blocking_loads: Vec<LoadType>, blocking_loads: Vec<LoadType>,

View file

@ -29,7 +29,7 @@ impl<T: DomObject> SimpleWorkerErrorHandler<T> {
} }
} }
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct SharedRt { pub struct SharedRt {
rt: *mut JSRuntime rt: *mut JSRuntime
} }

View file

@ -12,7 +12,7 @@ use std::sync::mpsc::{Receiver, Sender};
/// A ScriptChan that can be cloned freely and will silently send a TrustedWorkerAddress with /// 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 /// common event loop messages. While this SendableWorkerScriptChan is alive, the associated
/// Worker object will remain alive. /// Worker object will remain alive.
#[derive(JSTraceable, Clone)] #[derive(Clone, JSTraceable)]
pub struct SendableWorkerScriptChan<T: DomObject> { pub struct SendableWorkerScriptChan<T: DomObject> {
pub sender: Sender<(Trusted<T>, CommonScriptMsg)>, pub sender: Sender<(Trusted<T>, CommonScriptMsg)>,
pub worker: Trusted<T>, pub worker: Trusted<T>,
@ -34,7 +34,7 @@ impl<T: JSTraceable + DomObject + 'static> ScriptChan for SendableWorkerScriptCh
/// A ScriptChan that can be cloned freely and will silently send a TrustedWorkerAddress with /// 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 event loop messages. While this SendableWorkerScriptChan is alive, the associated
/// Worker object will remain alive. /// Worker object will remain alive.
#[derive(JSTraceable, Clone)] #[derive(Clone, JSTraceable)]
pub struct WorkerThreadWorkerChan<T: DomObject> { pub struct WorkerThreadWorkerChan<T: DomObject> {
pub sender: Sender<(Trusted<T>, WorkerScriptMsg)>, pub sender: Sender<(Trusted<T>, WorkerScriptMsg)>,
pub worker: Trusted<T>, pub worker: Trusted<T>,

View file

@ -25,7 +25,7 @@ use std::ptr;
use std::rc::Rc; use std::rc::Rc;
/// The exception handling used for a call. /// The exception handling used for a call.
#[derive(Copy, Clone, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum ExceptionHandling { pub enum ExceptionHandling {
/// Report any exception and don't throw it to the caller code. /// Report any exception and don't throw it to the caller code.
Report, Report,

View file

@ -170,7 +170,7 @@ impl ToJSValConvertible for USVString {
} }
/// Behavior for stringification of `JSVal`s. /// Behavior for stringification of `JSVal`s.
#[derive(PartialEq, Clone)] #[derive(Clone, PartialEq)]
pub enum StringificationBehavior { pub enum StringificationBehavior {
/// Convert `null` to the string `"null"`. /// Convert `null` to the string `"null"`.
Default, Default,

View file

@ -25,7 +25,7 @@ use libc::c_uint;
use std::slice::from_raw_parts; use std::slice::from_raw_parts;
/// DOM exceptions that can be thrown by a native DOM method. /// DOM exceptions that can be thrown by a native DOM method.
#[derive(Debug, Clone, HeapSizeOf)] #[derive(Clone, Debug, HeapSizeOf)]
pub enum Error { pub enum Error {
/// IndexSizeError DOMException /// IndexSizeError DOMException
IndexSize, IndexSize,

View file

@ -108,7 +108,7 @@ use script_thread::ScriptThread;
use std::ptr; use std::ptr;
/// The class of a non-callback interface object. /// The class of a non-callback interface object.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct NonCallbackInterfaceObjectClass { pub struct NonCallbackInterfaceObjectClass {
/// The SpiderMonkey Class structure. /// The SpiderMonkey Class structure.
pub class: Class, pub class: Class,

View file

@ -22,7 +22,7 @@ use std::cell::Cell;
use std::ptr; use std::ptr;
/// The values that an iterator will iterate over. /// The values that an iterator will iterate over.
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub enum IteratorType { pub enum IteratorType {
/// The keys of the iterable object. /// The keys of the iterable object.
Keys, Keys,

View file

@ -11,7 +11,7 @@ use libc;
use std::ptr; use std::ptr;
/// The class of a namespace object. /// The class of a namespace object.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct NamespaceObjectClass(JSClass); pub struct NamespaceObjectClass(JSClass);
unsafe impl Sync for NamespaceObjectClass {} unsafe impl Sync for NamespaceObjectClass {}

View file

@ -9,7 +9,7 @@ use num_traits::Float;
use std::ops::Deref; use std::ops::Deref;
/// Encapsulates the IDL restricted float type. /// Encapsulates the IDL restricted float type.
#[derive(JSTraceable, Clone, Copy, Eq, PartialEq)] #[derive(Clone, Copy, Eq, JSTraceable, PartialEq)]
pub struct Finite<T: Float>(T); pub struct Finite<T: Float>(T);
impl<T: Float> Finite<T> { impl<T: Float> Finite<T> {

View file

@ -15,7 +15,7 @@ use std::thread;
thread_local!(static STACK: RefCell<Vec<StackEntry>> = RefCell::new(Vec::new())); thread_local!(static STACK: RefCell<Vec<StackEntry>> = RefCell::new(Vec::new()));
#[derive(PartialEq, Eq, Debug, JSTraceable)] #[derive(Debug, Eq, JSTraceable, PartialEq)]
enum StackEntryKind { enum StackEntryKind {
Incumbent, Incumbent,
Entry, Entry,

View file

@ -18,7 +18,7 @@ use std::str;
use std::str::{Bytes, FromStr}; use std::str::{Bytes, FromStr};
/// Encapsulates the IDL `ByteString` type. /// Encapsulates the IDL `ByteString` type.
#[derive(JSTraceable, Clone, Eq, PartialEq, HeapSizeOf, Debug)] #[derive(Clone, Debug, Eq, HeapSizeOf, JSTraceable, PartialEq)]
pub struct ByteString(Vec<u8>); pub struct ByteString(Vec<u8>);
impl ByteString { impl ByteString {

View file

@ -47,7 +47,7 @@ impl HeapSizeOf for WindowProxyHandler {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
/// Static data associated with a global object. /// Static data associated with a global object.
pub struct GlobalStaticData { pub struct GlobalStaticData {
/// The WindowProxy proxy handler for this global. /// 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. /// The struct that holds inheritance information for DOM object reflectors.
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct DOMClass { pub struct DOMClass {
/// A list of interfaces that this object implements, in order of decreasing /// A list of interfaces that this object implements, in order of decreasing
/// derivedness. /// derivedness.

View file

@ -24,7 +24,7 @@ pub struct CanvasGradient {
stops: DOMRefCell<Vec<CanvasGradientStop>>, stops: DOMRefCell<Vec<CanvasGradientStop>>,
} }
#[derive(JSTraceable, Clone, HeapSizeOf)] #[derive(Clone, HeapSizeOf, JSTraceable)]
pub enum CanvasGradientStyle { pub enum CanvasGradientStyle {
Linear(LinearGradientStyle), Linear(LinearGradientStyle),
Radial(RadialGradientStyle), Radial(RadialGradientStyle),

View file

@ -51,7 +51,7 @@ use std::sync::Arc;
use unpremultiplytable::UNPREMULTIPLY_TABLE; use unpremultiplytable::UNPREMULTIPLY_TABLE;
#[must_root] #[must_root]
#[derive(JSTraceable, Clone, HeapSizeOf)] #[derive(Clone, HeapSizeOf, JSTraceable)]
#[allow(dead_code)] #[allow(dead_code)]
enum CanvasFillOrStrokeStyle { enum CanvasFillOrStrokeStyle {
Color(RGBA), Color(RGBA),
@ -81,7 +81,7 @@ pub struct CanvasRenderingContext2D {
} }
#[must_root] #[must_root]
#[derive(JSTraceable, Clone, HeapSizeOf)] #[derive(Clone, HeapSizeOf, JSTraceable)]
struct CanvasContextState { struct CanvasContextState {
global_alpha: f64, global_alpha: f64,
global_composition: CompositionOrBlending, global_composition: CompositionOrBlending,

View file

@ -154,7 +154,7 @@ impl CSSStyleOwner {
} }
} }
#[derive(PartialEq, HeapSizeOf)] #[derive(HeapSizeOf, PartialEq)]
pub enum CSSModificationAccess { pub enum CSSModificationAccess {
ReadWrite, ReadWrite,
Readonly, Readonly,

View file

@ -372,7 +372,7 @@ impl CustomElementRegistryMethods for CustomElementRegistry {
} }
} }
#[derive(HeapSizeOf, JSTraceable, Clone)] #[derive(Clone, HeapSizeOf, JSTraceable)]
pub struct LifecycleCallbacks { pub struct LifecycleCallbacks {
#[ignore_heap_size_of = "Rc"] #[ignore_heap_size_of = "Rc"]
connected_callback: Option<Rc<Function>>, connected_callback: Option<Rc<Function>>,
@ -387,14 +387,14 @@ pub struct LifecycleCallbacks {
attribute_changed_callback: Option<Rc<Function>>, attribute_changed_callback: Option<Rc<Function>>,
} }
#[derive(HeapSizeOf, JSTraceable, Clone)] #[derive(Clone, HeapSizeOf, JSTraceable)]
pub enum ConstructionStackEntry { pub enum ConstructionStackEntry {
Element(Root<Element>), Element(Root<Element>),
AlreadyConstructedMarker, AlreadyConstructedMarker,
} }
/// https://html.spec.whatwg.org/multipage/#custom-element-definition /// https://html.spec.whatwg.org/multipage/#custom-element-definition
#[derive(HeapSizeOf, JSTraceable, Clone)] #[derive(Clone, HeapSizeOf, JSTraceable)]
pub struct CustomElementDefinition { pub struct CustomElementDefinition {
pub name: LocalName, pub name: LocalName,
@ -620,7 +620,7 @@ pub enum CallbackReaction {
} }
/// https://html.spec.whatwg.org/multipage/#processing-the-backup-element-queue /// 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 { enum BackupElementQueueFlag {
Processing, Processing,
NotProcessing, NotProcessing,

View file

@ -193,7 +193,7 @@ impl PendingRestyle {
} }
} }
#[derive(Clone, JSTraceable, HeapSizeOf)] #[derive(Clone, HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
struct StyleSheetInDocument { struct StyleSheetInDocument {
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
@ -353,7 +353,7 @@ pub struct Document {
form_id_listener_map: DOMRefCell<HashMap<Atom, HashSet<JS<Element>>>>, form_id_listener_map: DOMRefCell<HashMap<Atom, HashSet<JS<Element>>>>,
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct ImagesFilter; struct ImagesFilter;
impl CollectionFilter for ImagesFilter { impl CollectionFilter for ImagesFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -361,7 +361,7 @@ impl CollectionFilter for ImagesFilter {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct EmbedsFilter; struct EmbedsFilter;
impl CollectionFilter for EmbedsFilter { impl CollectionFilter for EmbedsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -369,7 +369,7 @@ impl CollectionFilter for EmbedsFilter {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct LinksFilter; struct LinksFilter;
impl CollectionFilter for LinksFilter { impl CollectionFilter for LinksFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -378,7 +378,7 @@ impl CollectionFilter for LinksFilter {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct FormsFilter; struct FormsFilter;
impl CollectionFilter for FormsFilter { impl CollectionFilter for FormsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -386,7 +386,7 @@ impl CollectionFilter for FormsFilter {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct ScriptsFilter; struct ScriptsFilter;
impl CollectionFilter for ScriptsFilter { impl CollectionFilter for ScriptsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -394,7 +394,7 @@ impl CollectionFilter for ScriptsFilter {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct AnchorsFilter; struct AnchorsFilter;
impl CollectionFilter for AnchorsFilter { impl CollectionFilter for AnchorsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -402,7 +402,7 @@ impl CollectionFilter for AnchorsFilter {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct AppletsFilter; struct AppletsFilter;
impl CollectionFilter for AppletsFilter { impl CollectionFilter for AppletsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {
@ -2027,7 +2027,7 @@ impl Document {
} }
} }
#[derive(PartialEq, HeapSizeOf)] #[derive(HeapSizeOf, PartialEq)]
pub enum DocumentSource { pub enum DocumentSource {
FromParser, FromParser,
NotFromParser, 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 { pub enum HasBrowsingContext {
No, No,
Yes, Yes,
@ -3513,7 +3513,7 @@ impl DocumentMethods for Document {
#[allow(unsafe_code)] #[allow(unsafe_code)]
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter // https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
unsafe fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonZero<*mut JSObject>> { unsafe fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonZero<*mut JSObject>> {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct NamedElementFilter { struct NamedElementFilter {
name: Atom, name: Atom,
} }
@ -4033,7 +4033,7 @@ impl Runnable for DocumentProgressHandler {
} }
/// Specifies the type of focus event that is sent to a pipeline /// Specifies the type of focus event that is sent to a pipeline
#[derive(Copy, Clone, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum FocusType { pub enum FocusType {
Element, // The first focus message - focus the element itself Element, // The first focus message - focus the element itself
Parent, // Focusing a parent element (an iframe) 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. /// 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 /// without mutating the DOM), then we fall back to simple timeouts to save energy over video
/// refresh. /// refresh.
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub struct FakeRequestAnimationFrameCallback { pub struct FakeRequestAnimationFrameCallback {
/// The document. /// The document.
#[ignore_heap_size_of = "non-owning"] #[ignore_heap_size_of = "non-owning"]

View file

@ -12,7 +12,7 @@ use dom::globalscope::GlobalScope;
use dom_struct::dom_struct; use dom_struct::dom_struct;
#[repr(u16)] #[repr(u16)]
#[derive(JSTraceable, Copy, Clone, Debug, HeapSizeOf)] #[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable)]
pub enum DOMErrorName { pub enum DOMErrorName {
IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR, IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR,
HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR, HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR,

View file

@ -170,7 +170,7 @@ impl fmt::Debug for Root<Element> {
} }
} }
#[derive(PartialEq, HeapSizeOf)] #[derive(HeapSizeOf, PartialEq)]
pub enum ElementCreator { pub enum ElementCreator {
ParserCreated(u64), ParserCreated(u64),
ScriptCreated, ScriptCreated,
@ -182,7 +182,7 @@ pub enum CustomElementCreationMode {
} }
/// https://dom.spec.whatwg.org/#concept-element-custom-element-state /// 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 { pub enum CustomElementState {
Undefined, Undefined,
Failed, Failed,
@ -2981,7 +2981,7 @@ impl<'a> AttributeMutation<'a> {
/// A holder for an element's "tag name", which will be lazily /// A holder for an element's "tag name", which will be lazily
/// resolved and cached. Should be reset when the document /// resolved and cached. Should be reset when the document
/// owner changes. /// owner changes.
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct TagName { struct TagName {
ptr: DOMRefCell<Option<LocalName>>, ptr: DOMRefCell<Option<LocalName>>,
} }

View file

@ -294,7 +294,7 @@ impl EventMethods for Event {
} }
} }
#[derive(PartialEq, HeapSizeOf, Copy, Clone)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum EventBubbles { pub enum EventBubbles {
Bubbles, Bubbles,
DoesNotBubble DoesNotBubble
@ -318,7 +318,7 @@ impl From<EventBubbles> for bool {
} }
} }
#[derive(PartialEq, HeapSizeOf, Copy, Clone)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum EventCancelable { pub enum EventCancelable {
Cancelable, Cancelable,
NotCancelable NotCancelable
@ -342,7 +342,7 @@ impl From<EventCancelable> for bool {
} }
} }
#[derive(JSTraceable, Copy, Clone, Debug, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, JSTraceable, PartialEq)]
#[repr(u16)] #[repr(u16)]
#[derive(HeapSizeOf)] #[derive(HeapSizeOf)]
pub enum EventPhase { pub enum EventPhase {
@ -363,7 +363,7 @@ pub enum EventPhase {
/// ///
/// [msg]: https://doc.servo.org/script_traits/enum.ConstellationMsg.html#variant.KeyEvent /// [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 { pub enum EventDefault {
/// The default action of the event is allowed (constructor's default) /// The default action of the event is allowed (constructor's default)
Allowed, Allowed,

View file

@ -43,10 +43,10 @@ header! { (LastEventId, "Last-Event-ID") => [String] }
const DEFAULT_RECONNECTION_TIME: u64 = 5000; const DEFAULT_RECONNECTION_TIME: u64 = 5000;
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)] #[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
struct GenerationId(u32); 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 /// https://html.spec.whatwg.org/multipage/#dom-eventsource-readystate
enum ReadyState { enum ReadyState {
Connecting = 0, Connecting = 0,
@ -535,7 +535,7 @@ impl Runnable for ReestablishConnectionRunnable {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub struct EventSourceTimeoutCallback { pub struct EventSourceTimeoutCallback {
#[ignore_heap_size_of = "Because it is non-owning"] #[ignore_heap_size_of = "Because it is non-owning"]
event_source: Trusted<EventSource>, event_source: Trusted<EventSource>,

View file

@ -44,7 +44,7 @@ use std::ops::{Deref, DerefMut};
use std::ptr; use std::ptr;
use std::rc::Rc; use std::rc::Rc;
#[derive(PartialEq, Clone, JSTraceable)] #[derive(Clone, JSTraceable, PartialEq)]
pub enum CommonEventHandler { pub enum CommonEventHandler {
EventHandler(Rc<EventHandlerNonNull>), EventHandler(Rc<EventHandlerNonNull>),
ErrorEventHandler(Rc<OnErrorEventHandlerNonNull>), ErrorEventHandler(Rc<OnErrorEventHandlerNonNull>),
@ -61,14 +61,14 @@ impl CommonEventHandler {
} }
} }
#[derive(JSTraceable, Copy, Clone, PartialEq, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
pub enum ListenerPhase { pub enum ListenerPhase {
Capturing, Capturing,
Bubbling, Bubbling,
} }
/// https://html.spec.whatwg.org/multipage/#internal-raw-uncompiled-handler /// https://html.spec.whatwg.org/multipage/#internal-raw-uncompiled-handler
#[derive(JSTraceable, Clone, PartialEq)] #[derive(Clone, JSTraceable, PartialEq)]
struct InternalRawUncompiledHandler { struct InternalRawUncompiledHandler {
source: DOMString, source: DOMString,
url: ServoUrl, url: ServoUrl,
@ -76,7 +76,7 @@ struct InternalRawUncompiledHandler {
} }
/// A representation of an event handler, either compiled or uncompiled raw source, or null. /// A representation of an event handler, either compiled or uncompiled raw source, or null.
#[derive(JSTraceable, PartialEq, Clone)] #[derive(Clone, JSTraceable, PartialEq)]
enum InlineEventListener { enum InlineEventListener {
Uncompiled(InternalRawUncompiledHandler), Uncompiled(InternalRawUncompiledHandler),
Compiled(CommonEventHandler), Compiled(CommonEventHandler),
@ -106,7 +106,7 @@ impl InlineEventListener {
} }
} }
#[derive(JSTraceable, Clone, PartialEq)] #[derive(Clone, JSTraceable, PartialEq)]
enum EventListenerType { enum EventListenerType {
Additive(Rc<EventListener>), Additive(Rc<EventListener>),
Inline(InlineEventListener), Inline(InlineEventListener),
@ -228,7 +228,7 @@ struct EventListenerEntry {
listener: EventListenerType listener: EventListenerType
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
/// A mix of potentially uncompiled and compiled event listeners of the same type. /// A mix of potentially uncompiled and compiled event listeners of the same type.
struct EventListeners(Vec<EventListenerEntry>); struct EventListeners(Vec<EventListenerEntry>);

View file

@ -39,7 +39,7 @@ use std::thread;
use task_source::TaskSource; use task_source::TaskSource;
use task_source::file_reading::{FileReadingTaskSource, FileReadingRunnable, FileReadingTask}; use task_source::file_reading::{FileReadingTaskSource, FileReadingRunnable, FileReadingTask};
#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
pub enum FileReaderFunction { pub enum FileReaderFunction {
ReadAsText, ReadAsText,
ReadAsDataUrl, ReadAsDataUrl,
@ -66,11 +66,11 @@ impl ReadMetaData {
} }
} }
#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
pub struct GenerationId(u32); pub struct GenerationId(u32);
#[repr(u16)] #[repr(u16)]
#[derive(Copy, Clone, Debug, PartialEq, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
pub enum FileReaderReadyState { pub enum FileReaderReadyState {
Empty = FileReaderConstants::EMPTY, Empty = FileReaderConstants::EMPTY,
Loading = FileReaderConstants::LOADING, Loading = FileReaderConstants::LOADING,

View file

@ -26,7 +26,7 @@ pub struct Headers {
} }
// https://fetch.spec.whatwg.org/#concept-headers-guard // https://fetch.spec.whatwg.org/#concept-headers-guard
#[derive(Copy, Clone, JSTraceable, HeapSizeOf, PartialEq)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
pub enum Guard { pub enum Guard {
Immutable, Immutable,
Request, Request,

View file

@ -29,7 +29,7 @@ use std::cell::Cell;
use std::default::Default; use std::default::Default;
use style::element_state::*; use style::element_state::*;
#[derive(JSTraceable, PartialEq, Copy, Clone)] #[derive(Clone, Copy, JSTraceable, PartialEq)]
#[derive(HeapSizeOf)] #[derive(HeapSizeOf)]
enum ButtonType { enum ButtonType {
Submit, Submit,

View file

@ -42,7 +42,7 @@ const DEFAULT_WIDTH: u32 = 300;
const DEFAULT_HEIGHT: u32 = 150; const DEFAULT_HEIGHT: u32 = 150;
#[must_root] #[must_root]
#[derive(JSTraceable, Clone, HeapSizeOf)] #[derive(Clone, HeapSizeOf, JSTraceable)]
pub enum CanvasContext { pub enum CanvasContext {
Context2d(JS<CanvasRenderingContext2D>), Context2d(JS<CanvasRenderingContext2D>),
WebGL(JS<WebGLRenderingContext>), WebGL(JS<WebGLRenderingContext>),

View file

@ -26,7 +26,7 @@ pub trait CollectionFilter : JSTraceable {
// An optional u32, using maxint to represent None. // An optional u32, using maxint to represent None.
// It would be nicer just to use Option<u32> for this, but that would produce word // It would be nicer just to use Option<u32> for this, but that would produce word
// alignment issues since Option<u32> uses 33 bits. // alignment issues since Option<u32> uses 33 bits.
#[derive(Clone, Copy, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
struct OptionU32 { struct OptionU32 {
bits: u32, bits: u32,
} }
@ -119,7 +119,7 @@ impl HTMLCollection {
-> Root<HTMLCollection> { -> Root<HTMLCollection> {
// case 1 // case 1
if qualified_name == local_name!("*") { if qualified_name == local_name!("*") {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct AllFilter; struct AllFilter;
impl CollectionFilter for AllFilter { impl CollectionFilter for AllFilter {
fn filter(&self, _elem: &Element, _root: &Node) -> bool { fn filter(&self, _elem: &Element, _root: &Node) -> bool {
@ -129,7 +129,7 @@ impl HTMLCollection {
return HTMLCollection::create(window, root, box AllFilter); return HTMLCollection::create(window, root, box AllFilter);
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct HtmlDocumentFilter { struct HtmlDocumentFilter {
qualified_name: LocalName, qualified_name: LocalName,
ascii_lower_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<HTMLCollection> { pub fn by_qual_tag_name(window: &Window, root: &Node, qname: QualName) -> Root<HTMLCollection> {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct TagNameNSFilter { struct TagNameNSFilter {
qname: QualName qname: QualName
} }
@ -193,7 +193,7 @@ impl HTMLCollection {
pub fn by_atomic_class_name(window: &Window, root: &Node, classes: Vec<Atom>) pub fn by_atomic_class_name(window: &Window, root: &Node, classes: Vec<Atom>)
-> Root<HTMLCollection> { -> Root<HTMLCollection> {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct ClassNameFilter { struct ClassNameFilter {
classes: Vec<Atom> classes: Vec<Atom>
} }
@ -212,7 +212,7 @@ impl HTMLCollection {
} }
pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> { pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct ElementChildFilter; struct ElementChildFilter;
impl CollectionFilter for ElementChildFilter { impl CollectionFilter for ElementChildFilter {
fn filter(&self, elem: &Element, root: &Node) -> bool { fn filter(&self, elem: &Element, root: &Node) -> bool {

View file

@ -43,7 +43,7 @@ impl HTMLDataListElement {
impl HTMLDataListElementMethods for HTMLDataListElement { impl HTMLDataListElementMethods for HTMLDataListElement {
// https://html.spec.whatwg.org/multipage/#dom-datalist-options // https://html.spec.whatwg.org/multipage/#dom-datalist-options
fn Options(&self) -> Root<HTMLCollection> { fn Options(&self) -> Root<HTMLCollection> {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct HTMLDataListOptionsFilter; struct HTMLDataListOptionsFilter;
impl CollectionFilter for HTMLDataListOptionsFilter { impl CollectionFilter for HTMLDataListOptionsFilter {
fn filter(&self, elem: &Element, _root: &Node) -> bool { fn filter(&self, elem: &Element, _root: &Node) -> bool {

View file

@ -52,7 +52,7 @@ impl HTMLFieldSetElement {
impl HTMLFieldSetElementMethods for HTMLFieldSetElement { impl HTMLFieldSetElementMethods for HTMLFieldSetElement {
// https://html.spec.whatwg.org/multipage/#dom-fieldset-elements // https://html.spec.whatwg.org/multipage/#dom-fieldset-elements
fn Elements(&self) -> Root<HTMLCollection> { fn Elements(&self) -> Root<HTMLCollection> {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct ElementsFilter; struct ElementsFilter;
impl CollectionFilter for ElementsFilter { impl CollectionFilter for ElementsFilter {
fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool { fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool {

View file

@ -59,7 +59,7 @@ use style::attr::AttrValue;
use style::str::split_html_space_chars; use style::str::split_html_space_chars;
use task_source::TaskSource; use task_source::TaskSource;
#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
pub struct GenerationId(u32); pub struct GenerationId(u32);
#[dom_struct] #[dom_struct]
@ -172,7 +172,7 @@ impl HTMLFormElementMethods for HTMLFormElement {
return elements; return elements;
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct ElementsFilter { struct ElementsFilter {
form: Root<HTMLFormElement> form: Root<HTMLFormElement>
} }
@ -241,13 +241,13 @@ impl HTMLFormElementMethods for HTMLFormElement {
} }
} }
#[derive(Copy, Clone, HeapSizeOf, PartialEq)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum SubmittedFrom { pub enum SubmittedFrom {
FromForm, FromForm,
NotFromForm NotFromForm
} }
#[derive(Copy, Clone, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf)]
pub enum ResetFrom { pub enum ResetFrom {
FromForm, FromForm,
NotFromForm NotFromForm
@ -674,14 +674,14 @@ impl HTMLFormElement {
} }
} }
#[derive(JSTraceable, HeapSizeOf, Clone)] #[derive(Clone, HeapSizeOf, JSTraceable)]
pub enum FormDatumValue { pub enum FormDatumValue {
#[allow(dead_code)] #[allow(dead_code)]
File(Root<File>), File(Root<File>),
String(DOMString) String(DOMString)
} }
#[derive(HeapSizeOf, JSTraceable, Clone)] #[derive(Clone, HeapSizeOf, JSTraceable)]
pub struct FormDatum { pub struct FormDatum {
pub ty: DOMString, pub ty: DOMString,
pub name: DOMString, pub name: DOMString,
@ -701,14 +701,14 @@ impl FormDatum {
} }
} }
#[derive(Copy, Clone, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf)]
pub enum FormEncType { pub enum FormEncType {
TextPlainEncoded, TextPlainEncoded,
UrlEncoded, UrlEncoded,
FormDataEncoded FormDataEncoded
} }
#[derive(Copy, Clone, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf)]
pub enum FormMethod { pub enum FormMethod {
FormGet, FormGet,
FormPost, FormPost,
@ -759,7 +759,7 @@ impl FormSubmittableElement {
} }
} }
#[derive(Copy, Clone, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf)]
pub enum FormSubmitter<'a> { pub enum FormSubmitter<'a> {
FormElement(&'a HTMLFormElement), FormElement(&'a HTMLFormElement),
InputElement(&'a HTMLInputElement), InputElement(&'a HTMLInputElement),

View file

@ -10,7 +10,7 @@ use dom::node::Node;
use dom_struct::dom_struct; use dom_struct::dom_struct;
use html5ever::{LocalName, Prefix}; use html5ever::{LocalName, Prefix};
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub enum HeadingLevel { pub enum HeadingLevel {
Heading1, Heading1,
Heading2, Heading2,

View file

@ -57,7 +57,7 @@ use style::context::ReflowGoal;
use task_source::TaskSource; use task_source::TaskSource;
bitflags! { bitflags! {
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
flags SandboxAllowance: u8 { flags SandboxAllowance: u8 {
const ALLOW_NOTHING = 0x00, const ALLOW_NOTHING = 0x00,
const ALLOW_SAME_ORIGIN = 0x01, const ALLOW_SAME_ORIGIN = 0x01,

View file

@ -58,7 +58,7 @@ use std::sync::{Arc, Mutex};
use style::attr::{AttrValue, LengthOrPercentageOrAuto}; use style::attr::{AttrValue, LengthOrPercentageOrAuto};
use task_source::TaskSource; use task_source::TaskSource;
#[derive(Clone, Copy, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
#[allow(dead_code)] #[allow(dead_code)]
enum State { enum State {
Unavailable, Unavailable,
@ -66,12 +66,12 @@ enum State {
CompletelyAvailable, CompletelyAvailable,
Broken, Broken,
} }
#[derive(Copy, Clone, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
enum ImageRequestPhase { enum ImageRequestPhase {
Pending, Pending,
Current Current
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
struct ImageRequest { struct ImageRequest {
state: State, state: State,
@ -715,7 +715,7 @@ impl HTMLImageElement {
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub enum ImageElementMicrotask { pub enum ImageElementMicrotask {
StableStateUpdateImageDataTask { StableStateUpdateImageDataTask {
elem: Root<HTMLImageElement>, elem: Root<HTMLImageElement>,

View file

@ -60,7 +60,7 @@ const DEFAULT_SUBMIT_VALUE: &'static str = "Submit";
const DEFAULT_RESET_VALUE: &'static str = "Reset"; const DEFAULT_RESET_VALUE: &'static str = "Reset";
const PASSWORD_REPLACEMENT_CHAR: char = '●'; const PASSWORD_REPLACEMENT_CHAR: char = '●';
#[derive(JSTraceable, PartialEq, Copy, Clone)] #[derive(Clone, Copy, JSTraceable, PartialEq)]
#[allow(dead_code)] #[allow(dead_code)]
#[derive(HeapSizeOf)] #[derive(HeapSizeOf)]
enum InputType { enum InputType {

View file

@ -38,7 +38,7 @@ use style::stylesheets::{CssRuleType, Stylesheet};
use style_traits::PARSING_MODE_DEFAULT; use style_traits::PARSING_MODE_DEFAULT;
use stylesheet_loader::{StylesheetLoader, StylesheetContextSource, StylesheetOwner}; use stylesheet_loader::{StylesheetLoader, StylesheetContextSource, StylesheetOwner};
#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
pub struct RequestGenerationId(u32); pub struct RequestGenerationId(u32);
impl RequestGenerationId { impl RequestGenerationId {

View file

@ -201,7 +201,7 @@ impl HTMLMediaElementContext {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub struct VideoMedia { pub struct VideoMedia {
format: String, format: String,
#[ignore_heap_size_of = "defined in time"] #[ignore_heap_size_of = "defined in time"]
@ -794,7 +794,7 @@ impl VirtualMethods for HTMLMediaElement {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub enum MediaElementMicrotask { pub enum MediaElementMicrotask {
ResourceSelectionTask { ResourceSelectionTask {
elem: Root<HTMLMediaElement>, elem: Root<HTMLMediaElement>,

View file

@ -37,7 +37,7 @@ use std::iter;
use style::attr::AttrValue; use style::attr::AttrValue;
use style::element_state::*; use style::element_state::*;
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct OptionsFilter; struct OptionsFilter;
impl CollectionFilter for OptionsFilter { impl CollectionFilter for OptionsFilter {
fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool { fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool {

View file

@ -36,7 +36,7 @@ pub struct HTMLTableElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct TableRowFilter { struct TableRowFilter {
sections: Vec<JS<Node>>, sections: Vec<JS<Node>>,
} }

View file

@ -149,7 +149,7 @@ pub struct Node {
bitflags! { bitflags! {
#[doc = "Flags for node items."] #[doc = "Flags for node items."]
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub flags NodeFlags: u16 { pub flags NodeFlags: u16 {
#[doc = "Specifies whether this node is in a document."] #[doc = "Specifies whether this node is in a document."]
const IS_IN_DOC = 1 << 0, const IS_IN_DOC = 1 << 0,
@ -203,7 +203,7 @@ impl Drop for Node {
/// suppress observers flag /// suppress observers flag
/// https://dom.spec.whatwg.org/#concept-node-insert /// https://dom.spec.whatwg.org/#concept-node-insert
/// https://dom.spec.whatwg.org/#concept-node-remove /// https://dom.spec.whatwg.org/#concept-node-remove
#[derive(Copy, Clone, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf)]
enum SuppressObserver { enum SuppressObserver {
Suppressed, Suppressed,
Unsuppressed Unsuppressed
@ -1368,7 +1368,7 @@ impl Iterator for TreeIterator {
} }
/// Specifies whether children must be recursively cloned or not. /// Specifies whether children must be recursively cloned or not.
#[derive(Copy, Clone, PartialEq, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum CloneChildrenFlag { pub enum CloneChildrenFlag {
CloneChildren, CloneChildren,
DoNotCloneChildren DoNotCloneChildren
@ -2531,7 +2531,7 @@ impl VirtualMethods for Node {
} }
/// A summary of the changes that happened to a node. /// A summary of the changes that happened to a node.
#[derive(Copy, Clone, PartialEq, HeapSizeOf)] #[derive(Clone, Copy, HeapSizeOf, PartialEq)]
pub enum NodeDamage { pub enum NodeDamage {
/// The node's `style` attribute changed. /// The node's `style` attribute changed.
NodeStyleDamaged, NodeStyleDamaged,

View file

@ -12,7 +12,7 @@ use dom::window::Window;
use dom_struct::dom_struct; use dom_struct::dom_struct;
use std::cell::Cell; use std::cell::Cell;
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
pub enum NodeListType { pub enum NodeListType {
Simple(Vec<JS<Node>>), Simple(Vec<JS<Node>>),
@ -109,7 +109,7 @@ impl NodeList {
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
pub struct ChildrenList { pub struct ChildrenList {
node: JS<Node>, node: JS<Node>,

View file

@ -467,7 +467,7 @@ pub enum PaintWorkletTask {
/// https://drafts.css-houdini.org/css-paint-api/#paint-definition /// https://drafts.css-houdini.org/css-paint-api/#paint-definition
/// This type is dangerous, because it contains uboxed `Heap<JSVal>` values, /// This type is dangerous, because it contains uboxed `Heap<JSVal>` values,
/// which can't be moved. /// which can't be moved.
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
struct PaintDefinition { struct PaintDefinition {
class_constructor: Heap<JSVal>, class_constructor: Heap<JSVal>,

View file

@ -50,7 +50,7 @@ pub enum MixedMessage {
FromTimeoutThread(()) FromTimeoutThread(())
} }
#[derive(JSTraceable, Clone)] #[derive(Clone, JSTraceable)]
pub struct ServiceWorkerChan { pub struct ServiceWorkerChan {
pub sender: Sender<ServiceWorkerScriptMsg> pub sender: Sender<ServiceWorkerScriptMsg>
} }

View file

@ -495,7 +495,7 @@ fn run(sink: Sink,
} }
} }
#[derive(JSTraceable, HeapSizeOf, Default)] #[derive(Default, HeapSizeOf, JSTraceable)]
struct ParseNodeData { struct ParseNodeData {
contents: Option<ParseNode>, contents: Option<ParseNode>,
is_integration_point: bool, is_integration_point: bool,

View file

@ -738,7 +738,7 @@ fn insert(parent: &Node, reference_child: Option<&Node>, child: NodeOrText<JS<No
} }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
pub struct Sink { pub struct Sink {
base_url: ServoUrl, base_url: ServoUrl,

View file

@ -723,7 +723,7 @@ impl TestBindingMethods for TestBinding {
p.append_native_handler(&handler); p.append_native_handler(&handler);
return p; return p;
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct SimpleHandler { struct SimpleHandler {
#[ignore_heap_size_of = "Rc has unclear ownership semantics"] #[ignore_heap_size_of = "Rc has unclear ownership semantics"]
handler: Rc<SimpleCallback>, handler: Rc<SimpleCallback>,
@ -804,7 +804,7 @@ impl TestBinding {
pub unsafe fn condition_unsatisfied(_: *mut JSContext, _: HandleObject) -> bool { false } pub unsafe fn condition_unsatisfied(_: *mut JSContext, _: HandleObject) -> bool { false }
} }
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub struct TestBindingCallback { pub struct TestBindingCallback {
#[ignore_heap_size_of = "unclear ownership semantics"] #[ignore_heap_size_of = "unclear ownership semantics"]
promise: TrustedPromise, promise: TrustedPromise,

View file

@ -11,7 +11,7 @@ use dom::window::Window;
use dom_struct::dom_struct; use dom_struct::dom_struct;
// https://html.spec.whatwg.org/multipage/#validity-states // https://html.spec.whatwg.org/multipage/#validity-states
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
#[allow(dead_code)] #[allow(dead_code)]
pub enum ValidityStatus { pub enum ValidityStatus {
ValueMissing, ValueMissing,

View file

@ -79,7 +79,7 @@ unsafe_no_jsmanaged_fields!(WebVRDisplayData);
unsafe_no_jsmanaged_fields!(WebVRFrameData); unsafe_no_jsmanaged_fields!(WebVRFrameData);
unsafe_no_jsmanaged_fields!(WebVRLayer); unsafe_no_jsmanaged_fields!(WebVRLayer);
#[derive(Clone, Copy, PartialEq, Eq, HeapSizeOf)] #[derive(Clone, Copy, Eq, HeapSizeOf, PartialEq)]
enum VRFrameDataStatus { enum VRFrameDataStatus {
Waiting, Waiting,
Synced, Synced,

View file

@ -44,7 +44,7 @@ const DEFAULT_DISABLED_GET_PARAMETER_NAMES: [GLenum; 1] = [
]; ];
/// WebGL features that are enabled/disabled by WebGL Extensions. /// WebGL features that are enabled/disabled by WebGL Extensions.
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
struct WebGLExtensionFeatures { struct WebGLExtensionFeatures {
gl_extensions: HashSet<String>, gl_extensions: HashSet<String>,
disabled_tex_types: HashSet<GLenum>, disabled_tex_types: HashSet<GLenum>,
@ -73,7 +73,7 @@ impl Default for WebGLExtensionFeatures {
/// Handles the list of implemented, supported and enabled WebGL extensions. /// Handles the list of implemented, supported and enabled WebGL extensions.
#[must_root] #[must_root]
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub struct WebGLExtensions { pub struct WebGLExtensions {
extensions: DOMRefCell<HashMap<String, Box<WebGLExtensionWrapper>>>, extensions: DOMRefCell<HashMap<String, Box<WebGLExtensionWrapper>>>,
features: DOMRefCell<WebGLExtensionFeatures>, features: DOMRefCell<WebGLExtensionFeatures>,
@ -223,7 +223,7 @@ impl WebGLExtensions {
} }
// Helper structs // Helper structs
#[derive(JSTraceable, HeapSizeOf, PartialEq, Eq, Hash)] #[derive(Eq, Hash, HeapSizeOf, JSTraceable, PartialEq)]
struct TexFormatType(u32, u32); struct TexFormatType(u32, u32);
type WebGLQueryParameterFunc = Fn(*mut JSContext, &WebGLRenderingContext) type WebGLQueryParameterFunc = Fn(*mut JSContext, &WebGLRenderingContext)

View file

@ -27,7 +27,7 @@ pub trait WebGLExtensionWrapper: JSTraceable + HeapSizeOf {
} }
#[must_root] #[must_root]
#[derive(JSTraceable, HeapSizeOf)] #[derive(HeapSizeOf, JSTraceable)]
pub struct TypedWebGLExtensionWrapper<T: WebGLExtension> { pub struct TypedWebGLExtensionWrapper<T: WebGLExtension> {
extension: MutNullableJS<T::Extension> extension: MutNullableJS<T::Extension>
} }

View file

@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderi
/// with gl constants. /// with gl constants.
macro_rules! type_safe_wrapper { macro_rules! type_safe_wrapper {
($name: ident, $($variant:ident => $mod:ident::$constant:ident, )+) => { ($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)] #[repr(u32)]
pub enum $name { pub enum $name {
$( $(

View file

@ -19,7 +19,7 @@ use dom_struct::dom_struct;
use std::cell::Cell; use std::cell::Cell;
#[must_root] #[must_root]
#[derive(JSTraceable, Clone, HeapSizeOf)] #[derive(Clone, HeapSizeOf, JSTraceable)]
enum WebGLFramebufferAttachment { enum WebGLFramebufferAttachment {
Renderbuffer(JS<WebGLRenderbuffer>), Renderbuffer(JS<WebGLRenderbuffer>),
Texture { texture: JS<WebGLTexture>, level: i32 }, Texture { texture: JS<WebGLTexture>, level: i32 },

View file

@ -18,7 +18,7 @@ use dom_struct::dom_struct;
use std::cell::Cell; use std::cell::Cell;
use std::sync::{ONCE_INIT, Once}; use std::sync::{ONCE_INIT, Once};
#[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)] #[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
pub enum ShaderCompilationStatus { pub enum ShaderCompilationStatus {
NotCompiled, NotCompiled,
Succeeded, Succeeded,

View file

@ -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 { pub struct ImageInfo {
width: u32, width: u32,
height: u32, height: u32,

View file

@ -42,7 +42,7 @@ use std::thread;
use task_source::TaskSource; use task_source::TaskSource;
use task_source::networking::NetworkingTaskSource; use task_source::networking::NetworkingTaskSource;
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)] #[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
enum WebSocketRequestState { enum WebSocketRequestState {
Connecting = 0, Connecting = 0,
Open = 1, Open = 1,

Some files were not shown because too many files have changed in this diff Show more