mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +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
|
@ -28,7 +28,7 @@ use values::generics::transform::{StepPosition, TimingFunction as GenericTimingF
|
|||
///
|
||||
/// If the iteration count is infinite, there's no other state, otherwise we
|
||||
/// have to keep track the current iteration and the max iteration count.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum KeyframesIterationState {
|
||||
/// Infinite iterations, so no need to track a state.
|
||||
Infinite,
|
||||
|
@ -39,7 +39,7 @@ pub enum KeyframesIterationState {
|
|||
/// This structure represents wether an animation is actually running.
|
||||
///
|
||||
/// An animation can be running, or paused at a given time.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum KeyframesRunningState {
|
||||
/// This animation is paused. The inner field is the percentage of progress
|
||||
/// when it was paused, from 0 to 1.
|
||||
|
@ -52,7 +52,7 @@ pub enum KeyframesRunningState {
|
|||
/// duration, the current and maximum iteration count, and the state (either
|
||||
/// playing or paused).
|
||||
// TODO: unify the use of f32/f64 in this file.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct KeyframesAnimationState {
|
||||
/// The time this animation started at.
|
||||
pub started_at: f64,
|
||||
|
@ -244,7 +244,7 @@ impl Animation {
|
|||
|
||||
|
||||
/// A single animation frame of a single property.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct AnimationFrame {
|
||||
/// A description of the property animation that is occurring.
|
||||
pub property_animation: PropertyAnimation,
|
||||
|
@ -254,7 +254,7 @@ pub struct AnimationFrame {
|
|||
}
|
||||
|
||||
/// Represents an animation for a given property.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct PropertyAnimation {
|
||||
property: AnimatedProperty,
|
||||
timing_function: TimingFunction,
|
||||
|
|
|
@ -37,7 +37,7 @@ const SOURCE_ORDER_MAX: u32 = SOURCE_ORDER_MASK;
|
|||
|
||||
/// Stores the source order of a block and the cascade level it belongs to.
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Copy, Clone, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
struct SourceOrderAndCascadeLevel(u32);
|
||||
|
||||
impl SourceOrderAndCascadeLevel {
|
||||
|
@ -76,7 +76,7 @@ impl Debug for SourceOrderAndCascadeLevel {
|
|||
/// This represents the declarations in a given declaration block for a given
|
||||
/// importance.
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct ApplicableDeclarationBlock {
|
||||
/// The style source, either a style rule, or a property declaration block.
|
||||
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
|
||||
|
|
|
@ -727,7 +727,7 @@ pub struct StyleContext<'a, E: TElement + 'a> {
|
|||
}
|
||||
|
||||
/// Why we're doing reflow.
|
||||
#[derive(PartialEq, Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum ReflowGoal {
|
||||
/// We're reflowing in order to send a display list to the screen.
|
||||
ForDisplay,
|
||||
|
|
|
@ -270,7 +270,7 @@ counter_style_descriptors! {
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-counter-styles/#counter-style-system
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum System {
|
||||
/// 'cyclic'
|
||||
Cyclic,
|
||||
|
@ -335,7 +335,7 @@ impl ToCss for System {
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-counter-styles/#typedef-symbol
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Symbol {
|
||||
/// <string>
|
||||
String(String),
|
||||
|
@ -378,7 +378,7 @@ impl Symbol {
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-counter-styles/#counter-style-negative
|
||||
#[derive(Debug, Clone, ToCss)]
|
||||
#[derive(Clone, Debug, ToCss)]
|
||||
pub struct Negative(pub Symbol, pub Option<Symbol>);
|
||||
|
||||
impl Parse for Negative {
|
||||
|
@ -393,7 +393,7 @@ impl Parse for Negative {
|
|||
/// https://drafts.csswg.org/css-counter-styles/#counter-style-range
|
||||
///
|
||||
/// Empty Vec represents 'auto'
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Ranges(pub Vec<Range<Option<i32>>>);
|
||||
|
||||
impl Parse for Ranges {
|
||||
|
@ -482,7 +482,7 @@ impl Parse for Fallback {
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Symbols(pub Vec<Symbol>);
|
||||
|
||||
impl Parse for Symbols {
|
||||
|
|
|
@ -39,7 +39,7 @@ pub fn parse_name(s: &str) -> Result<&str, ()> {
|
|||
///
|
||||
/// We preserve the original CSS for serialization, and also the variable
|
||||
/// references to other custom property names.
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct SpecifiedValue {
|
||||
css: String,
|
||||
|
|
|
@ -46,7 +46,7 @@ pub use style_traits::UnsafeNode;
|
|||
/// Because the script task's GC does not trace layout, node data cannot be safely stored in layout
|
||||
/// data structures. Also, layout code tends to be faster when the DOM is not being accessed, for
|
||||
/// locality reasons. Using `OpaqueNode` enforces this invariant.
|
||||
#[derive(Clone, PartialEq, Copy, Debug, Hash, Eq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub struct OpaqueNode(pub usize);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ impl OneOrMoreSeparated for Source {
|
|||
/// `url()` function.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-fonts/#src-desc
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
pub struct UrlSource {
|
||||
/// The specified url.
|
||||
|
@ -225,7 +225,7 @@ macro_rules! font_face_descriptors_common {
|
|||
/// Data inside a `@font-face` rule.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-fonts/#font-face-rule
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct FontFaceRuleData {
|
||||
$(
|
||||
#[$doc]
|
||||
|
|
|
@ -16,7 +16,7 @@ use std::fmt;
|
|||
|
||||
/// Represents the font metrics that style needs from a font to compute the
|
||||
/// value of certain CSS units like `ex`.
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct FontMetrics {
|
||||
/// The x-height of the font.
|
||||
pub x_height: Au,
|
||||
|
@ -25,7 +25,7 @@ pub struct FontMetrics {
|
|||
}
|
||||
|
||||
/// The result for querying font metrics for a given font family.
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum FontMetricsQueryResult {
|
||||
/// The font is available, but we may or may not have found any font metrics
|
||||
/// for it.
|
||||
|
|
|
@ -20,7 +20,7 @@ use stylesheets::{PerOrigin, StylesheetContents, StylesheetInDocument};
|
|||
use stylist::{ExtraStyleData, Stylist};
|
||||
|
||||
/// Little wrapper to a Gecko style sheet.
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub struct GeckoStyleSheet(*const ServoStyleSheet);
|
||||
|
||||
impl ToMediaListKey for ::gecko::data::GeckoStyleSheet {
|
||||
|
|
|
@ -200,7 +200,7 @@ impl Device {
|
|||
|
||||
/// A expression for gecko contains a reference to the media feature, the value
|
||||
/// the media query contained, and the range to evaluate.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Expression {
|
||||
feature: &'static nsMediaFeature,
|
||||
value: Option<MediaExpressionValue>,
|
||||
|
@ -242,7 +242,7 @@ impl PartialEq for Expression {
|
|||
}
|
||||
|
||||
/// A resolution.
|
||||
#[derive(PartialEq, Debug, Clone)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Resolution {
|
||||
/// Dots per inch.
|
||||
Dpi(CSSFloat),
|
||||
|
@ -295,7 +295,7 @@ impl ToCss for Resolution {
|
|||
}
|
||||
|
||||
/// A value found or expected in a media expression.
|
||||
#[derive(PartialEq, Debug, Clone)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum MediaExpressionValue {
|
||||
/// A length.
|
||||
Length(specified::Length),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/// Gecko's pseudo-element definition.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
pub enum PseudoElement {
|
||||
% for pseudo in PSEUDOS:
|
||||
/// ${pseudo.value}
|
||||
|
|
|
@ -35,7 +35,7 @@ macro_rules! pseudo_class_name {
|
|||
string: [$(($s_css:expr, $s_name:ident, $s_gecko_type:tt, $s_state:tt, $s_flags:tt),)*],
|
||||
keyword: [$(($k_css:expr, $k_name:ident, $k_gecko_type:tt, $k_state:tt, $k_flags:tt),)*]) => {
|
||||
#[doc = "Our representation of a non tree-structural pseudo-class."]
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum NonTSPseudoClass {
|
||||
$(
|
||||
#[doc = $css]
|
||||
|
@ -256,7 +256,7 @@ impl NonTSPseudoClass {
|
|||
}
|
||||
|
||||
/// The dummy struct we use to implement our selector parsing.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct SelectorImpl;
|
||||
|
||||
impl ::selectors::SelectorImpl for SelectorImpl {
|
||||
|
|
|
@ -204,7 +204,7 @@ impl<'a> CoordDataMut for CornersDataMut<'a> {
|
|||
///
|
||||
/// In release mode this should never actually exist in the code, and will be
|
||||
/// optimized out by threading matches and inlining.
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CoordDataValue {
|
||||
/// eStyleUnit_Null
|
||||
Null,
|
||||
|
|
|
@ -39,7 +39,7 @@ macro_rules! local_name {
|
|||
}
|
||||
|
||||
/// A strong reference to a Gecko atom.
|
||||
#[derive(PartialEq, Eq)]
|
||||
#[derive(Eq, PartialEq)]
|
||||
pub struct Atom(*mut WeakAtom);
|
||||
|
||||
/// An atom *without* a strong reference.
|
||||
|
|
|
@ -18,7 +18,7 @@ macro_rules! ns {
|
|||
}
|
||||
|
||||
/// A Gecko namespace is just a wrapped atom.
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Default, Hash)]
|
||||
#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)]
|
||||
pub struct Namespace(pub Atom);
|
||||
|
||||
impl PrecomputedHash for Namespace {
|
||||
|
|
|
@ -48,7 +48,7 @@ type InvalidationVector = SmallVec<[Invalidation; 10]>;
|
|||
///
|
||||
/// We can use this to avoid pushing invalidations of the same kind to our
|
||||
/// descendants or siblings.
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
enum InvalidationKind {
|
||||
Descendant,
|
||||
Sibling,
|
||||
|
|
|
@ -23,7 +23,7 @@ use stylesheets::{NestedRuleIterationCondition, Stylesheet};
|
|||
///
|
||||
/// If this changes, though, we may need to remove the item from the cache if
|
||||
/// present before it goes away.
|
||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct MediaListKey(usize);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ use stylesheets::{CssRule, StylesheetInDocument};
|
|||
|
||||
/// An invalidation scope represents a kind of subtree that may need to be
|
||||
/// restyled.
|
||||
#[derive(Debug, Hash, Eq, PartialEq)]
|
||||
#[derive(Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
enum InvalidationScope {
|
||||
/// All the descendants of an element with a given id.
|
||||
|
|
|
@ -175,12 +175,12 @@ impl fmt::Display for WritingMode {
|
|||
/// (in addition to taking it as a parameter to methods) and check it.
|
||||
/// In non-debug builds, make this storage zero-size and the checks no-ops.
|
||||
#[cfg(not(debug_assertions))]
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||
struct DebugWritingMode;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||
struct DebugWritingMode {
|
||||
mode: WritingMode
|
||||
|
@ -232,7 +232,7 @@ impl Debug for DebugWritingMode {
|
|||
|
||||
|
||||
// Used to specify the logical direction.
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||
pub enum Direction {
|
||||
Inline,
|
||||
|
@ -240,7 +240,7 @@ pub enum Direction {
|
|||
}
|
||||
|
||||
/// A 2D size in flow-relative dimensions
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||
pub struct LogicalSize<T> {
|
||||
pub inline: T, // inline-size, a.k.a. logical width, a.k.a. measure
|
||||
|
@ -377,7 +377,7 @@ impl<T: Sub<T, Output=T>> Sub for LogicalSize<T> {
|
|||
|
||||
|
||||
/// A 2D point in flow-relative dimensions
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||
pub struct LogicalPoint<T> {
|
||||
/// inline-axis coordinate
|
||||
|
@ -550,7 +550,7 @@ impl<T: Copy + Sub<T, Output=T>> Sub<LogicalSize<T>> for LogicalPoint<T> {
|
|||
/// Represents the four sides of the margins, borders, or padding of a CSS box,
|
||||
/// or a combination of those.
|
||||
/// A positive "margin" can be added to a rectangle to obtain a bigger rectangle.
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||
pub struct LogicalMargin<T> {
|
||||
pub block_start: T,
|
||||
|
@ -854,7 +854,7 @@ impl<T: Sub<T, Output=T>> Sub for LogicalMargin<T> {
|
|||
|
||||
|
||||
/// A rectangle in flow-relative dimensions
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||
pub struct LogicalRect<T> {
|
||||
pub start: LogicalPoint<T>,
|
||||
|
@ -1102,7 +1102,7 @@ impl<T: Copy + Add<T, Output=T> + Sub<T, Output=T>> Sub<LogicalMargin<T>> for Lo
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum PhysicalSide {
|
||||
Top,
|
||||
Right,
|
||||
|
|
|
@ -40,7 +40,7 @@ impl StyleDifference {
|
|||
}
|
||||
|
||||
/// Represents whether or not the style of an element has changed.
|
||||
#[derive(Copy, Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum StyleChange {
|
||||
/// The style hasn't changed.
|
||||
Unchanged,
|
||||
|
@ -50,7 +50,7 @@ pub enum StyleChange {
|
|||
|
||||
/// Whether or not newly computed values for an element need to be cascade
|
||||
/// to children.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||
pub enum ChildCascadeRequirement {
|
||||
/// Old and new computed values were the same, or we otherwise know that
|
||||
/// we won't bother recomputing style for children, so we can skip cascading
|
||||
|
@ -96,7 +96,7 @@ impl RulesChanged {
|
|||
}
|
||||
|
||||
/// Determines which styles are being cascaded currently.
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum CascadeVisitedMode {
|
||||
/// Cascade the regular, unvisited styles.
|
||||
Unvisited,
|
||||
|
|
|
@ -23,7 +23,7 @@ pub use servo::media_queries::{Device, Expression};
|
|||
pub use gecko::media_queries::{Device, Expression};
|
||||
|
||||
/// A type that encapsulates a media query list.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct MediaList {
|
||||
/// The list of media queries.
|
||||
|
@ -60,7 +60,7 @@ pub enum Qualifier {
|
|||
/// A [media query][mq].
|
||||
///
|
||||
/// [mq]: https://drafts.csswg.org/mediaqueries/
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct MediaQuery {
|
||||
/// The qualifier for this query.
|
||||
|
@ -132,7 +132,7 @@ impl ToCss for MediaQuery {
|
|||
}
|
||||
|
||||
/// http://dev.w3.org/csswg/mediaqueries-3/#media0
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum MediaQueryType {
|
||||
/// A media type that matches every device.
|
||||
|
@ -161,7 +161,7 @@ impl MediaQueryType {
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/mediaqueries/#media-types
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct MediaType(pub CustomIdent);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ impl AnimationRules {
|
|||
///
|
||||
/// [importance]: https://drafts.csswg.org/css-cascade/#importance
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
pub enum Importance {
|
||||
/// Indicates a declaration without `!important`.
|
||||
Normal,
|
||||
|
|
|
@ -448,7 +448,7 @@
|
|||
${gecko_keyword_conversion(keyword, keyword.values_for(product), type="T", cast_to="i32")}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Copy, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
pub enum SpecifiedValue {
|
||||
Keyword(computed_value::T),
|
||||
System(SystemFont),
|
||||
|
|
|
@ -68,7 +68,7 @@ pub trait RepeatableListAnimatable: Animate {}
|
|||
/// NOTE: This includes the 'display' property since it is animatable from SMIL even though it is
|
||||
/// not animatable from CSS animations or Web Animations. CSS transitions also does not allow
|
||||
/// animating 'display', but for CSS transitions we have the separate TransitionProperty type.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum AnimatableLonghand {
|
||||
% for prop in data.longhands:
|
||||
|
|
|
@ -64,7 +64,7 @@ ${helpers.predefined_type("background-image", "ImageLayer",
|
|||
pub mod computed_value {
|
||||
pub use super::RepeatKeyword;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub RepeatKeyword, pub RepeatKeyword);
|
||||
}
|
||||
|
|
|
@ -82,12 +82,12 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style',
|
|||
|
||||
pub mod computed_value {
|
||||
use cssparser::RGBA;
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub Option<Vec<RGBA>>);
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum SpecifiedValue {
|
||||
None,
|
||||
|
@ -236,12 +236,12 @@ ${helpers.predefined_type("border-image-outset", "LengthOrNumberRect",
|
|||
pub use super::RepeatKeyword;
|
||||
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub struct T(pub RepeatKeyword, pub RepeatKeyword);
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub struct SpecifiedValue(pub RepeatKeyword,
|
||||
pub Option<RepeatKeyword>);
|
||||
|
||||
|
|
|
@ -370,7 +370,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed",
|
|||
/// The keywords are the same, and the `LengthOrPercentage` is computed
|
||||
/// here.
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(PartialEq, Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum T {
|
||||
% for keyword in vertical_align_keywords:
|
||||
|
@ -523,7 +523,7 @@ ${helpers.predefined_type("transition-delay",
|
|||
pub use super::SpecifiedValue as T;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct SpecifiedValue(pub Option<KeyframesName>);
|
||||
|
||||
|
@ -618,7 +618,7 @@ ${helpers.predefined_type("animation-timing-function",
|
|||
|
||||
// https://drafts.csswg.org/css-animations/#animation-iteration-count
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub enum SpecifiedValue {
|
||||
Number(f32),
|
||||
Infinite,
|
||||
|
@ -1855,7 +1855,7 @@ ${helpers.single_keyword("-moz-orient",
|
|||
pub use super::SpecifiedValue as T;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum SpecifiedValue {
|
||||
Auto,
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#[cfg(feature = "gecko")]
|
||||
use values::specified::Attr;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum ContentItem {
|
||||
/// Literal string content.
|
||||
|
@ -101,7 +101,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum T {
|
||||
Normal,
|
||||
|
@ -240,7 +240,7 @@
|
|||
use style_traits::ToCss;
|
||||
use values::CustomIdent;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct SpecifiedValue(pub Vec<(CustomIdent, specified::Integer)>);
|
||||
|
||||
pub mod computed_value {
|
||||
|
@ -248,7 +248,7 @@
|
|||
use style_traits::ToCss;
|
||||
use values::CustomIdent;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub Vec<(CustomIdent, i32)>);
|
||||
|
||||
|
|
|
@ -85,21 +85,21 @@ macro_rules! impl_gecko_keyword_conversions {
|
|||
use style_traits::{ToCss, ParseError};
|
||||
pub use self::FontFamily as SingleComputedValue;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub enum FontFamily {
|
||||
FamilyName(FamilyName),
|
||||
Generic(Atom),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub struct FamilyName {
|
||||
pub name: Atom,
|
||||
pub syntax: FamilyNameSyntax,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub enum FamilyNameSyntax {
|
||||
/// The family name was specified in a quoted form, e.g. "Font Name"
|
||||
|
@ -296,7 +296,7 @@ macro_rules! impl_gecko_keyword_conversions {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub Vec<FontFamily>);
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ macro_rules! impl_gecko_keyword_conversions {
|
|||
SpecifiedValue::parse(input)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
pub enum SpecifiedValue {
|
||||
Values(Vec<FontFamily>),
|
||||
System(SystemFont),
|
||||
|
@ -485,7 +485,7 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
///
|
||||
/// However, system fonts may provide other values. Pango
|
||||
/// may provide 350, 380, and 1000 (on top of the existing values), for example.
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, PartialEq, Eq, Hash, ToCss)]
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, Eq, Hash, PartialEq, ToCss)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub struct T(pub u16);
|
||||
|
||||
|
@ -624,7 +624,7 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum SpecifiedValue {
|
||||
Length(specified::LengthOrPercentage),
|
||||
|
@ -652,7 +652,7 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
}
|
||||
|
||||
/// CSS font keywords
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum KeywordSize {
|
||||
XXSmall = 1, // This is to enable the NonZero optimization
|
||||
|
@ -1120,7 +1120,7 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
use values::distance::{ComputeSquaredDistance, SquaredDistance};
|
||||
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToCss)]
|
||||
pub enum T {
|
||||
None,
|
||||
Number(CSSFloat),
|
||||
|
@ -1217,7 +1217,7 @@ ${helpers.single_keyword_system("font-variant-caps",
|
|||
pub use super::SpecifiedValue as T;
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct SpecifiedValue {
|
||||
pub weight: bool,
|
||||
|
@ -1325,7 +1325,7 @@ ${helpers.single_keyword_system("font-kerning",
|
|||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum VariantAlternates {
|
||||
Stylistic(CustomIdent),
|
||||
|
@ -1337,11 +1337,11 @@ ${helpers.single_keyword_system("font-kerning",
|
|||
HistoricalForms,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct VariantAlternatesList(pub Box<[VariantAlternates]>);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum SpecifiedValue {
|
||||
Value(VariantAlternatesList),
|
||||
|
@ -1552,7 +1552,7 @@ macro_rules! exclusive_value {
|
|||
}
|
||||
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub enum SpecifiedValue {
|
||||
Value(VariantEastAsian),
|
||||
System(SystemFont)
|
||||
|
@ -1698,7 +1698,7 @@ macro_rules! exclusive_value {
|
|||
}
|
||||
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub enum SpecifiedValue {
|
||||
Value(VariantLigatures),
|
||||
System(SystemFont)
|
||||
|
@ -1858,7 +1858,7 @@ macro_rules! exclusive_value {
|
|||
|
||||
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub enum SpecifiedValue {
|
||||
Value(VariantNumeric),
|
||||
System(SystemFont)
|
||||
|
@ -1997,7 +1997,7 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
use properties::longhands::system_font::SystemFont;
|
||||
use values::generics::FontSettings;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub enum SpecifiedValue {
|
||||
Value(computed_value::T),
|
||||
System(SystemFont)
|
||||
|
@ -2074,7 +2074,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control-
|
|||
use byteorder::{BigEndian, ByteOrder};
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum SpecifiedValue {
|
||||
Normal,
|
||||
|
@ -2131,7 +2131,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control-
|
|||
// OpenType "language system" tag, so we should be able to compute
|
||||
// it and store it as a 32-bit integer
|
||||
// (see http://www.microsoft.com/typography/otspec/languagetags.htm).
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub u32);
|
||||
}
|
||||
|
@ -2304,7 +2304,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control-
|
|||
0
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum SpecifiedValue {
|
||||
Relative(i32),
|
||||
Absolute(i32),
|
||||
|
@ -2643,7 +2643,7 @@ ${helpers.single_keyword("-moz-math-variant",
|
|||
// a lot of code with `if product == gecko` conditionals, we have a
|
||||
// dummy system font module that does nothing
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ToCss)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// void enum for system font, can never exist
|
||||
pub enum SystemFont {}
|
||||
|
|
|
@ -71,7 +71,7 @@ ${helpers.single_keyword("image-rendering",
|
|||
use std::f64::consts::PI;
|
||||
const TWO_PI: f64 = 2.0 * PI;
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct SpecifiedValue {
|
||||
pub angle: Option<Angle>,
|
||||
|
@ -102,7 +102,7 @@ ${helpers.single_keyword("image-rendering",
|
|||
use style_traits::ToCss;
|
||||
use values::specified::Angle;
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum Orientation {
|
||||
Angle0 = 0,
|
||||
|
@ -134,7 +134,7 @@ ${helpers.single_keyword("image-rendering",
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum T {
|
||||
FromImage,
|
||||
|
@ -261,7 +261,7 @@ ${helpers.single_keyword("image-rendering",
|
|||
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub struct SpecifiedValue(pub bool);
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)",
|
|||
///
|
||||
/// Higher priority values, i.e. the values specified first,
|
||||
/// will be painted first (and may be covered by paintings of lower priority)
|
||||
#[derive(PartialEq, Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct SpecifiedValue(pub u8);
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ ${helpers.single_keyword("text-align-last",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
pub enum SpecifiedValue {
|
||||
Keyword(computed_value::T),
|
||||
MatchParent,
|
||||
|
@ -294,7 +294,7 @@ ${helpers.predefined_type("word-spacing",
|
|||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct SpecifiedValue {
|
||||
pub underline: Option<RGBA>,
|
||||
|
@ -446,7 +446,7 @@ ${helpers.predefined_type(
|
|||
String(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct KeywordValue {
|
||||
pub fill: bool,
|
||||
|
@ -462,7 +462,7 @@ ${helpers.predefined_type(
|
|||
String(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum KeywordValue {
|
||||
Fill(bool),
|
||||
|
@ -630,7 +630,7 @@ ${helpers.predefined_type(
|
|||
"left" => Left);
|
||||
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub struct SpecifiedValue(pub HorizontalWritingModeValue, pub VerticalWritingModeValue);
|
||||
|
||||
pub mod computed_value {
|
||||
|
|
|
@ -42,7 +42,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
|||
use values::generics::CounterStyleOrNone;
|
||||
|
||||
/// <counter-style> | <string> | none
|
||||
#[derive(Debug, Clone, Eq, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
||||
pub enum T {
|
||||
CounterStyle(CounterStyleOrNone),
|
||||
String(String),
|
||||
|
@ -110,7 +110,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
|||
use values::specified::UrlOrNone;
|
||||
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Clone, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub struct T(pub UrlOrNone);
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
|
|||
pub use self::computed_value::T as SpecifiedValue;
|
||||
|
||||
pub mod computed_value {
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub Vec<(String,String)>);
|
||||
}
|
||||
|
|
|
@ -36,14 +36,14 @@
|
|||
pub type T = Keyword;
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct Image {
|
||||
pub url: SpecifiedUrl,
|
||||
pub hotspot: Option<(f32, f32)>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct T {
|
||||
pub images: Vec<Image>,
|
||||
pub keyword: Keyword,
|
||||
|
|
|
@ -296,14 +296,14 @@ ${helpers.predefined_type("object-position",
|
|||
pub type SpecifiedValue = computed_value::T;
|
||||
|
||||
pub mod computed_value {
|
||||
#[derive(PartialEq, Clone, Eq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum AutoFlow {
|
||||
Row,
|
||||
Column,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Eq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T {
|
||||
pub autoflow: AutoFlow,
|
||||
|
|
|
@ -23,7 +23,7 @@ ${helpers.single_keyword("table-layout", "auto fixed",
|
|||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[derive(PartialEq, Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub i32);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
pub mod computed_value {
|
||||
pub use super::Side;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T {
|
||||
// When the specified value only has one side, that's the "second"
|
||||
|
|
|
@ -54,7 +54,7 @@ ${helpers.single_keyword("-moz-window-shadow", "none default menu tooltip sheet"
|
|||
no_viewport_percentage!(SpecifiedValue);
|
||||
|
||||
pub mod computed_value {
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct T(pub bool);
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ pub mod animated_properties {
|
|||
}
|
||||
|
||||
/// A longhand or shorthand porperty
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct NonCustomPropertyId(usize);
|
||||
|
||||
impl From<LonghandId> for NonCustomPropertyId {
|
||||
|
@ -396,7 +396,7 @@ impl PropertyDeclarationIdSet {
|
|||
|
||||
/// An enum to represent a CSS Wide keyword.
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
pub enum CSSWideKeyword {
|
||||
/// The `initial` keyword.
|
||||
Initial,
|
||||
|
@ -459,7 +459,7 @@ bitflags! {
|
|||
}
|
||||
|
||||
/// An identifier for a given longhand property.
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum LonghandId {
|
||||
% for i, property in enumerate(data.longhands):
|
||||
|
@ -771,7 +771,7 @@ impl ShorthandId {
|
|||
|
||||
/// Servo's representation of a declared value for a given `T`, which is the
|
||||
/// declared value for that property.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum DeclaredValue<'a, T: 'a> {
|
||||
/// A known specified value from the stylesheet.
|
||||
Value(&'a T),
|
||||
|
@ -785,7 +785,7 @@ pub enum DeclaredValue<'a, T: 'a> {
|
|||
/// that PropertyDeclaration can avoid embedding a DeclaredValue (and its
|
||||
/// extra discriminant word) and synthesize dependent DeclaredValues for
|
||||
/// PropertyDeclaration instances as needed.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum DeclaredValueOwned<T> {
|
||||
/// A known specified value from the stylesheet.
|
||||
Value(T),
|
||||
|
@ -807,7 +807,7 @@ impl<T> DeclaredValueOwned<T> {
|
|||
}
|
||||
|
||||
/// An unparsed property value that contains `var()` functions.
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub struct UnparsedValue {
|
||||
/// The css serialization for this value.
|
||||
css: String,
|
||||
|
@ -910,7 +910,7 @@ impl<'a, T: ToCss> ToCss for DeclaredValue<'a, T> {
|
|||
|
||||
/// An identifier for a given property declaration, which can be either a
|
||||
/// longhand or a custom property.
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum PropertyDeclarationId<'a> {
|
||||
/// A longhand.
|
||||
|
@ -975,7 +975,7 @@ impl<'a> PropertyDeclarationId<'a> {
|
|||
|
||||
/// Servo's representation of a CSS property, that is, either a longhand, a
|
||||
/// shorthand, or a custom property.
|
||||
#[derive(Eq, PartialEq, Clone)]
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
pub enum PropertyId {
|
||||
/// A longhand property.
|
||||
Longhand(LonghandId),
|
||||
|
@ -1284,7 +1284,7 @@ impl PropertyParserContext {
|
|||
}
|
||||
|
||||
/// Servo's representation for a property declaration.
|
||||
#[derive(PartialEq, Clone)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub enum PropertyDeclaration {
|
||||
% for property in data.longhands:
|
||||
/// ${property.name}
|
||||
|
@ -1724,7 +1724,7 @@ pub mod style_structs {
|
|||
% if style_struct.name == "Font":
|
||||
#[derive(Clone, Debug)]
|
||||
% else:
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
% endif
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// The ${style_struct.name} style struct.
|
||||
|
@ -3495,7 +3495,7 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>,
|
|||
}
|
||||
|
||||
/// An identifier for a given alias property.
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum AliasId {
|
||||
% for i, property in enumerate(data.all_aliases()):
|
||||
|
|
|
@ -69,7 +69,7 @@ impl Drop for RuleTree {
|
|||
/// could be enough to implement the rule tree, keeping the whole rule provides
|
||||
/// more debuggability, and also the ability of show those selectors to
|
||||
/// devtools.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum StyleSource {
|
||||
/// A style rule stable pointer.
|
||||
Style(Arc<Locked<StyleRule>>),
|
||||
|
@ -442,7 +442,7 @@ const RULE_TREE_GC_INTERVAL: usize = 300;
|
|||
///
|
||||
/// [1]: https://drafts.csswg.org/css-cascade/#cascade-origin
|
||||
#[repr(u8)]
|
||||
#[derive(Eq, PartialEq, Copy, Clone, Debug, PartialOrd)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum CascadeLevel {
|
||||
/// Normal User-Agent rules.
|
||||
|
|
|
@ -80,7 +80,7 @@ impl<'a> SelectorParser<'a> {
|
|||
///
|
||||
/// If you're implementing a public selector for `Servo` that the end-user might
|
||||
/// customize, then you probably need to make it eager.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum PseudoElementCascadeType {
|
||||
/// Eagerly cascaded pseudo-elements are "normal" pseudo-elements (i.e.
|
||||
/// `::before` and `::after`). They inherit styles normally as another
|
||||
|
|
|
@ -133,7 +133,7 @@ impl Device {
|
|||
/// A expression kind servo understands and parses.
|
||||
///
|
||||
/// Only `pub` for unit testing, please don't use it directly!
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum ExpressionKind {
|
||||
/// http://dev.w3.org/csswg/mediaqueries-3/#width
|
||||
|
@ -143,7 +143,7 @@ pub enum ExpressionKind {
|
|||
/// A single expression a per:
|
||||
///
|
||||
/// http://dev.w3.org/csswg/mediaqueries-3/#media1
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct Expression(ExpressionKind);
|
||||
|
||||
|
@ -221,7 +221,7 @@ impl ToCss for Expression {
|
|||
///
|
||||
/// Only public for testing, implementation details of `Expression` may change
|
||||
/// for Stylo.
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum Range<T> {
|
||||
/// At least the inner value.
|
||||
|
|
|
@ -31,7 +31,7 @@ use style_traits::{ParseError, StyleParseError};
|
|||
/// A pseudo-element, both public and private.
|
||||
///
|
||||
/// NB: If you add to this list, be sure to update `each_simple_pseudo_element` too.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
#[repr(usize)]
|
||||
|
@ -252,7 +252,7 @@ pub type PseudoClassStringArg = Box<str>;
|
|||
|
||||
/// A non tree-structural pseudo-class.
|
||||
/// See https://drafts.csswg.org/selectors-4/#structural-pseudos
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub enum NonTSPseudoClass {
|
||||
|
|
|
@ -22,7 +22,7 @@ use values::computed::{Context, ToComputedValue, ComputedUrl};
|
|||
///
|
||||
/// However, this approach is still not necessarily optimal: See
|
||||
/// https://bugzilla.mozilla.org/show_bug.cgi?id=1347435#c6
|
||||
#[derive(Clone, Debug, HeapSizeOf, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub struct SpecifiedUrl {
|
||||
/// The original URI. This might be optional since we may insert computed
|
||||
/// values of images into the cascade directly, and we don't bother to
|
||||
|
|
|
@ -99,7 +99,7 @@ impl DeepCloneWithLock for KeyframesRule {
|
|||
|
||||
/// A number from 0 to 1, indicating the percentage of the animation when this
|
||||
/// keyframe should run.
|
||||
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct KeyframePercentage(pub f32);
|
||||
|
||||
|
@ -147,7 +147,7 @@ impl KeyframePercentage {
|
|||
|
||||
/// A keyframes selector is a list of percentages or from/to symbols, which are
|
||||
/// converted at parse time to percentages.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct KeyframeSelector(Vec<KeyframePercentage>);
|
||||
|
||||
impl ToCss for KeyframeSelector {
|
||||
|
|
|
@ -88,7 +88,7 @@ impl Eq for UrlExtraData {}
|
|||
/// A CSS rule.
|
||||
///
|
||||
/// TODO(emilio): Lots of spec links should be around.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum CssRule {
|
||||
// No Charset here, CSSCharsetRule has been removed from CSSOM
|
||||
|
@ -135,7 +135,7 @@ impl MallocSizeOfWithGuard for CssRule {
|
|||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum CssRuleType {
|
||||
// https://drafts.csswg.org/cssom/#the-cssrule-interface
|
||||
Style = 1,
|
||||
|
|
|
@ -10,7 +10,7 @@ use std::ops::BitOrAssign;
|
|||
/// Each style rule has an origin, which determines where it enters the cascade.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-cascade/#cascading-origins
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[repr(u8)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum Origin {
|
||||
|
|
|
@ -86,7 +86,7 @@ impl<'b> TopLevelRuleParser<'b> {
|
|||
}
|
||||
|
||||
/// The current state of the parser.
|
||||
#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone)]
|
||||
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
|
||||
pub enum State {
|
||||
/// We haven't started parsing rules.
|
||||
Start = 1,
|
||||
|
|
|
@ -36,7 +36,7 @@ pub struct UserAgentStylesheets {
|
|||
/// A set of namespaces applying to a given stylesheet.
|
||||
///
|
||||
/// The namespace id is used in gecko
|
||||
#[derive(Clone, Default, Debug)]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
#[allow(missing_docs)]
|
||||
pub struct Namespaces {
|
||||
pub default: Option<(Namespace, NamespaceId)>,
|
||||
|
|
|
@ -426,7 +426,7 @@ pub struct Stylist {
|
|||
}
|
||||
|
||||
/// What cascade levels to include when styling elements.
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum RuleInclusion {
|
||||
/// Include rules for style sheets at all cascade levels. This is the
|
||||
/// normal rule inclusion mode.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
use time;
|
||||
|
||||
/// The `TimerMode` is used to determine what time should the `Timer` return.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
enum TimerMode {
|
||||
/// The timer should return a fixed value.
|
||||
Test(f64),
|
||||
|
@ -20,7 +20,7 @@ enum TimerMode {
|
|||
/// A `Timer` struct that takes care of giving the current time for animations.
|
||||
///
|
||||
/// This is needed to be allowed to hook the time in the animations' test-mode.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Timer {
|
||||
mode: TimerMode,
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ impl PreTraverseToken {
|
|||
}
|
||||
|
||||
/// The kind of traversals we could perform.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum TraversalDriver {
|
||||
/// A potentially parallel traversal.
|
||||
Parallel,
|
||||
|
|
|
@ -17,7 +17,7 @@ pub use super::specified::{AlignItems, AlignJustifyContent, AlignJustifySelf};
|
|||
///
|
||||
/// Need to carry around both the specified and computed value to handle the
|
||||
/// special legacy keyword. Sigh.
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub struct JustifyItems {
|
||||
/// The specified value for the property. Can contain `auto`.
|
||||
pub specified: specified::JustifyItems,
|
||||
|
|
|
@ -64,7 +64,7 @@ impl ToComputedValue for specified::Length {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub struct CalcLengthOrPercentage {
|
||||
|
|
|
@ -554,7 +554,7 @@ impl From<Au> for NonNegativeAu {
|
|||
|
||||
/// The computed value of a CSS `url()`, resolved relative to the stylesheet URL.
|
||||
#[cfg(feature = "servo")]
|
||||
#[derive(Clone, Debug, HeapSizeOf, Serialize, Deserialize, PartialEq)]
|
||||
#[derive(Clone, Debug, Deserialize, HeapSizeOf, PartialEq, Serialize)]
|
||||
pub enum ComputedUrl {
|
||||
/// The `url()` was invalid or it wasn't specified by the user.
|
||||
Invalid(Arc<String>),
|
||||
|
|
|
@ -9,7 +9,7 @@ use style_traits::ToCss;
|
|||
use values::CSSFloat;
|
||||
|
||||
/// A computed `<time>` value.
|
||||
#[derive(Clone, PartialEq, PartialOrd, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub struct Time {
|
||||
seconds: CSSFloat,
|
||||
|
|
|
@ -14,7 +14,7 @@ use values::computed::{ComputedValueAsSpecified, Context, ToComputedValue};
|
|||
use values::specified::Integer;
|
||||
use values::specified::grid::parse_line_names;
|
||||
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// A `<grid-line>` type.
|
||||
///
|
||||
|
@ -138,7 +138,7 @@ define_css_keyword_enum!{ TrackKeyword:
|
|||
"min-content" => MinContent
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// A track breadth for explicit grid track sizing. It's generic solely to
|
||||
/// avoid re-implementing it for the computed type.
|
||||
|
@ -382,7 +382,7 @@ no_viewport_percentage!(RepeatCount);
|
|||
///
|
||||
/// It can also hold `repeat()` function parameters, which expands into the respective
|
||||
/// values in its computed form.
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct TrackRepeat<L> {
|
||||
/// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`)
|
||||
|
@ -508,7 +508,7 @@ impl<L: ToComputedValue> ToComputedValue for TrackRepeat<L> {
|
|||
/// The type of a `<track-list>` as determined during parsing.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-list
|
||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum TrackListType {
|
||||
/// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list)
|
||||
|
@ -533,7 +533,7 @@ impl ComputedValueAsSpecified for TrackListType {}
|
|||
/// A grid `<track-list>` type.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-list
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct TrackList<T> {
|
||||
/// The type of this `<track-list>` (auto, explicit or general).
|
||||
|
@ -601,7 +601,7 @@ impl<T: ToCss> ToCss for TrackList<T> {
|
|||
///
|
||||
/// `subgrid [ <line-names> | repeat(<positive-integer> | auto-fill, <line-names>+) ]+`
|
||||
/// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list
|
||||
#[derive(Clone, PartialEq, Debug, Default)]
|
||||
#[derive(Clone, Debug, Default, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct LineNameList {
|
||||
/// The optional `<line-name-list>`
|
||||
|
@ -698,7 +698,7 @@ no_viewport_percentage!(LineNameList);
|
|||
/// Variants for `<grid-template-rows> | <grid-template-columns>`
|
||||
/// Subgrid deferred to Level 2 spec due to lack of implementation.
|
||||
/// But it's implemented in gecko, so we have to as well.
|
||||
#[derive(Clone, PartialEq, Debug, ToCss)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum GridTemplateComponent<L> {
|
||||
/// `none` value.
|
||||
|
|
|
@ -102,7 +102,7 @@ impl<ColorType: Parse, UrlPaintServer: Parse> Parse for SVGPaint<ColorType, UrlP
|
|||
/// https://www.w3.org/TR/SVG11/painting.html#StrokeProperties
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToAnimatedValue)]
|
||||
#[derive(ToAnimatedZero, ToCss, ToComputedValue)]
|
||||
#[derive(ToAnimatedZero, ToComputedValue, ToCss)]
|
||||
pub enum SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number> {
|
||||
/// <length> | <percentage>
|
||||
LengthOrPercentage(LengthOrPercentage),
|
||||
|
@ -195,7 +195,7 @@ pub enum SVGLength<LengthType> {
|
|||
|
||||
/// Generic value for stroke-dasharray.
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, ComputeSquaredDistance, Debug, PartialEq, HasViewportPercentage, ToAnimatedValue, ToComputedValue)]
|
||||
#[derive(Clone, ComputeSquaredDistance, Debug, HasViewportPercentage, PartialEq, ToAnimatedValue, ToComputedValue)]
|
||||
pub enum SVGStrokeDashArray<LengthType> {
|
||||
/// `[ <length> | <percentage> | <number> ]#`
|
||||
Values(Vec<LengthType>),
|
||||
|
|
|
@ -98,7 +98,7 @@ impl<A: Parse, B: Parse> Parse for Either<A, B> {
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-values-4/#custom-idents
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct CustomIdent(pub Atom);
|
||||
|
||||
|
@ -127,7 +127,7 @@ impl ToCss for CustomIdent {
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-animations/#typedef-keyframes-name
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum KeyframesName {
|
||||
/// <custom-ident>
|
||||
|
|
|
@ -113,7 +113,7 @@ const ALIGN_ALL_SHIFT: u32 = structs::NS_STYLE_ALIGN_ALL_SHIFT;
|
|||
///
|
||||
/// The 16-bit field stores the primary value in its lower 8 bits, and the optional fallback value
|
||||
/// in its upper 8 bits. This matches the representation of these properties in Gecko.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub struct AlignJustifyContent(u16);
|
||||
|
||||
|
@ -206,7 +206,7 @@ impl Parse for AlignJustifyContent {
|
|||
/// Value of the `align-self` or `justify-self` property.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#self-alignment
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
pub struct AlignJustifySelf(pub AlignFlags);
|
||||
|
||||
impl AlignJustifySelf {
|
||||
|
@ -244,7 +244,7 @@ impl Parse for AlignJustifySelf {
|
|||
/// Value of the `align-items` property
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#self-alignment
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
pub struct AlignItems(pub AlignFlags);
|
||||
|
||||
impl AlignItems {
|
||||
|
@ -282,7 +282,7 @@ impl Parse for AlignItems {
|
|||
/// Value of the `justify-items` property
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#justify-items-property
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
pub struct JustifyItems(pub AlignFlags);
|
||||
|
||||
impl JustifyItems {
|
||||
|
|
|
@ -63,7 +63,7 @@ pub enum CalcUnit {
|
|||
}
|
||||
|
||||
/// A struct to hold a simplified `<length>` or `<percentage>` expression.
|
||||
#[derive(Clone, PartialEq, Copy, Debug, Default)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
pub struct CalcLengthOrPercentage {
|
||||
|
|
|
@ -18,7 +18,7 @@ use super::AllowQuirks;
|
|||
use values::computed::{Color as ComputedColor, Context, ToComputedValue};
|
||||
|
||||
/// Specified color value
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum Color {
|
||||
/// The 'currentColor' keyword
|
||||
|
|
|
@ -97,7 +97,7 @@ pub fn parse_line_names<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Box<[Custo
|
|||
/// The type of `repeat` function (only used in parsing).
|
||||
///
|
||||
/// https://drafts.csswg.org/css-grid/#typedef-track-repeat
|
||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
enum RepeatType {
|
||||
/// [`<auto-repeat>`](https://drafts.csswg.org/css-grid/#typedef-auto-repeat)
|
||||
|
|
|
@ -52,7 +52,7 @@ pub fn au_to_int_px(au: f32) -> i32 {
|
|||
(au / AU_PER_PX).round() as i32
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// A font relative length.
|
||||
pub enum FontRelativeLength {
|
||||
|
@ -167,7 +167,7 @@ impl FontRelativeLength {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// A viewport-relative length.
|
||||
///
|
||||
|
@ -224,7 +224,7 @@ impl ViewportPercentageLength {
|
|||
}
|
||||
|
||||
/// HTML5 "character width", as defined in HTML5 § 14.5.4.
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct CharacterWidth(pub i32);
|
||||
|
||||
|
@ -256,7 +256,7 @@ fn to_au_round(length: CSSFloat, au_per_unit: CSSFloat) -> Au {
|
|||
}
|
||||
|
||||
/// Represents an absolute length with its unit
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum AbsoluteLength {
|
||||
/// An absolute length in pixels (px)
|
||||
|
@ -347,7 +347,7 @@ impl Mul<CSSFloat> for AbsoluteLength {
|
|||
}
|
||||
|
||||
/// Represents a physical length (mozmm) based on DPI
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg(feature = "gecko")]
|
||||
pub struct PhysicalLength(pub CSSFloat);
|
||||
|
||||
|
@ -393,7 +393,7 @@ impl Mul<CSSFloat> for PhysicalLength {
|
|||
/// A `<length>` without taking `calc` expressions into account
|
||||
///
|
||||
/// https://drafts.csswg.org/css-values/#lengths
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum NoCalcLength {
|
||||
/// An absolute length
|
||||
|
|
|
@ -669,7 +669,7 @@ pub type NamespaceId = ();
|
|||
/// An attr(...) rule
|
||||
///
|
||||
/// `[namespace? `|`]? ident`
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct Attr {
|
||||
/// Optional namespace
|
||||
|
|
|
@ -25,7 +25,7 @@ pub struct Time {
|
|||
}
|
||||
|
||||
/// A time unit.
|
||||
#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, HasViewportPercentage, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum TimeUnit {
|
||||
/// `s`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue