mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
order derivable traits lists
Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
This commit is contained in:
parent
ab73f3d61d
commit
c5fe235112
194 changed files with 553 additions and 552 deletions
|
@ -80,13 +80,13 @@ pub enum FromScriptMsg {
|
|||
SendPixels(IpcSender<Option<Vec<u8>>>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct CanvasGradientStop {
|
||||
pub offset: f64,
|
||||
pub color: RGBA,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct LinearGradientStyle {
|
||||
pub x0: f64,
|
||||
pub y0: f64,
|
||||
|
@ -108,7 +108,7 @@ impl LinearGradientStyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct RadialGradientStyle {
|
||||
pub x0: f64,
|
||||
pub y0: f64,
|
||||
|
@ -163,7 +163,7 @@ pub enum FillOrStrokeStyle {
|
|||
Surface(SurfaceStyle),
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum LineCapStyle {
|
||||
Butt = 0,
|
||||
Round = 1,
|
||||
|
@ -183,7 +183,7 @@ impl FromStr for LineCapStyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum LineJoinStyle {
|
||||
Round = 0,
|
||||
Bevel = 1,
|
||||
|
@ -203,7 +203,7 @@ impl FromStr for LineJoinStyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
pub enum RepetitionStyle {
|
||||
Repeat,
|
||||
RepeatX,
|
||||
|
@ -225,7 +225,7 @@ impl FromStr for RepetitionStyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum CompositionStyle {
|
||||
SrcIn,
|
||||
SrcOut,
|
||||
|
@ -279,7 +279,7 @@ impl CompositionStyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum BlendingStyle {
|
||||
Multiply,
|
||||
Screen,
|
||||
|
@ -345,7 +345,7 @@ impl BlendingStyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum CompositionOrBlending {
|
||||
Composition(CompositionStyle),
|
||||
Blending(BlendingStyle),
|
||||
|
|
|
@ -68,14 +68,14 @@ impl ConvertPipelineIdFromWebRender for webrender_api::PipelineId {
|
|||
|
||||
/// Holds the state when running reftests that determines when it is
|
||||
/// safe to save the output image.
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
enum ReadyState {
|
||||
Unknown,
|
||||
WaitingForConstellationReply,
|
||||
ReadyToSaveImage,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
struct FrameTreeId(u32);
|
||||
|
||||
impl FrameTreeId {
|
||||
|
@ -88,7 +88,7 @@ impl FrameTreeId {
|
|||
///
|
||||
/// This unit corresponds to a "pixel" in layer coordinate space, which after scaling and
|
||||
/// transformation becomes a device pixel.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
enum LayerPixel {}
|
||||
|
||||
/// NB: Never block on the constellation, because sometimes the constellation blocks on us.
|
||||
|
@ -195,7 +195,7 @@ pub struct IOCompositor<Window: WindowMethods> {
|
|||
pending_paint_metrics: HashMap<PipelineId, Epoch>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
struct ScrollZoomEvent {
|
||||
/// Change the pinch zoom level by this factor
|
||||
magnification: f32,
|
||||
|
@ -209,13 +209,13 @@ struct ScrollZoomEvent {
|
|||
event_count: u32,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum CompositionRequest {
|
||||
NoCompositingNecessary,
|
||||
CompositeNow(CompositingReason),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
enum ShutdownState {
|
||||
NotShuttingDown,
|
||||
ShuttingDown,
|
||||
|
@ -247,7 +247,7 @@ impl PipelineDetails {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
enum CompositeTarget {
|
||||
/// Normal composition to a window
|
||||
Window,
|
||||
|
@ -1657,7 +1657,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
}
|
||||
|
||||
/// Why we performed a composite. This is used for debugging.
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CompositingReason {
|
||||
/// We hit the delayed composition timeout. (See `delayed_composition.rs`.)
|
||||
DelayedCompositeTimeout,
|
||||
|
|
|
@ -115,7 +115,7 @@ impl Debug for WindowEvent {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum AnimationState {
|
||||
Idle,
|
||||
Animating,
|
||||
|
|
|
@ -25,7 +25,7 @@ lazy_static! {
|
|||
};
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
||||
pub enum PrefValue {
|
||||
Boolean(bool),
|
||||
String(String),
|
||||
|
|
|
@ -40,7 +40,7 @@ pub struct DevtoolsPageInfo {
|
|||
pub url: ServoUrl,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, HeapSizeOf, Serialize, Clone)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct CSSError {
|
||||
pub filename: String,
|
||||
pub line: u32,
|
||||
|
@ -144,7 +144,7 @@ pub struct TimelineMarker {
|
|||
pub end_stack: Option<Vec<()>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum TimelineMarkerType {
|
||||
Reflow,
|
||||
DOMEvent,
|
||||
|
@ -223,7 +223,7 @@ pub struct Modification {
|
|||
pub newValue: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum LogLevel {
|
||||
Log,
|
||||
Debug,
|
||||
|
@ -232,7 +232,7 @@ pub enum LogLevel {
|
|||
Error,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct ConsoleMessage {
|
||||
pub message: String,
|
||||
pub logLevel: LogLevel,
|
||||
|
@ -342,7 +342,7 @@ impl StartedTimelineMarker {
|
|||
/// library, which definitely can't have any dependencies on `serde`. But `serde` can't implement
|
||||
/// `Deserialize` and `Serialize` itself, because `time::PreciseTime` is opaque! A Catch-22. So I'm
|
||||
/// duplicating the definition here.
|
||||
#[derive(Debug, Copy, Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
pub struct PreciseTime(u64);
|
||||
|
||||
impl PreciseTime {
|
||||
|
@ -355,5 +355,5 @@ impl PreciseTime {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub struct WorkerId(pub u32);
|
||||
|
|
|
@ -42,7 +42,7 @@ pub use style::dom::OpaqueNode;
|
|||
/// items that involve a blur. This ensures that the display item boundaries include all the ink.
|
||||
pub static BLUR_INFLATION_FACTOR: i32 = 3;
|
||||
|
||||
#[derive(HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct DisplayList {
|
||||
pub list: Vec<DisplayItem>,
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ pub enum StackingContextType {
|
|||
PseudoFloat,
|
||||
}
|
||||
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
/// Represents one CSS stacking context, which may or may not have a hardware layer.
|
||||
pub struct StackingContext {
|
||||
/// The ID of this StackingContext for uniquely identifying it.
|
||||
|
@ -556,14 +556,14 @@ impl fmt::Debug for StackingContext {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum ScrollRootType {
|
||||
ScrollFrame(ScrollSensitivity),
|
||||
Clip,
|
||||
}
|
||||
|
||||
/// Defines a stacking context.
|
||||
#[derive(Clone, Debug, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct ScrollRoot {
|
||||
/// The WebRender clip id of this scroll root based on the source of this clip
|
||||
/// and information about the fragment.
|
||||
|
@ -671,7 +671,7 @@ impl BaseDisplayItem {
|
|||
/// A clipping region for a display item. Currently, this can describe rectangles, rounded
|
||||
/// rectangles (for `border-radius`), or arbitrary intersections of the two. Arbitrary transforms
|
||||
/// are not supported because those are handled by the higher-level `StackingContext` abstraction.
|
||||
#[derive(Clone, PartialEq, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub struct ClippingRegion {
|
||||
/// The main rectangular region. This does not include any corners.
|
||||
pub main: Rect<Au>,
|
||||
|
@ -685,7 +685,7 @@ pub struct ClippingRegion {
|
|||
/// A complex clipping region. These don't as easily admit arbitrary intersection operations, so
|
||||
/// they're stored in a list over to the side. Currently a complex clipping region is just a
|
||||
/// rounded rectangle, but the CSS WGs will probably make us throw more stuff in here eventually.
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub struct ComplexClippingRegion {
|
||||
/// The boundaries of the rectangle.
|
||||
pub rect: Rect<Au>,
|
||||
|
@ -855,7 +855,7 @@ impl ComplexClippingRegion {
|
|||
/// Metadata attached to each display item. This is useful for performing auxiliary threads with
|
||||
/// the display list involving hit testing: finding the originating DOM node and determining the
|
||||
/// cursor to use when the element is hovered over.
|
||||
#[derive(Clone, Copy, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct DisplayItemMetadata {
|
||||
/// The DOM node from which this display item originated.
|
||||
pub node: OpaqueNode,
|
||||
|
@ -865,7 +865,7 @@ pub struct DisplayItemMetadata {
|
|||
}
|
||||
|
||||
/// Paints a solid color.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct SolidColorDisplayItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -875,7 +875,7 @@ pub struct SolidColorDisplayItem {
|
|||
}
|
||||
|
||||
/// Paints text.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct TextDisplayItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -897,7 +897,7 @@ pub struct TextDisplayItem {
|
|||
pub orientation: TextOrientation,
|
||||
}
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum TextOrientation {
|
||||
Upright,
|
||||
SidewaysLeft,
|
||||
|
@ -905,7 +905,7 @@ pub enum TextOrientation {
|
|||
}
|
||||
|
||||
/// Paints an image.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct ImageDisplayItem {
|
||||
pub base: BaseDisplayItem,
|
||||
|
||||
|
@ -928,7 +928,7 @@ pub struct ImageDisplayItem {
|
|||
pub image_rendering: image_rendering::T,
|
||||
}
|
||||
/// Paints an iframe.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct IframeDisplayItem {
|
||||
pub base: BaseDisplayItem,
|
||||
pub iframe: PipelineId,
|
||||
|
@ -985,7 +985,7 @@ pub struct RadialGradientDisplayItem {
|
|||
}
|
||||
|
||||
/// A normal border, supporting CSS border styles.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct NormalBorder {
|
||||
/// Border colors.
|
||||
pub color: SideOffsets2D<ColorF>,
|
||||
|
@ -1000,7 +1000,7 @@ pub struct NormalBorder {
|
|||
}
|
||||
|
||||
/// A border that is made of image segments.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct ImageBorder {
|
||||
/// The image this border uses, border-image-source.
|
||||
pub image: WebRenderImageInfo,
|
||||
|
@ -1022,7 +1022,7 @@ pub struct ImageBorder {
|
|||
}
|
||||
|
||||
/// A border that is made of linear gradient
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct GradientBorder {
|
||||
/// The gradient info that this border uses, border-image-source.
|
||||
pub gradient: Gradient,
|
||||
|
@ -1032,7 +1032,7 @@ pub struct GradientBorder {
|
|||
}
|
||||
|
||||
/// A border that is made of radial gradient
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct RadialGradientBorder {
|
||||
/// The gradient info that this border uses, border-image-source.
|
||||
pub gradient: RadialGradient,
|
||||
|
@ -1042,7 +1042,7 @@ pub struct RadialGradientBorder {
|
|||
}
|
||||
|
||||
/// Specifies the type of border
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum BorderDetails {
|
||||
Normal(NormalBorder),
|
||||
Image(ImageBorder),
|
||||
|
@ -1051,7 +1051,7 @@ pub enum BorderDetails {
|
|||
}
|
||||
|
||||
/// Paints a border.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct BorderDisplayItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -1066,7 +1066,7 @@ pub struct BorderDisplayItem {
|
|||
/// Information about the border radii.
|
||||
///
|
||||
/// TODO(pcwalton): Elliptical radii.
|
||||
#[derive(Clone, PartialEq, Debug, Copy, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub struct BorderRadii<T> {
|
||||
pub top_left: Size2D<T>,
|
||||
pub top_right: Size2D<T>,
|
||||
|
@ -1128,7 +1128,7 @@ impl<T> BorderRadii<T> where T: PartialEq + Zero + Clone {
|
|||
}
|
||||
|
||||
/// Paints a line segment.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct LineDisplayItem {
|
||||
pub base: BaseDisplayItem,
|
||||
|
||||
|
@ -1141,7 +1141,7 @@ pub struct LineDisplayItem {
|
|||
}
|
||||
|
||||
/// Paints a box shadow per CSS-BACKGROUNDS.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct BoxShadowDisplayItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -1171,7 +1171,7 @@ pub struct BoxShadowDisplayItem {
|
|||
}
|
||||
|
||||
/// Defines a text shadow that affects all items until the paired PopTextShadow.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct PushTextShadowDisplayItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -1187,14 +1187,14 @@ pub struct PushTextShadowDisplayItem {
|
|||
}
|
||||
|
||||
/// Defines a text shadow that affects all items until the next PopTextShadow.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct PopTextShadowDisplayItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
}
|
||||
|
||||
/// Defines a stacking context.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct PushStackingContextItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -1203,7 +1203,7 @@ pub struct PushStackingContextItem {
|
|||
}
|
||||
|
||||
/// Defines a stacking context.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct PopStackingContextItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -1212,7 +1212,7 @@ pub struct PopStackingContextItem {
|
|||
}
|
||||
|
||||
/// Starts a group of items inside a particular scroll root.
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct DefineClipItem {
|
||||
/// Fields common to all display items.
|
||||
pub base: BaseDisplayItem,
|
||||
|
@ -1222,7 +1222,7 @@ pub struct DefineClipItem {
|
|||
}
|
||||
|
||||
/// How a box shadow should be clipped.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum BoxShadowClipMode {
|
||||
/// No special clipping should occur. This is used for (shadowed) text decorations.
|
||||
None,
|
||||
|
@ -1383,7 +1383,7 @@ impl fmt::Debug for DisplayItem {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct WebRenderImageInfo {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
|
|
|
@ -154,7 +154,7 @@ bitflags! {
|
|||
}
|
||||
|
||||
/// Various options that control text shaping.
|
||||
#[derive(Clone, Eq, PartialEq, Hash, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
pub struct ShapingOptions {
|
||||
/// Spacing to add between each letter. Corresponds to the CSS 2.1 `letter-spacing` property.
|
||||
/// NB: You will probably want to set the `IGNORE_LIGATURES_SHAPING_FLAG` if this is non-null.
|
||||
|
@ -168,7 +168,7 @@ pub struct ShapingOptions {
|
|||
}
|
||||
|
||||
/// An entry in the shape cache.
|
||||
#[derive(Clone, Eq, PartialEq, Hash, Debug)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
struct ShapeCacheEntry {
|
||||
text: String,
|
||||
options: ShapingOptions,
|
||||
|
|
|
@ -33,7 +33,7 @@ struct FontTemplates {
|
|||
templates: Vec<FontTemplate>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FontTemplateInfo {
|
||||
pub font_template: Arc<FontTemplateData>,
|
||||
pub font_key: Option<webrender_api::FontKey>,
|
||||
|
@ -102,7 +102,7 @@ impl FontTemplates {
|
|||
}
|
||||
|
||||
/// Commands that the FontContext sends to the font cache thread.
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum Command {
|
||||
GetFontTemplate(FontFamily, FontTemplateDescriptor, IpcSender<Reply>),
|
||||
GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender<Reply>),
|
||||
|
@ -112,7 +112,7 @@ pub enum Command {
|
|||
}
|
||||
|
||||
/// Reply messages sent from the font cache thread to the FontContext caller.
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum Reply {
|
||||
GetFontTemplateReply(Option<FontTemplateInfo>),
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ impl FontCache {
|
|||
|
||||
/// The public interface to the font cache thread, used exclusively by
|
||||
/// the per-thread/thread FontContext structures.
|
||||
#[derive(Clone, Deserialize, Serialize, Debug)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct FontCacheThread {
|
||||
chan: IpcSender<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 {
|
||||
inner: String,
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ use style::computed_values::{font_stretch, font_weight};
|
|||
/// to be expanded or refactored when we support more of the font styling parameters.
|
||||
///
|
||||
/// NB: If you change this, you will need to update `style::properties::compute_font_hash()`.
|
||||
#[derive(Clone, Copy, Eq, Hash, Deserialize, Serialize, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Serialize)]
|
||||
pub struct FontTemplateDescriptor {
|
||||
pub weight: font_weight::T,
|
||||
pub stretch: font_stretch::T,
|
||||
|
|
|
@ -11,7 +11,7 @@ use webrender_api::NativeFontHandle;
|
|||
/// The identifier is an absolute path, and the bytes
|
||||
/// field is the loaded data that can be passed to
|
||||
/// freetype and azure directly.
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FontTemplateData {
|
||||
pub bytes: Vec<u8>,
|
||||
pub identifier: Atom,
|
||||
|
|
|
@ -24,7 +24,7 @@ use webrender_api::NativeFontHandle;
|
|||
/// The identifier is a PostScript font name. The
|
||||
/// CTFont object is cached here for use by the
|
||||
/// paint functions that create CGFont references.
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FontTemplateData {
|
||||
/// The `CTFont` object, if present. This is cached here so that we don't have to keep creating
|
||||
/// `CTFont` instances over and over. It can always be recreated from the `identifier` and/or
|
||||
|
|
|
@ -7,7 +7,7 @@ use servo_atoms::Atom;
|
|||
use std::io;
|
||||
use webrender_api::NativeFontHandle;
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FontTemplateData {
|
||||
pub bytes: Option<Vec<u8>>,
|
||||
pub identifier: Atom,
|
||||
|
|
|
@ -21,7 +21,7 @@ pub use gfx_traits::ByteIndex;
|
|||
/// In the uncommon case (multiple glyphs per unicode character, large glyph index/advance, or
|
||||
/// glyph offsets), we pack the glyph count into GlyphEntry, and store the other glyph information
|
||||
/// in DetailedGlyphStore.
|
||||
#[derive(Clone, Debug, Copy, Deserialize, Serialize, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
|
||||
pub struct GlyphEntry {
|
||||
value: u32,
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ impl GlyphEntry {
|
|||
|
||||
// Stores data for a detailed glyph, in the case that several glyphs
|
||||
// correspond to one character, or the glyph's data couldn't be packed.
|
||||
#[derive(Clone, Debug, Copy, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
struct DetailedGlyph {
|
||||
id: GlyphId,
|
||||
// glyph's advance, in the text's direction (LTR or RTL)
|
||||
|
@ -166,7 +166,7 @@ impl DetailedGlyph {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Eq, Debug, Copy, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
|
||||
struct DetailedGlyphRecord {
|
||||
// source string offset/GlyphEntry offset in the TextRun
|
||||
entry_offset: ByteIndex,
|
||||
|
@ -308,7 +308,7 @@ impl<'a> DetailedGlyphStore {
|
|||
|
||||
// This struct is used by GlyphStore clients to provide new glyph data.
|
||||
// It should be allocated on the stack and passed by reference to GlyphStore.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct GlyphData {
|
||||
id: GlyphId,
|
||||
advance: Au,
|
||||
|
@ -339,7 +339,7 @@ impl GlyphData {
|
|||
// through glyphs (either for a particular TextRun offset, or all glyphs).
|
||||
// Rather than eagerly assembling and copying glyph data, it only retrieves
|
||||
// values as they are needed from the GlyphStore, using provided offsets.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum GlyphInfo<'a> {
|
||||
Simple(&'a GlyphStore, ByteIndex),
|
||||
Detail(&'a GlyphStore, ByteIndex, u16),
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum CompressionMode {
|
||||
CompressNone,
|
||||
CompressWhitespace,
|
||||
|
|
|
@ -18,7 +18,7 @@ use range::RangeIndex;
|
|||
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
||||
|
||||
/// A newtype struct for denoting the age of messages; prevents race conditions.
|
||||
#[derive(PartialEq, Eq, Debug, Copy, Clone, PartialOrd, Ord, Deserialize, Serialize, Hash)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct Epoch(pub u32);
|
||||
|
||||
impl Epoch {
|
||||
|
@ -62,7 +62,7 @@ int_range_index! {
|
|||
/// This can only ever grow to maximum 4 entries. That's because we cram the value of this enum
|
||||
/// into the lower 2 bits of the `StackingContextId`, which otherwise contains a 32-bit-aligned
|
||||
/// heap address.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Copy, Hash, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum FragmentType {
|
||||
/// A StackingContext for the fragment body itself.
|
||||
FragmentBody,
|
||||
|
|
|
@ -86,7 +86,7 @@ impl FloatedBlockInfo {
|
|||
}
|
||||
|
||||
/// The solutions for the block-size-and-margins constraint equation.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
struct BSizeConstraintSolution {
|
||||
block_start: Au,
|
||||
block_size: Au,
|
||||
|
@ -2196,7 +2196,7 @@ impl fmt::Debug for BlockFlow {
|
|||
}
|
||||
|
||||
/// The inputs for the inline-sizes-and-margins constraint equation.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct ISizeConstraintInput {
|
||||
pub computed_inline_size: MaybeAuto,
|
||||
pub inline_start_margin: MaybeAuto,
|
||||
|
@ -2229,7 +2229,7 @@ impl ISizeConstraintInput {
|
|||
}
|
||||
|
||||
/// The solutions for the inline-size-and-margins constraint equation.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct ISizeConstraintSolution {
|
||||
pub inline_start: Au,
|
||||
pub inline_size: Au,
|
||||
|
@ -3086,7 +3086,7 @@ impl ISizeAndMarginsComputer for InlineFlexItem {
|
|||
}
|
||||
|
||||
/// A stacking context, a pseudo-stacking context, or a non-stacking context.
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum BlockStackingContextType {
|
||||
NonstackingContext,
|
||||
PseudoStackingContext,
|
||||
|
|
|
@ -2915,7 +2915,7 @@ impl ComputedValuesCursorUtility for ComputedValues {
|
|||
}
|
||||
|
||||
// A helper data structure for gradients.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
struct StopRun {
|
||||
start_offset: f32,
|
||||
end_offset: f32,
|
||||
|
@ -2953,7 +2953,7 @@ impl ToGfxColor for RGBA {
|
|||
}
|
||||
|
||||
/// Describes how to paint the borders.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum BorderPaintingMode<'a> {
|
||||
/// Paint borders separately (`border-collapse: separate`).
|
||||
Separate,
|
||||
|
@ -2963,7 +2963,7 @@ pub enum BorderPaintingMode<'a> {
|
|||
Hidden,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum StackingContextCreationMode {
|
||||
Normal,
|
||||
PseudoPositioned,
|
||||
|
|
|
@ -13,7 +13,7 @@ use style::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
|||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
|
||||
/// The kind of float: left or right.
|
||||
#[derive(Clone, Serialize, Debug, Copy)]
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub enum FloatKind {
|
||||
Left,
|
||||
Right
|
||||
|
@ -30,7 +30,7 @@ impl FloatKind {
|
|||
}
|
||||
|
||||
/// The kind of clearance: left, right, or both.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum ClearType {
|
||||
Left,
|
||||
Right,
|
||||
|
@ -431,7 +431,7 @@ impl Floats {
|
|||
/// This is used for two purposes: (a) determining whether we can lay out blocks in parallel; (b)
|
||||
/// guessing the inline-sizes of block formatting contexts in an effort to lay them out in
|
||||
/// parallel.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct SpeculatedFloatPlacement {
|
||||
/// The estimated inline size (an upper bound) of the left floats flowing through this flow.
|
||||
pub left: Au,
|
||||
|
|
|
@ -559,7 +559,7 @@ pub trait MutableOwnedFlowUtils {
|
|||
absolute_descendants: &mut AbsoluteDescendants);
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Serialize, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize)]
|
||||
pub enum FlowClass {
|
||||
Block,
|
||||
Inline,
|
||||
|
@ -771,7 +771,7 @@ pub type AbsoluteDescendantOffsetIter<'a> = Zip<AbsoluteDescendantIter<'a>, Iter
|
|||
|
||||
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
||||
/// confused with absolutely-positioned flows) that is computed during block-size assignment.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct EarlyAbsolutePositionInfo {
|
||||
/// The size of the containing block for relatively-positioned descendants.
|
||||
pub relative_containing_block_size: LogicalSize<Au>,
|
||||
|
@ -793,7 +793,7 @@ impl EarlyAbsolutePositionInfo {
|
|||
|
||||
/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
|
||||
/// confused with absolutely-positioned flows) that is computed during final position assignment.
|
||||
#[derive(Serialize, Copy, Clone)]
|
||||
#[derive(Clone, Copy, Serialize)]
|
||||
pub struct LateAbsolutePositionInfo {
|
||||
/// The position of the absolute containing block relative to the nearest ancestor stacking
|
||||
/// context. If the absolute containing block establishes the stacking context for this flow,
|
||||
|
@ -809,7 +809,7 @@ impl LateAbsolutePositionInfo {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct FragmentationContext {
|
||||
pub available_block_size: Au,
|
||||
pub this_fragment_is_empty: bool,
|
||||
|
@ -1412,7 +1412,7 @@ impl ContainingBlockLink {
|
|||
|
||||
/// A wrapper for the pointer address of a flow. These pointer addresses may only be compared for
|
||||
/// equality with other such pointer addresses, never dereferenced.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub struct OpaqueFlow(pub usize);
|
||||
|
||||
impl OpaqueFlow {
|
||||
|
|
|
@ -13,7 +13,7 @@ use flow::Flow;
|
|||
use std::ops::Deref;
|
||||
use std::sync::{Arc, Weak};
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FlowRef(Arc<Flow>);
|
||||
|
||||
impl Deref for FlowRef {
|
||||
|
@ -55,7 +55,7 @@ impl FlowRef {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WeakFlowRef(Weak<Flow>);
|
||||
|
||||
impl WeakFlowRef {
|
||||
|
|
|
@ -574,7 +574,7 @@ impl ScannedTextFragmentInfo {
|
|||
|
||||
/// Describes how to split a fragment. This is used during line breaking as part of the return
|
||||
/// value of `find_split_info_for_inline_size()`.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct SplitInfo {
|
||||
// TODO(bjz): this should only need to be a single character index, but both values are
|
||||
// currently needed for splitting in the `inline::try_append_*` functions.
|
||||
|
@ -633,7 +633,7 @@ impl UnscannedTextFragmentInfo {
|
|||
}
|
||||
|
||||
/// A fragment that represents a table column.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct TableColumnFragmentInfo {
|
||||
/// the number of columns a <col> element should span
|
||||
pub span: u32,
|
||||
|
@ -3049,7 +3049,7 @@ pub trait FragmentBorderBoxIterator {
|
|||
|
||||
/// The coordinate system used in `stacking_relative_border_box()`. See the documentation of that
|
||||
/// method for details.
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum CoordinateSystem {
|
||||
/// The border box returned is relative to the fragment's parent stacking context.
|
||||
Parent,
|
||||
|
@ -3094,7 +3094,7 @@ impl<'a> InlineStyleIterator<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum WhitespaceStrippingResult {
|
||||
RetainFragment,
|
||||
FragmentContainedOnlyBidiControlCharacters,
|
||||
|
@ -3116,7 +3116,7 @@ impl WhitespaceStrippingResult {
|
|||
|
||||
/// The overflow area. We need two different notions of overflow: paint overflow and scrollable
|
||||
/// overflow.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Overflow {
|
||||
pub scroll: Rect<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.
|
||||
/// These are returned by `guess_inline_content_edge_offsets()` and are used in the float placement
|
||||
/// speculation logic.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct SpeculatedInlineContentEdgeOffsets {
|
||||
pub start: Au,
|
||||
pub end: Au,
|
||||
|
|
|
@ -63,7 +63,7 @@ use unicode_bidi as bidi;
|
|||
/// with a float or a horizontal wall of the containing block. The block-start
|
||||
/// inline-start corner of the green zone is the same as that of the line, but
|
||||
/// the green zone can be taller and wider than the line itself.
|
||||
#[derive(Serialize, Debug, Clone)]
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct Line {
|
||||
/// A range of line indices that describe line breaks.
|
||||
///
|
||||
|
@ -823,7 +823,7 @@ impl LineBreaker {
|
|||
}
|
||||
|
||||
/// Represents a list of inline fragments, including element ranges.
|
||||
#[derive(Serialize, Clone)]
|
||||
#[derive(Clone, Serialize)]
|
||||
pub struct InlineFragments {
|
||||
/// The fragments themselves.
|
||||
pub fragments: Vec<Fragment>,
|
||||
|
@ -1864,13 +1864,13 @@ impl InlineMetrics {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
enum LineFlushMode {
|
||||
No,
|
||||
Flush,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub struct LineMetrics {
|
||||
pub space_above_baseline: Au,
|
||||
pub space_below_baseline: Au,
|
||||
|
|
|
@ -18,7 +18,7 @@ use style::values::computed::{BorderCornerRadius, LengthOrPercentageOrAuto};
|
|||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrNone};
|
||||
|
||||
/// A collapsible margin. See CSS 2.1 § 8.3.1.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct AdjoiningMargins {
|
||||
/// The value of the greatest positive margin.
|
||||
pub most_positive: Au,
|
||||
|
@ -61,7 +61,7 @@ impl AdjoiningMargins {
|
|||
}
|
||||
|
||||
/// Represents the block-start and block-end margins of a flow with collapsible margins. See CSS 2.1 § 8.3.1.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum CollapsibleMargins {
|
||||
/// Margins may not collapse with this flow.
|
||||
None(Au, Au),
|
||||
|
@ -295,7 +295,7 @@ impl MarginCollapseInfo {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum MarginCollapseState {
|
||||
/// We are accumulating margin on the logical top of this flow.
|
||||
AccumulatingCollapsibleTopMargin,
|
||||
|
@ -304,7 +304,7 @@ pub enum MarginCollapseState {
|
|||
}
|
||||
|
||||
/// Intrinsic inline-sizes, which consist of minimum and preferred.
|
||||
#[derive(Serialize, Copy, Clone)]
|
||||
#[derive(Clone, Copy, Serialize)]
|
||||
pub struct IntrinsicISizes {
|
||||
/// The *minimum inline-size* of the content.
|
||||
pub minimum_inline_size: Au,
|
||||
|
@ -395,7 +395,7 @@ impl IntrinsicISizesContribution {
|
|||
}
|
||||
|
||||
/// Useful helper data type when computing values for blocks and positioned elements.
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum MaybeAuto {
|
||||
Auto,
|
||||
Specified(Au),
|
||||
|
|
|
@ -588,7 +588,7 @@ impl ISizeAndMarginsComputer for InternalTable {
|
|||
/// maximum of 100 pixels and 20% of the table), the preceding constraint means that we must
|
||||
/// potentially store both a specified width *and* a specified percentage, so that the inline-size
|
||||
/// assignment phase of layout will know which one to pick.
|
||||
#[derive(Clone, Serialize, Debug, Copy)]
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub struct ColumnIntrinsicInlineSize {
|
||||
/// The preferred intrinsic inline size.
|
||||
pub preferred: Au,
|
||||
|
@ -625,7 +625,7 @@ impl ColumnIntrinsicInlineSize {
|
|||
///
|
||||
/// TODO(pcwalton): There will probably be some `border-collapse`-related info in here too
|
||||
/// eventually.
|
||||
#[derive(Serialize, Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub struct ColumnComputedInlineSize {
|
||||
/// The computed size of this inline column.
|
||||
pub size: Au,
|
||||
|
|
|
@ -305,7 +305,7 @@ impl fmt::Debug for TableCellFlow {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub struct CollapsedBordersForCell {
|
||||
pub inline_start_border: CollapsedBorder,
|
||||
pub inline_end_border: CollapsedBorder,
|
||||
|
|
|
@ -73,7 +73,7 @@ impl Serialize for TableRowFlow {
|
|||
}
|
||||
|
||||
/// Information about the column inline size and span for each cell.
|
||||
#[derive(Serialize, Copy, Clone)]
|
||||
#[derive(Clone, Copy, Serialize)]
|
||||
pub struct CellIntrinsicInlineSize {
|
||||
/// Inline sizes that this cell contributes to the column.
|
||||
pub column_size: ColumnIntrinsicInlineSize,
|
||||
|
@ -571,7 +571,7 @@ impl CollapsedBorderSpacingForRow {
|
|||
}
|
||||
|
||||
/// All aspects of a border that can collapse with adjacent borders. See CSS 2.1 § 17.6.2.1.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct CollapsedBorder {
|
||||
/// The style of the border.
|
||||
pub style: border_top_style::T,
|
||||
|
@ -596,7 +596,7 @@ impl Serialize for CollapsedBorder {
|
|||
// FIXME(#8586): FromTableRow, FromTableRowGroup, FromTableColumn,
|
||||
// FromTableColumnGroup are unused
|
||||
#[allow(dead_code)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize)]
|
||||
pub enum CollapsedBorderProvenance {
|
||||
FromPreviousTableCell = 6,
|
||||
FromNextTableCell = 5,
|
||||
|
@ -906,7 +906,7 @@ fn set_inline_position_of_child_flow(
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct BorderCollapseInfoForChildTableCell<'a> {
|
||||
collapsed_borders_for_row: &'a CollapsedBordersForRow,
|
||||
collapsed_border_spacing_for_row: &'a CollapsedBorderSpacingForRow,
|
||||
|
|
|
@ -35,7 +35,7 @@ use style::values::CSSFloat;
|
|||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
|
||||
|
||||
#[derive(Copy, Clone, Serialize, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub enum TableLayout {
|
||||
Fixed,
|
||||
Auto
|
||||
|
@ -615,7 +615,7 @@ impl<'a> Add for &'a AutoLayoutCandidateGuess {
|
|||
|
||||
/// The `CSSFloat` member specifies the weight of the smaller of the two guesses, on a scale from
|
||||
/// 0.0 to 1.0.
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
enum SelectedAutoLayoutCandidateGuess {
|
||||
UseMinimumGuess,
|
||||
InterpolateBetweenMinimumGuessAndMinimumPercentageGuess(CSSFloat),
|
||||
|
|
|
@ -562,7 +562,7 @@ impl RunInfo {
|
|||
|
||||
/// A mapping from a portion of an unscanned text fragment to the text run we're going to create
|
||||
/// for it.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct RunMapping {
|
||||
/// The range of byte indices within the text fragment.
|
||||
byte_range: Range<usize>,
|
||||
|
|
|
@ -243,7 +243,7 @@ impl<'a> PostorderFlowTraversal for BubbleISizes<'a> {
|
|||
}
|
||||
|
||||
/// The assign-inline-sizes traversal. In Gecko this corresponds to `Reflow`.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct AssignISizes<'a> {
|
||||
pub layout_context: &'a LayoutContext<'a>,
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ impl<'a> PreorderFlowTraversal for AssignISizes<'a> {
|
|||
/// The assign-block-sizes-and-store-overflow traversal, the last (and most expensive) part of
|
||||
/// layout computation. Determines the final block-sizes for all layout objects and computes
|
||||
/// positions. In Gecko this corresponds to `Reflow`.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct AssignBSizes<'a> {
|
||||
pub layout_context: &'a LayoutContext<'a>,
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ pub unsafe fn drop_style_and_layout_data(data: OpaqueStyleAndLayoutData) {
|
|||
let _ = Box::from_raw(non_opaque);
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ServoLayoutNode<'a> {
|
||||
/// The wrapped node.
|
||||
node: LayoutJS<Node>,
|
||||
|
@ -329,7 +329,7 @@ impl<'ln> ServoLayoutNode<'ln> {
|
|||
}
|
||||
|
||||
// A wrapper around documents that ensures ayout can only ever access safe properties.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ServoLayoutDocument<'ld> {
|
||||
document: LayoutJS<Document>,
|
||||
chain: PhantomData<&'ld ()>,
|
||||
|
@ -374,7 +374,7 @@ impl<'ld> ServoLayoutDocument<'ld> {
|
|||
}
|
||||
|
||||
/// A wrapper around elements that ensures layout can only ever access safe properties.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ServoLayoutElement<'le> {
|
||||
element: LayoutJS<Element>,
|
||||
chain: PhantomData<&'le ()>,
|
||||
|
@ -810,7 +810,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct ServoThreadSafeLayoutNode<'ln> {
|
||||
/// The wrapped node.
|
||||
node: ServoLayoutNode<'ln>,
|
||||
|
@ -1103,7 +1103,7 @@ impl<ConcreteNode> Iterator for ThreadSafeLayoutNodeChildrenIterator<ConcreteNod
|
|||
|
||||
/// A wrapper around elements that ensures layout can only
|
||||
/// ever access safe properties and cannot race on elements.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct ServoThreadSafeLayoutElement<'le> {
|
||||
element: ServoLayoutElement<'le>,
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::cell::Cell;
|
|||
use std::fmt;
|
||||
use webrender_api;
|
||||
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
|
||||
pub enum KeyState {
|
||||
Pressed,
|
||||
Released,
|
||||
|
@ -17,7 +17,7 @@ pub enum KeyState {
|
|||
}
|
||||
|
||||
//N.B. Based on the glutin key enum
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum Key {
|
||||
Space,
|
||||
Apostrophe,
|
||||
|
@ -156,7 +156,7 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub enum TraversalDirection {
|
||||
Forward(usize),
|
||||
Back(usize),
|
||||
|
@ -217,13 +217,13 @@ impl PipelineNamespace {
|
|||
|
||||
thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = Cell::new(None));
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct PipelineNamespaceId(pub u32);
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct PipelineIndex(pub u32);
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct PipelineId {
|
||||
pub namespace_id: PipelineNamespaceId,
|
||||
pub index: PipelineIndex
|
||||
|
@ -262,10 +262,10 @@ impl fmt::Display for PipelineId {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct BrowsingContextIndex(pub u32);
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct BrowsingContextId {
|
||||
pub namespace_id: PipelineNamespaceId,
|
||||
pub index: BrowsingContextIndex
|
||||
|
@ -292,7 +292,7 @@ impl fmt::Display for BrowsingContextId {
|
|||
|
||||
thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrowsingContextId>> = Cell::new(None));
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct TopLevelBrowsingContextId(BrowsingContextId);
|
||||
|
||||
impl TopLevelBrowsingContextId {
|
||||
|
@ -342,7 +342,7 @@ pub const TEST_BROWSING_CONTEXT_INDEX: BrowsingContextIndex = BrowsingContextInd
|
|||
pub const TEST_BROWSING_CONTEXT_ID: BrowsingContextId =
|
||||
BrowsingContextId { namespace_id: TEST_NAMESPACE, index: TEST_BROWSING_CONTEXT_INDEX };
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum FrameType {
|
||||
IFrame,
|
||||
MozBrowserIFrame,
|
||||
|
|
|
@ -536,7 +536,7 @@ pub fn should_be_blocked_due_to_nosniff(request_type: Type, response_headers: &H
|
|||
///
|
||||
/// A [unit-like struct](https://doc.rust-lang.org/book/structs.html#unit-like-structs)
|
||||
/// is sufficient since a valid header implies that we use `nosniff`.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct XContentTypeOptions;
|
||||
|
||||
impl Header for XContentTypeOptions {
|
||||
|
|
|
@ -9,7 +9,7 @@ use url::Url;
|
|||
use uuid::Uuid;
|
||||
|
||||
/// Errors returned to Blob URL Store request
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum BlobURLStoreError {
|
||||
/// Invalid File UUID
|
||||
InvalidFileID,
|
||||
|
@ -22,7 +22,7 @@ pub enum BlobURLStoreError {
|
|||
}
|
||||
|
||||
/// Standalone blob buffer object
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct BlobBuf {
|
||||
pub filename: Option<String>,
|
||||
/// MIME type string
|
||||
|
|
|
@ -7,7 +7,7 @@ use piston_image::{self, DynamicImage, ImageFormat};
|
|||
use std::fmt;
|
||||
use webrender_api;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum PixelFormat {
|
||||
/// Luminance channel only
|
||||
K8,
|
||||
|
@ -19,7 +19,7 @@ pub enum PixelFormat {
|
|||
BGRA8,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct Image {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
|
@ -37,7 +37,7 @@ impl fmt::Debug for Image {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub struct ImageMetadata {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
|
|
|
@ -16,14 +16,14 @@ use webrender_api;
|
|||
/// Whether a consumer is in a position to request images or not. This can occur
|
||||
/// when animations are being processed by the layout thread while the script
|
||||
/// thread is executing in parallel.
|
||||
#[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
pub enum CanRequestImages {
|
||||
No,
|
||||
Yes,
|
||||
}
|
||||
|
||||
/// Indicating either entire image or just metadata availability
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum ImageOrMetadataAvailable {
|
||||
ImageAvailable(Arc<Image>, ServoUrl),
|
||||
MetadataAvailable(ImageMetadata),
|
||||
|
@ -60,7 +60,7 @@ impl ImageResponder {
|
|||
}
|
||||
|
||||
/// The returned image.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum ImageResponse {
|
||||
/// The requested image was loaded.
|
||||
Loaded(Arc<Image>, ServoUrl),
|
||||
|
@ -73,7 +73,7 @@ pub enum ImageResponse {
|
|||
}
|
||||
|
||||
/// The current state of an image in the cache.
|
||||
#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
pub enum ImageState {
|
||||
Pending(PendingImageId),
|
||||
LoadError,
|
||||
|
@ -81,7 +81,7 @@ pub enum ImageState {
|
|||
}
|
||||
|
||||
/// The unique id for an image that has previously been requested.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Deserialize, Serialize, HeapSizeOf, Hash, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub struct PendingImageId(pub u64);
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
|
@ -90,7 +90,7 @@ pub struct PendingImageResponse {
|
|||
pub id: PendingImageId,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Hash, Eq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||
pub enum UsePlaceholder {
|
||||
No,
|
||||
Yes,
|
||||
|
|
|
@ -62,7 +62,7 @@ pub mod image {
|
|||
|
||||
/// A loading context, for context-specific sniffing, as defined in
|
||||
/// https://mimesniff.spec.whatwg.org/#context-specific-sniffing
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum LoadContext {
|
||||
Browsing,
|
||||
Image,
|
||||
|
@ -75,7 +75,7 @@ pub enum LoadContext {
|
|||
CacheManifest,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct CustomResponse {
|
||||
#[ignore_heap_size_of = "Defined in hyper"]
|
||||
#[serde(deserialize_with = "::hyper_serde::deserialize",
|
||||
|
@ -185,7 +185,7 @@ pub trait FetchTaskTarget {
|
|||
fn process_response_eof(&mut self, response: &Response);
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub enum FilteredMetadata {
|
||||
Basic(Metadata),
|
||||
Cors(Metadata),
|
||||
|
@ -193,7 +193,7 @@ pub enum FilteredMetadata {
|
|||
OpaqueRedirect
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub enum FetchMetadata {
|
||||
Unfiltered(Metadata),
|
||||
Filtered {
|
||||
|
@ -276,7 +276,7 @@ pub trait IpcSend<T>
|
|||
// the "Arc" hack implicitly in future.
|
||||
// See discussion: http://logs.glob.uno/?c=mozilla%23servo&s=16+May+2016&e=16+May+2016#c430412
|
||||
// See also: https://github.com/servo/servo/blob/735480/components/script/script_thread.rs#L313
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub struct ResourceThreads {
|
||||
core_thread: CoreResourceThread,
|
||||
storage_thread: IpcSender<StorageThreadMsg>,
|
||||
|
@ -318,13 +318,13 @@ impl HeapSizeOf for ResourceThreads {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
pub enum IncludeSubdomains {
|
||||
Included,
|
||||
NotIncluded,
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum MessageData {
|
||||
Text(String),
|
||||
Binary(Vec<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();
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct ResourceCorsData {
|
||||
/// CORS Preflight flag
|
||||
pub preflight: bool,
|
||||
|
@ -406,7 +406,7 @@ pub struct ResourceCorsData {
|
|||
}
|
||||
|
||||
/// Metadata about a loaded resource, such as is obtained from HTTP headers.
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct Metadata {
|
||||
/// Final URL after redirects.
|
||||
pub final_url: ServoUrl,
|
||||
|
@ -475,7 +475,7 @@ impl Metadata {
|
|||
}
|
||||
|
||||
/// The creator of a given cookie
|
||||
#[derive(PartialEq, Copy, Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
pub enum CookieSource {
|
||||
/// An HTTP API
|
||||
HTTP,
|
||||
|
@ -511,11 +511,11 @@ pub fn load_whole_resource(request: RequestInit,
|
|||
}
|
||||
|
||||
/// An unique identifier to keep track of each load message in the resource handler
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub struct ResourceId(pub u32);
|
||||
|
||||
/// Network errors that have to be exported out of the loaders
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum NetworkError {
|
||||
/// Could be any of the internal errors, like unsupported scheme, connection errors, etc.
|
||||
Internal(String),
|
||||
|
|
|
@ -20,7 +20,7 @@ use std::collections::HashSet;
|
|||
use std::iter::FromIterator;
|
||||
use std::str::from_utf8;
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct PubDomainRules {
|
||||
rules: HashSet<String>,
|
||||
wildcards: HashSet<String>,
|
||||
|
|
|
@ -10,7 +10,7 @@ use servo_url::{ImmutableOrigin, ServoUrl};
|
|||
use std::default::Default;
|
||||
|
||||
/// An [initiator](https://fetch.spec.whatwg.org/#concept-request-initiator)
|
||||
#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum Initiator {
|
||||
None,
|
||||
Download,
|
||||
|
@ -20,7 +20,7 @@ pub enum Initiator {
|
|||
}
|
||||
|
||||
/// A request [type](https://fetch.spec.whatwg.org/#concept-request-type)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum Type {
|
||||
None,
|
||||
Audio,
|
||||
|
@ -33,7 +33,7 @@ pub enum Type {
|
|||
}
|
||||
|
||||
/// A request [destination](https://fetch.spec.whatwg.org/#concept-request-destination)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum Destination {
|
||||
None,
|
||||
Document,
|
||||
|
@ -53,14 +53,14 @@ pub enum Destination {
|
|||
}
|
||||
|
||||
/// A request [origin](https://fetch.spec.whatwg.org/#concept-request-origin)
|
||||
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum Origin {
|
||||
Client,
|
||||
Origin(ImmutableOrigin),
|
||||
}
|
||||
|
||||
/// A [referer](https://fetch.spec.whatwg.org/#concept-request-referrer)
|
||||
#[derive(Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum Referrer {
|
||||
NoReferrer,
|
||||
/// Default referrer if nothing is specified
|
||||
|
@ -69,7 +69,7 @@ pub enum Referrer {
|
|||
}
|
||||
|
||||
/// A [request mode](https://fetch.spec.whatwg.org/#concept-request-mode)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum RequestMode {
|
||||
Navigate,
|
||||
SameOrigin,
|
||||
|
@ -79,7 +79,7 @@ pub enum RequestMode {
|
|||
}
|
||||
|
||||
/// Request [credentials mode](https://fetch.spec.whatwg.org/#concept-request-credentials-mode)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum CredentialsMode {
|
||||
Omit,
|
||||
CredentialsSameOrigin,
|
||||
|
@ -87,7 +87,7 @@ pub enum CredentialsMode {
|
|||
}
|
||||
|
||||
/// [Cache mode](https://fetch.spec.whatwg.org/#concept-request-cache-mode)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum CacheMode {
|
||||
Default,
|
||||
NoStore,
|
||||
|
@ -98,7 +98,7 @@ pub enum CacheMode {
|
|||
}
|
||||
|
||||
/// [Service-workers mode](https://fetch.spec.whatwg.org/#request-service-workers-mode)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum ServiceWorkersMode {
|
||||
All,
|
||||
Foreign,
|
||||
|
@ -106,7 +106,7 @@ pub enum ServiceWorkersMode {
|
|||
}
|
||||
|
||||
/// [Redirect mode](https://fetch.spec.whatwg.org/#concept-request-redirect-mode)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum RedirectMode {
|
||||
Follow,
|
||||
Error,
|
||||
|
@ -114,7 +114,7 @@ pub enum RedirectMode {
|
|||
}
|
||||
|
||||
/// [Response tainting](https://fetch.spec.whatwg.org/#concept-request-response-tainting)
|
||||
#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum ResponseTainting {
|
||||
Basic,
|
||||
CorsTainting,
|
||||
|
@ -122,20 +122,20 @@ pub enum ResponseTainting {
|
|||
}
|
||||
|
||||
/// [Window](https://fetch.spec.whatwg.org/#concept-request-window)
|
||||
#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum Window {
|
||||
NoWindow,
|
||||
Client, // TODO: Environmental settings object
|
||||
}
|
||||
|
||||
/// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
pub enum CorsSettings {
|
||||
Anonymous,
|
||||
UseCredentials,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct RequestInit {
|
||||
#[serde(deserialize_with = "::hyper_serde::deserialize",
|
||||
serialize_with = "::hyper_serde::serialize")]
|
||||
|
|
|
@ -13,7 +13,7 @@ use std::ascii::AsciiExt;
|
|||
use std::sync::{Arc, Mutex};
|
||||
|
||||
/// [Response type](https://fetch.spec.whatwg.org/#concept-response-type)
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum ResponseType {
|
||||
Basic,
|
||||
Cors,
|
||||
|
@ -24,7 +24,7 @@ pub enum ResponseType {
|
|||
}
|
||||
|
||||
/// [Response termination reason](https://fetch.spec.whatwg.org/#concept-response-termination-reason)
|
||||
#[derive(Debug, Clone, Copy, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum TerminationReason {
|
||||
EndUserAbort,
|
||||
Fatal,
|
||||
|
@ -33,7 +33,7 @@ pub enum TerminationReason {
|
|||
|
||||
/// The response body can still be pushed to after fetch
|
||||
/// This provides a way to store unfinished response bodies
|
||||
#[derive(Clone, Debug, PartialEq, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, HeapSizeOf, PartialEq)]
|
||||
pub enum ResponseBody {
|
||||
Empty, // XXXManishearth is this necessary, or is Done(vec![]) enough?
|
||||
Receiving(Vec<u8>),
|
||||
|
@ -52,7 +52,7 @@ impl ResponseBody {
|
|||
|
||||
|
||||
/// [Cache state](https://fetch.spec.whatwg.org/#concept-response-cache-state)
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum CacheState {
|
||||
None,
|
||||
Local,
|
||||
|
@ -61,7 +61,7 @@ pub enum CacheState {
|
|||
}
|
||||
|
||||
/// [Https state](https://fetch.spec.whatwg.org/#concept-response-https-state)
|
||||
#[derive(Debug, Clone, Copy, HeapSizeOf, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum HttpsState {
|
||||
None,
|
||||
Deprecated,
|
||||
|
@ -74,7 +74,7 @@ pub enum ResponseMsg {
|
|||
Errored,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct ResponseInit {
|
||||
pub url: ServoUrl,
|
||||
#[serde(deserialize_with = "::hyper_serde::deserialize",
|
||||
|
@ -86,7 +86,7 @@ pub struct ResponseInit {
|
|||
}
|
||||
|
||||
/// A [Response](https://fetch.spec.whatwg.org/#concept-response) as defined by the Fetch spec
|
||||
#[derive(Debug, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, HeapSizeOf)]
|
||||
pub struct Response {
|
||||
pub response_type: ResponseType,
|
||||
pub termination_reason: Option<TerminationReason>,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
use ipc_channel::ipc::IpcSender;
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum StorageType {
|
||||
Session,
|
||||
Local,
|
||||
|
|
|
@ -10,7 +10,7 @@ use self::std_time::precise_time_ns;
|
|||
use servo_config::opts;
|
||||
use signpost;
|
||||
|
||||
#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct TimerMetadata {
|
||||
pub url: String,
|
||||
pub iframe: TimerMetadataFrameType,
|
||||
|
@ -39,7 +39,7 @@ pub enum ProfilerMsg {
|
|||
}
|
||||
|
||||
#[repr(u32)]
|
||||
#[derive(PartialEq, Clone, Copy, PartialOrd, Eq, Ord, Deserialize, Serialize, Debug, Hash)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub enum ProfilerCategory {
|
||||
Compositing = 0x00,
|
||||
LayoutPerform = 0x10,
|
||||
|
@ -95,13 +95,13 @@ pub enum ProfilerCategory {
|
|||
ApplicationHeartbeat = 0x90,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub enum TimerMetadataFrameType {
|
||||
RootWindow,
|
||||
IFrame,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub enum TimerMetadataReflowType {
|
||||
Incremental,
|
||||
FirstReflow,
|
||||
|
|
|
@ -78,7 +78,7 @@ impl RangeIndex for usize {
|
|||
#[macro_export]
|
||||
macro_rules! int_range_index {
|
||||
($(#[$attr:meta])* struct $Self_:ident($T:ty)) => (
|
||||
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Copy)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||
$(#[$attr])*
|
||||
pub struct $Self_(pub $T);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
|
|||
|
||||
// TODO: can we use the thread-id crate for this?
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct ThreadId(NonZero<usize>);
|
||||
|
||||
lazy_static!{ static ref THREAD_COUNT: AtomicUsize = AtomicUsize::new(1); }
|
||||
|
|
|
@ -22,7 +22,7 @@ use std::rc::Rc;
|
|||
use std::str;
|
||||
use url::form_urlencoded;
|
||||
|
||||
#[derive(Copy, Clone, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
|
||||
pub enum BodyType {
|
||||
Blob,
|
||||
FormData,
|
||||
|
|
|
@ -59,7 +59,7 @@ fn main() {
|
|||
write!(&mut phf, ";\n").unwrap();
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(Eq, Hash, PartialEq)]
|
||||
struct Bytes<'a>(&'a str);
|
||||
|
||||
impl<'a> fmt::Debug for Bytes<'a> {
|
||||
|
|
|
@ -13,7 +13,7 @@ use net_traits::request::RequestInit;
|
|||
use servo_url::ServoUrl;
|
||||
use std::thread;
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Clone, Debug, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum LoadType {
|
||||
Image(ServoUrl),
|
||||
Script(ServoUrl),
|
||||
|
@ -39,7 +39,7 @@ impl LoadType {
|
|||
/// Canary value ensuring that manually added blocking loads (ie. ones that weren't
|
||||
/// created via DocumentLoader::fetch_async) are always removed by the time
|
||||
/// that the owner is destroyed.
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
pub struct LoadBlocker {
|
||||
/// The document whose load event is blocked by this object existing.
|
||||
|
@ -80,7 +80,7 @@ impl Drop for LoadBlocker {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub struct DocumentLoader {
|
||||
resource_threads: ResourceThreads,
|
||||
blocking_loads: Vec<LoadType>,
|
||||
|
|
|
@ -29,7 +29,7 @@ impl<T: DomObject> SimpleWorkerErrorHandler<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct SharedRt {
|
||||
rt: *mut JSRuntime
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ use std::sync::mpsc::{Receiver, Sender};
|
|||
/// A ScriptChan that can be cloned freely and will silently send a TrustedWorkerAddress with
|
||||
/// common event loop messages. While this SendableWorkerScriptChan is alive, the associated
|
||||
/// Worker object will remain alive.
|
||||
#[derive(JSTraceable, Clone)]
|
||||
#[derive(Clone, JSTraceable)]
|
||||
pub struct SendableWorkerScriptChan<T: DomObject> {
|
||||
pub sender: Sender<(Trusted<T>, CommonScriptMsg)>,
|
||||
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
|
||||
/// worker event loop messages. While this SendableWorkerScriptChan is alive, the associated
|
||||
/// Worker object will remain alive.
|
||||
#[derive(JSTraceable, Clone)]
|
||||
#[derive(Clone, JSTraceable)]
|
||||
pub struct WorkerThreadWorkerChan<T: DomObject> {
|
||||
pub sender: Sender<(Trusted<T>, WorkerScriptMsg)>,
|
||||
pub worker: Trusted<T>,
|
||||
|
|
|
@ -25,7 +25,7 @@ use std::ptr;
|
|||
use std::rc::Rc;
|
||||
|
||||
/// The exception handling used for a call.
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum ExceptionHandling {
|
||||
/// Report any exception and don't throw it to the caller code.
|
||||
Report,
|
||||
|
|
|
@ -170,7 +170,7 @@ impl ToJSValConvertible for USVString {
|
|||
}
|
||||
|
||||
/// Behavior for stringification of `JSVal`s.
|
||||
#[derive(PartialEq, Clone)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub enum StringificationBehavior {
|
||||
/// Convert `null` to the string `"null"`.
|
||||
Default,
|
||||
|
|
|
@ -25,7 +25,7 @@ use libc::c_uint;
|
|||
use std::slice::from_raw_parts;
|
||||
|
||||
/// DOM exceptions that can be thrown by a native DOM method.
|
||||
#[derive(Debug, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Debug, HeapSizeOf)]
|
||||
pub enum Error {
|
||||
/// IndexSizeError DOMException
|
||||
IndexSize,
|
||||
|
|
|
@ -108,7 +108,7 @@ use script_thread::ScriptThread;
|
|||
use std::ptr;
|
||||
|
||||
/// The class of a non-callback interface object.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct NonCallbackInterfaceObjectClass {
|
||||
/// The SpiderMonkey Class structure.
|
||||
pub class: Class,
|
||||
|
|
|
@ -22,7 +22,7 @@ use std::cell::Cell;
|
|||
use std::ptr;
|
||||
|
||||
/// The values that an iterator will iterate over.
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub enum IteratorType {
|
||||
/// The keys of the iterable object.
|
||||
Keys,
|
||||
|
|
|
@ -11,7 +11,7 @@ use libc;
|
|||
use std::ptr;
|
||||
|
||||
/// The class of a namespace object.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct NamespaceObjectClass(JSClass);
|
||||
|
||||
unsafe impl Sync for NamespaceObjectClass {}
|
||||
|
|
|
@ -9,7 +9,7 @@ use num_traits::Float;
|
|||
use std::ops::Deref;
|
||||
|
||||
/// Encapsulates the IDL restricted float type.
|
||||
#[derive(JSTraceable, Clone, Copy, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Eq, JSTraceable, PartialEq)]
|
||||
pub struct Finite<T: Float>(T);
|
||||
|
||||
impl<T: Float> Finite<T> {
|
||||
|
|
|
@ -15,7 +15,7 @@ use std::thread;
|
|||
|
||||
thread_local!(static STACK: RefCell<Vec<StackEntry>> = RefCell::new(Vec::new()));
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, JSTraceable)]
|
||||
#[derive(Debug, Eq, JSTraceable, PartialEq)]
|
||||
enum StackEntryKind {
|
||||
Incumbent,
|
||||
Entry,
|
||||
|
|
|
@ -18,7 +18,7 @@ use std::str;
|
|||
use std::str::{Bytes, FromStr};
|
||||
|
||||
/// Encapsulates the IDL `ByteString` type.
|
||||
#[derive(JSTraceable, Clone, Eq, PartialEq, HeapSizeOf, Debug)]
|
||||
#[derive(Clone, Debug, Eq, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub struct ByteString(Vec<u8>);
|
||||
|
||||
impl ByteString {
|
||||
|
|
|
@ -47,7 +47,7 @@ impl HeapSizeOf for WindowProxyHandler {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
/// Static data associated with a global object.
|
||||
pub struct GlobalStaticData {
|
||||
/// The WindowProxy proxy handler for this global.
|
||||
|
@ -79,7 +79,7 @@ pub const JSCLASS_DOM_GLOBAL: u32 = js::JSCLASS_USERBIT1;
|
|||
|
||||
|
||||
/// The struct that holds inheritance information for DOM object reflectors.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct DOMClass {
|
||||
/// A list of interfaces that this object implements, in order of decreasing
|
||||
/// derivedness.
|
||||
|
|
|
@ -24,7 +24,7 @@ pub struct CanvasGradient {
|
|||
stops: DOMRefCell<Vec<CanvasGradientStop>>,
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
pub enum CanvasGradientStyle {
|
||||
Linear(LinearGradientStyle),
|
||||
Radial(RadialGradientStyle),
|
||||
|
|
|
@ -51,7 +51,7 @@ use std::sync::Arc;
|
|||
use unpremultiplytable::UNPREMULTIPLY_TABLE;
|
||||
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
#[allow(dead_code)]
|
||||
enum CanvasFillOrStrokeStyle {
|
||||
Color(RGBA),
|
||||
|
@ -81,7 +81,7 @@ pub struct CanvasRenderingContext2D {
|
|||
}
|
||||
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
struct CanvasContextState {
|
||||
global_alpha: f64,
|
||||
global_composition: CompositionOrBlending,
|
||||
|
|
|
@ -154,7 +154,7 @@ impl CSSStyleOwner {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, PartialEq)]
|
||||
pub enum CSSModificationAccess {
|
||||
ReadWrite,
|
||||
Readonly,
|
||||
|
|
|
@ -372,7 +372,7 @@ impl CustomElementRegistryMethods for CustomElementRegistry {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf, JSTraceable, Clone)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
pub struct LifecycleCallbacks {
|
||||
#[ignore_heap_size_of = "Rc"]
|
||||
connected_callback: Option<Rc<Function>>,
|
||||
|
@ -387,14 +387,14 @@ pub struct LifecycleCallbacks {
|
|||
attribute_changed_callback: Option<Rc<Function>>,
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf, JSTraceable, Clone)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
pub enum ConstructionStackEntry {
|
||||
Element(Root<Element>),
|
||||
AlreadyConstructedMarker,
|
||||
}
|
||||
|
||||
/// https://html.spec.whatwg.org/multipage/#custom-element-definition
|
||||
#[derive(HeapSizeOf, JSTraceable, Clone)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
pub struct CustomElementDefinition {
|
||||
pub name: LocalName,
|
||||
|
||||
|
@ -620,7 +620,7 @@ pub enum CallbackReaction {
|
|||
}
|
||||
|
||||
/// https://html.spec.whatwg.org/multipage/#processing-the-backup-element-queue
|
||||
#[derive(HeapSizeOf, JSTraceable, Eq, PartialEq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Eq, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
enum BackupElementQueueFlag {
|
||||
Processing,
|
||||
NotProcessing,
|
||||
|
|
|
@ -193,7 +193,7 @@ impl PendingRestyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
struct StyleSheetInDocument {
|
||||
#[ignore_heap_size_of = "Arc"]
|
||||
|
@ -353,7 +353,7 @@ pub struct Document {
|
|||
form_id_listener_map: DOMRefCell<HashMap<Atom, HashSet<JS<Element>>>>,
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct ImagesFilter;
|
||||
impl CollectionFilter for ImagesFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -361,7 +361,7 @@ impl CollectionFilter for ImagesFilter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct EmbedsFilter;
|
||||
impl CollectionFilter for EmbedsFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -369,7 +369,7 @@ impl CollectionFilter for EmbedsFilter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct LinksFilter;
|
||||
impl CollectionFilter for LinksFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -378,7 +378,7 @@ impl CollectionFilter for LinksFilter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct FormsFilter;
|
||||
impl CollectionFilter for FormsFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -386,7 +386,7 @@ impl CollectionFilter for FormsFilter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct ScriptsFilter;
|
||||
impl CollectionFilter for ScriptsFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -394,7 +394,7 @@ impl CollectionFilter for ScriptsFilter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct AnchorsFilter;
|
||||
impl CollectionFilter for AnchorsFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -402,7 +402,7 @@ impl CollectionFilter for AnchorsFilter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct AppletsFilter;
|
||||
impl CollectionFilter for AppletsFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -2027,7 +2027,7 @@ impl Document {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, PartialEq)]
|
||||
pub enum DocumentSource {
|
||||
FromParser,
|
||||
NotFromParser,
|
||||
|
@ -2141,7 +2141,7 @@ fn url_has_network_scheme(url: &ServoUrl) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, HeapSizeOf, JSTraceable, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Eq, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum HasBrowsingContext {
|
||||
No,
|
||||
Yes,
|
||||
|
@ -3513,7 +3513,7 @@ impl DocumentMethods for Document {
|
|||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
|
||||
unsafe fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonZero<*mut JSObject>> {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct NamedElementFilter {
|
||||
name: Atom,
|
||||
}
|
||||
|
@ -4033,7 +4033,7 @@ impl Runnable for DocumentProgressHandler {
|
|||
}
|
||||
|
||||
/// Specifies the type of focus event that is sent to a pipeline
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum FocusType {
|
||||
Element, // The first focus message - focus the element itself
|
||||
Parent, // Focusing a parent element (an iframe)
|
||||
|
@ -4051,7 +4051,7 @@ pub enum FocusEventType {
|
|||
/// If the page is observed to be using `requestAnimationFrame()` for non-animation purposes (i.e.
|
||||
/// without mutating the DOM), then we fall back to simple timeouts to save energy over video
|
||||
/// refresh.
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub struct FakeRequestAnimationFrameCallback {
|
||||
/// The document.
|
||||
#[ignore_heap_size_of = "non-owning"]
|
||||
|
|
|
@ -12,7 +12,7 @@ use dom::globalscope::GlobalScope;
|
|||
use dom_struct::dom_struct;
|
||||
|
||||
#[repr(u16)]
|
||||
#[derive(JSTraceable, Copy, Clone, Debug, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable)]
|
||||
pub enum DOMErrorName {
|
||||
IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR,
|
||||
HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR,
|
||||
|
|
|
@ -170,7 +170,7 @@ impl fmt::Debug for Root<Element> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, PartialEq)]
|
||||
pub enum ElementCreator {
|
||||
ParserCreated(u64),
|
||||
ScriptCreated,
|
||||
|
@ -182,7 +182,7 @@ pub enum CustomElementCreationMode {
|
|||
}
|
||||
|
||||
/// https://dom.spec.whatwg.org/#concept-element-custom-element-state
|
||||
#[derive(Clone, Copy, PartialEq, Eq, HeapSizeOf, JSTraceable)]
|
||||
#[derive(Clone, Copy, Eq, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum CustomElementState {
|
||||
Undefined,
|
||||
Failed,
|
||||
|
@ -2981,7 +2981,7 @@ impl<'a> AttributeMutation<'a> {
|
|||
/// A holder for an element's "tag name", which will be lazily
|
||||
/// resolved and cached. Should be reset when the document
|
||||
/// owner changes.
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct TagName {
|
||||
ptr: DOMRefCell<Option<LocalName>>,
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ impl EventMethods for Event {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, HeapSizeOf, Copy, Clone)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum EventBubbles {
|
||||
Bubbles,
|
||||
DoesNotBubble
|
||||
|
@ -318,7 +318,7 @@ impl From<EventBubbles> for bool {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, HeapSizeOf, Copy, Clone)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum EventCancelable {
|
||||
Cancelable,
|
||||
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)]
|
||||
#[derive(HeapSizeOf)]
|
||||
pub enum EventPhase {
|
||||
|
@ -363,7 +363,7 @@ pub enum EventPhase {
|
|||
///
|
||||
/// [msg]: https://doc.servo.org/script_traits/enum.ConstellationMsg.html#variant.KeyEvent
|
||||
///
|
||||
#[derive(JSTraceable, HeapSizeOf, Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum EventDefault {
|
||||
/// The default action of the event is allowed (constructor's default)
|
||||
Allowed,
|
||||
|
|
|
@ -43,10 +43,10 @@ header! { (LastEventId, "Last-Event-ID") => [String] }
|
|||
|
||||
const DEFAULT_RECONNECTION_TIME: u64 = 5000;
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
struct GenerationId(u32);
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
/// https://html.spec.whatwg.org/multipage/#dom-eventsource-readystate
|
||||
enum ReadyState {
|
||||
Connecting = 0,
|
||||
|
@ -535,7 +535,7 @@ impl Runnable for ReestablishConnectionRunnable {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub struct EventSourceTimeoutCallback {
|
||||
#[ignore_heap_size_of = "Because it is non-owning"]
|
||||
event_source: Trusted<EventSource>,
|
||||
|
|
|
@ -44,7 +44,7 @@ use std::ops::{Deref, DerefMut};
|
|||
use std::ptr;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[derive(PartialEq, Clone, JSTraceable)]
|
||||
#[derive(Clone, JSTraceable, PartialEq)]
|
||||
pub enum CommonEventHandler {
|
||||
EventHandler(Rc<EventHandlerNonNull>),
|
||||
ErrorEventHandler(Rc<OnErrorEventHandlerNonNull>),
|
||||
|
@ -61,14 +61,14 @@ impl CommonEventHandler {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, Copy, Clone, PartialEq, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum ListenerPhase {
|
||||
Capturing,
|
||||
Bubbling,
|
||||
}
|
||||
|
||||
/// https://html.spec.whatwg.org/multipage/#internal-raw-uncompiled-handler
|
||||
#[derive(JSTraceable, Clone, PartialEq)]
|
||||
#[derive(Clone, JSTraceable, PartialEq)]
|
||||
struct InternalRawUncompiledHandler {
|
||||
source: DOMString,
|
||||
url: ServoUrl,
|
||||
|
@ -76,7 +76,7 @@ struct InternalRawUncompiledHandler {
|
|||
}
|
||||
|
||||
/// A representation of an event handler, either compiled or uncompiled raw source, or null.
|
||||
#[derive(JSTraceable, PartialEq, Clone)]
|
||||
#[derive(Clone, JSTraceable, PartialEq)]
|
||||
enum InlineEventListener {
|
||||
Uncompiled(InternalRawUncompiledHandler),
|
||||
Compiled(CommonEventHandler),
|
||||
|
@ -106,7 +106,7 @@ impl InlineEventListener {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, Clone, PartialEq)]
|
||||
#[derive(Clone, JSTraceable, PartialEq)]
|
||||
enum EventListenerType {
|
||||
Additive(Rc<EventListener>),
|
||||
Inline(InlineEventListener),
|
||||
|
@ -228,7 +228,7 @@ struct EventListenerEntry {
|
|||
listener: EventListenerType
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
/// A mix of potentially uncompiled and compiled event listeners of the same type.
|
||||
struct EventListeners(Vec<EventListenerEntry>);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ use std::thread;
|
|||
use task_source::TaskSource;
|
||||
use task_source::file_reading::{FileReadingTaskSource, FileReadingRunnable, FileReadingTask};
|
||||
|
||||
#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum FileReaderFunction {
|
||||
ReadAsText,
|
||||
ReadAsDataUrl,
|
||||
|
@ -66,11 +66,11 @@ impl ReadMetaData {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Copy, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub struct GenerationId(u32);
|
||||
|
||||
#[repr(u16)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum FileReaderReadyState {
|
||||
Empty = FileReaderConstants::EMPTY,
|
||||
Loading = FileReaderConstants::LOADING,
|
||||
|
|
|
@ -26,7 +26,7 @@ pub struct Headers {
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-headers-guard
|
||||
#[derive(Copy, Clone, JSTraceable, HeapSizeOf, PartialEq)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum Guard {
|
||||
Immutable,
|
||||
Request,
|
||||
|
|
|
@ -29,7 +29,7 @@ use std::cell::Cell;
|
|||
use std::default::Default;
|
||||
use style::element_state::*;
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Copy, Clone)]
|
||||
#[derive(Clone, Copy, JSTraceable, PartialEq)]
|
||||
#[derive(HeapSizeOf)]
|
||||
enum ButtonType {
|
||||
Submit,
|
||||
|
|
|
@ -42,7 +42,7 @@ const DEFAULT_WIDTH: u32 = 300;
|
|||
const DEFAULT_HEIGHT: u32 = 150;
|
||||
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
pub enum CanvasContext {
|
||||
Context2d(JS<CanvasRenderingContext2D>),
|
||||
WebGL(JS<WebGLRenderingContext>),
|
||||
|
|
|
@ -26,7 +26,7 @@ pub trait CollectionFilter : JSTraceable {
|
|||
// An optional u32, using maxint to represent None.
|
||||
// It would be nicer just to use Option<u32> for this, but that would produce word
|
||||
// alignment issues since Option<u32> uses 33 bits.
|
||||
#[derive(Clone, Copy, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
|
||||
struct OptionU32 {
|
||||
bits: u32,
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ impl HTMLCollection {
|
|||
-> Root<HTMLCollection> {
|
||||
// case 1
|
||||
if qualified_name == local_name!("*") {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct AllFilter;
|
||||
impl CollectionFilter for AllFilter {
|
||||
fn filter(&self, _elem: &Element, _root: &Node) -> bool {
|
||||
|
@ -129,7 +129,7 @@ impl HTMLCollection {
|
|||
return HTMLCollection::create(window, root, box AllFilter);
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct HtmlDocumentFilter {
|
||||
qualified_name: LocalName,
|
||||
ascii_lower_qualified_name: LocalName,
|
||||
|
@ -169,7 +169,7 @@ impl HTMLCollection {
|
|||
}
|
||||
|
||||
pub fn by_qual_tag_name(window: &Window, root: &Node, qname: QualName) -> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct TagNameNSFilter {
|
||||
qname: QualName
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ impl HTMLCollection {
|
|||
|
||||
pub fn by_atomic_class_name(window: &Window, root: &Node, classes: Vec<Atom>)
|
||||
-> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct ClassNameFilter {
|
||||
classes: Vec<Atom>
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ impl HTMLCollection {
|
|||
}
|
||||
|
||||
pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct ElementChildFilter;
|
||||
impl CollectionFilter for ElementChildFilter {
|
||||
fn filter(&self, elem: &Element, root: &Node) -> bool {
|
||||
|
|
|
@ -43,7 +43,7 @@ impl HTMLDataListElement {
|
|||
impl HTMLDataListElementMethods for HTMLDataListElement {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-datalist-options
|
||||
fn Options(&self) -> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct HTMLDataListOptionsFilter;
|
||||
impl CollectionFilter for HTMLDataListOptionsFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
|
|
|
@ -52,7 +52,7 @@ impl HTMLFieldSetElement {
|
|||
impl HTMLFieldSetElementMethods for HTMLFieldSetElement {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-fieldset-elements
|
||||
fn Elements(&self) -> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct ElementsFilter;
|
||||
impl CollectionFilter for ElementsFilter {
|
||||
fn filter<'a>(&self, elem: &'a Element, _root: &'a Node) -> bool {
|
||||
|
|
|
@ -59,7 +59,7 @@ use style::attr::AttrValue;
|
|||
use style::str::split_html_space_chars;
|
||||
use task_source::TaskSource;
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub struct GenerationId(u32);
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -172,7 +172,7 @@ impl HTMLFormElementMethods for HTMLFormElement {
|
|||
return elements;
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct ElementsFilter {
|
||||
form: Root<HTMLFormElement>
|
||||
}
|
||||
|
@ -241,13 +241,13 @@ impl HTMLFormElementMethods for HTMLFormElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, HeapSizeOf, PartialEq)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum SubmittedFrom {
|
||||
FromForm,
|
||||
NotFromForm
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf)]
|
||||
pub enum ResetFrom {
|
||||
FromForm,
|
||||
NotFromForm
|
||||
|
@ -674,14 +674,14 @@ impl HTMLFormElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf, Clone)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
pub enum FormDatumValue {
|
||||
#[allow(dead_code)]
|
||||
File(Root<File>),
|
||||
String(DOMString)
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf, JSTraceable, Clone)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
pub struct FormDatum {
|
||||
pub ty: DOMString,
|
||||
pub name: DOMString,
|
||||
|
@ -701,14 +701,14 @@ impl FormDatum {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf)]
|
||||
pub enum FormEncType {
|
||||
TextPlainEncoded,
|
||||
UrlEncoded,
|
||||
FormDataEncoded
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf)]
|
||||
pub enum FormMethod {
|
||||
FormGet,
|
||||
FormPost,
|
||||
|
@ -759,7 +759,7 @@ impl FormSubmittableElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf)]
|
||||
pub enum FormSubmitter<'a> {
|
||||
FormElement(&'a HTMLFormElement),
|
||||
InputElement(&'a HTMLInputElement),
|
||||
|
|
|
@ -10,7 +10,7 @@ use dom::node::Node;
|
|||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub enum HeadingLevel {
|
||||
Heading1,
|
||||
Heading2,
|
||||
|
|
|
@ -57,7 +57,7 @@ use style::context::ReflowGoal;
|
|||
use task_source::TaskSource;
|
||||
|
||||
bitflags! {
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
flags SandboxAllowance: u8 {
|
||||
const ALLOW_NOTHING = 0x00,
|
||||
const ALLOW_SAME_ORIGIN = 0x01,
|
||||
|
|
|
@ -58,7 +58,7 @@ use std::sync::{Arc, Mutex};
|
|||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
use task_source::TaskSource;
|
||||
|
||||
#[derive(Clone, Copy, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
|
||||
#[allow(dead_code)]
|
||||
enum State {
|
||||
Unavailable,
|
||||
|
@ -66,12 +66,12 @@ enum State {
|
|||
CompletelyAvailable,
|
||||
Broken,
|
||||
}
|
||||
#[derive(Copy, Clone, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable)]
|
||||
enum ImageRequestPhase {
|
||||
Pending,
|
||||
Current
|
||||
}
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
struct ImageRequest {
|
||||
state: State,
|
||||
|
@ -715,7 +715,7 @@ impl HTMLImageElement {
|
|||
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub enum ImageElementMicrotask {
|
||||
StableStateUpdateImageDataTask {
|
||||
elem: Root<HTMLImageElement>,
|
||||
|
|
|
@ -60,7 +60,7 @@ const DEFAULT_SUBMIT_VALUE: &'static str = "Submit";
|
|||
const DEFAULT_RESET_VALUE: &'static str = "Reset";
|
||||
const PASSWORD_REPLACEMENT_CHAR: char = '●';
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Copy, Clone)]
|
||||
#[derive(Clone, Copy, JSTraceable, PartialEq)]
|
||||
#[allow(dead_code)]
|
||||
#[derive(HeapSizeOf)]
|
||||
enum InputType {
|
||||
|
|
|
@ -38,7 +38,7 @@ use style::stylesheets::{CssRuleType, Stylesheet};
|
|||
use style_traits::PARSING_MODE_DEFAULT;
|
||||
use stylesheet_loader::{StylesheetLoader, StylesheetContextSource, StylesheetOwner};
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Clone, Copy, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub struct RequestGenerationId(u32);
|
||||
|
||||
impl RequestGenerationId {
|
||||
|
|
|
@ -201,7 +201,7 @@ impl HTMLMediaElementContext {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub struct VideoMedia {
|
||||
format: String,
|
||||
#[ignore_heap_size_of = "defined in time"]
|
||||
|
@ -794,7 +794,7 @@ impl VirtualMethods for HTMLMediaElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub enum MediaElementMicrotask {
|
||||
ResourceSelectionTask {
|
||||
elem: Root<HTMLMediaElement>,
|
||||
|
|
|
@ -37,7 +37,7 @@ use std::iter;
|
|||
use style::attr::AttrValue;
|
||||
use style::element_state::*;
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct OptionsFilter;
|
||||
impl CollectionFilter for OptionsFilter {
|
||||
fn filter<'a>(&self, elem: &'a Element, root: &'a Node) -> bool {
|
||||
|
|
|
@ -36,7 +36,7 @@ pub struct HTMLTableElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct TableRowFilter {
|
||||
sections: Vec<JS<Node>>,
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ pub struct Node {
|
|||
|
||||
bitflags! {
|
||||
#[doc = "Flags for node items."]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub flags NodeFlags: u16 {
|
||||
#[doc = "Specifies whether this node is in a document."]
|
||||
const IS_IN_DOC = 1 << 0,
|
||||
|
@ -203,7 +203,7 @@ impl Drop for Node {
|
|||
/// suppress observers flag
|
||||
/// https://dom.spec.whatwg.org/#concept-node-insert
|
||||
/// https://dom.spec.whatwg.org/#concept-node-remove
|
||||
#[derive(Copy, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf)]
|
||||
enum SuppressObserver {
|
||||
Suppressed,
|
||||
Unsuppressed
|
||||
|
@ -1368,7 +1368,7 @@ impl Iterator for TreeIterator {
|
|||
}
|
||||
|
||||
/// Specifies whether children must be recursively cloned or not.
|
||||
#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum CloneChildrenFlag {
|
||||
CloneChildren,
|
||||
DoNotCloneChildren
|
||||
|
@ -2531,7 +2531,7 @@ impl VirtualMethods for Node {
|
|||
}
|
||||
|
||||
/// A summary of the changes that happened to a node.
|
||||
#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, HeapSizeOf, PartialEq)]
|
||||
pub enum NodeDamage {
|
||||
/// The node's `style` attribute changed.
|
||||
NodeStyleDamaged,
|
||||
|
|
|
@ -12,7 +12,7 @@ use dom::window::Window;
|
|||
use dom_struct::dom_struct;
|
||||
use std::cell::Cell;
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
pub enum NodeListType {
|
||||
Simple(Vec<JS<Node>>),
|
||||
|
@ -109,7 +109,7 @@ impl NodeList {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
pub struct ChildrenList {
|
||||
node: JS<Node>,
|
||||
|
|
|
@ -467,7 +467,7 @@ pub enum PaintWorkletTask {
|
|||
/// https://drafts.css-houdini.org/css-paint-api/#paint-definition
|
||||
/// This type is dangerous, because it contains uboxed `Heap<JSVal>` values,
|
||||
/// which can't be moved.
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
struct PaintDefinition {
|
||||
class_constructor: Heap<JSVal>,
|
||||
|
|
|
@ -50,7 +50,7 @@ pub enum MixedMessage {
|
|||
FromTimeoutThread(())
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, Clone)]
|
||||
#[derive(Clone, JSTraceable)]
|
||||
pub struct ServiceWorkerChan {
|
||||
pub sender: Sender<ServiceWorkerScriptMsg>
|
||||
}
|
||||
|
|
|
@ -495,7 +495,7 @@ fn run(sink: Sink,
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf, Default)]
|
||||
#[derive(Default, HeapSizeOf, JSTraceable)]
|
||||
struct ParseNodeData {
|
||||
contents: Option<ParseNode>,
|
||||
is_integration_point: bool,
|
||||
|
|
|
@ -738,7 +738,7 @@ fn insert(parent: &Node, reference_child: Option<&Node>, child: NodeOrText<JS<No
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[must_root]
|
||||
pub struct Sink {
|
||||
base_url: ServoUrl,
|
||||
|
|
|
@ -723,7 +723,7 @@ impl TestBindingMethods for TestBinding {
|
|||
p.append_native_handler(&handler);
|
||||
return p;
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct SimpleHandler {
|
||||
#[ignore_heap_size_of = "Rc has unclear ownership semantics"]
|
||||
handler: Rc<SimpleCallback>,
|
||||
|
@ -804,7 +804,7 @@ impl TestBinding {
|
|||
pub unsafe fn condition_unsatisfied(_: *mut JSContext, _: HandleObject) -> bool { false }
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub struct TestBindingCallback {
|
||||
#[ignore_heap_size_of = "unclear ownership semantics"]
|
||||
promise: TrustedPromise,
|
||||
|
|
|
@ -11,7 +11,7 @@ use dom::window::Window;
|
|||
use dom_struct::dom_struct;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#validity-states
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
#[allow(dead_code)]
|
||||
pub enum ValidityStatus {
|
||||
ValueMissing,
|
||||
|
|
|
@ -79,7 +79,7 @@ unsafe_no_jsmanaged_fields!(WebVRDisplayData);
|
|||
unsafe_no_jsmanaged_fields!(WebVRFrameData);
|
||||
unsafe_no_jsmanaged_fields!(WebVRLayer);
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Eq, HeapSizeOf, PartialEq)]
|
||||
enum VRFrameDataStatus {
|
||||
Waiting,
|
||||
Synced,
|
||||
|
|
|
@ -44,7 +44,7 @@ const DEFAULT_DISABLED_GET_PARAMETER_NAMES: [GLenum; 1] = [
|
|||
];
|
||||
|
||||
/// WebGL features that are enabled/disabled by WebGL Extensions.
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
struct WebGLExtensionFeatures {
|
||||
gl_extensions: HashSet<String>,
|
||||
disabled_tex_types: HashSet<GLenum>,
|
||||
|
@ -73,7 +73,7 @@ impl Default for WebGLExtensionFeatures {
|
|||
|
||||
/// Handles the list of implemented, supported and enabled WebGL extensions.
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub struct WebGLExtensions {
|
||||
extensions: DOMRefCell<HashMap<String, Box<WebGLExtensionWrapper>>>,
|
||||
features: DOMRefCell<WebGLExtensionFeatures>,
|
||||
|
@ -223,7 +223,7 @@ impl WebGLExtensions {
|
|||
}
|
||||
|
||||
// Helper structs
|
||||
#[derive(JSTraceable, HeapSizeOf, PartialEq, Eq, Hash)]
|
||||
#[derive(Eq, Hash, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
struct TexFormatType(u32, u32);
|
||||
|
||||
type WebGLQueryParameterFunc = Fn(*mut JSContext, &WebGLRenderingContext)
|
||||
|
|
|
@ -27,7 +27,7 @@ pub trait WebGLExtensionWrapper: JSTraceable + HeapSizeOf {
|
|||
}
|
||||
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
pub struct TypedWebGLExtensionWrapper<T: WebGLExtension> {
|
||||
extension: MutNullableJS<T::Extension>
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderi
|
|||
/// with gl constants.
|
||||
macro_rules! type_safe_wrapper {
|
||||
($name: ident, $($variant:ident => $mod:ident::$constant:ident, )+) => {
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
#[repr(u32)]
|
||||
pub enum $name {
|
||||
$(
|
||||
|
|
|
@ -19,7 +19,7 @@ use dom_struct::dom_struct;
|
|||
use std::cell::Cell;
|
||||
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, Clone, HeapSizeOf)]
|
||||
#[derive(Clone, HeapSizeOf, JSTraceable)]
|
||||
enum WebGLFramebufferAttachment {
|
||||
Renderbuffer(JS<WebGLRenderbuffer>),
|
||||
Texture { texture: JS<WebGLTexture>, level: i32 },
|
||||
|
|
|
@ -18,7 +18,7 @@ use dom_struct::dom_struct;
|
|||
use std::cell::Cell;
|
||||
use std::sync::{ONCE_INIT, Once};
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub enum ShaderCompilationStatus {
|
||||
NotCompiled,
|
||||
Succeeded,
|
||||
|
|
|
@ -382,7 +382,7 @@ impl Drop for WebGLTexture {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Debug, JSTraceable, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
pub struct ImageInfo {
|
||||
width: u32,
|
||||
height: u32,
|
||||
|
|
|
@ -42,7 +42,7 @@ use std::thread;
|
|||
use task_source::TaskSource;
|
||||
use task_source::networking::NetworkingTaskSource;
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Copy, Clone, Debug, HeapSizeOf)]
|
||||
#[derive(Clone, Copy, Debug, HeapSizeOf, JSTraceable, PartialEq)]
|
||||
enum WebSocketRequestState {
|
||||
Connecting = 0,
|
||||
Open = 1,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue