mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +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
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue