mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Add derived ToShmem implementations.
Differential Revision: https://phabricator.services.mozilla.com/D17197
This commit is contained in:
parent
128c6ae94a
commit
40248ae5fd
93 changed files with 649 additions and 267 deletions
|
@ -31,6 +31,8 @@ precomputed-hash = "0.1"
|
||||||
servo_arc = { version = "0.1", path = "../servo_arc" }
|
servo_arc = { version = "0.1", path = "../servo_arc" }
|
||||||
smallvec = "0.6"
|
smallvec = "0.6"
|
||||||
thin-slice = "0.1.0"
|
thin-slice = "0.1.0"
|
||||||
|
to_shmem = { path = "../to_shmem" }
|
||||||
|
to_shmem_derive = { path = "../to_shmem_derive" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
phf_codegen = "0.7.18"
|
phf_codegen = "0.7.18"
|
||||||
|
|
|
@ -6,11 +6,15 @@ use crate::parser::SelectorImpl;
|
||||||
use cssparser::ToCss;
|
use cssparser::ToCss;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq, ToShmem)]
|
||||||
|
#[shmem(no_bounds)]
|
||||||
pub struct AttrSelectorWithOptionalNamespace<Impl: SelectorImpl> {
|
pub struct AttrSelectorWithOptionalNamespace<Impl: SelectorImpl> {
|
||||||
|
#[shmem(field_bound)]
|
||||||
pub namespace: Option<NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>>,
|
pub namespace: Option<NamespaceConstraint<(Impl::NamespacePrefix, Impl::NamespaceUrl)>>,
|
||||||
|
#[shmem(field_bound)]
|
||||||
pub local_name: Impl::LocalName,
|
pub local_name: Impl::LocalName,
|
||||||
pub local_name_lower: Impl::LocalName,
|
pub local_name_lower: Impl::LocalName,
|
||||||
|
#[shmem(field_bound)]
|
||||||
pub operation: ParsedAttrSelectorOperation<Impl::AttrValue>,
|
pub operation: ParsedAttrSelectorOperation<Impl::AttrValue>,
|
||||||
pub never_matches: bool,
|
pub never_matches: bool,
|
||||||
}
|
}
|
||||||
|
@ -24,7 +28,7 @@ impl<Impl: SelectorImpl> AttrSelectorWithOptionalNamespace<Impl> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq, ToShmem)]
|
||||||
pub enum NamespaceConstraint<NamespaceUrl> {
|
pub enum NamespaceConstraint<NamespaceUrl> {
|
||||||
Any,
|
Any,
|
||||||
|
|
||||||
|
@ -32,7 +36,7 @@ pub enum NamespaceConstraint<NamespaceUrl> {
|
||||||
Specific(NamespaceUrl),
|
Specific(NamespaceUrl),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq, ToShmem)]
|
||||||
pub enum ParsedAttrSelectorOperation<AttrValue> {
|
pub enum ParsedAttrSelectorOperation<AttrValue> {
|
||||||
Exists,
|
Exists,
|
||||||
WithValue {
|
WithValue {
|
||||||
|
@ -72,7 +76,7 @@ impl<AttrValue> AttrSelectorOperation<AttrValue> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
#[derive(Clone, Copy, Eq, PartialEq, ToShmem)]
|
||||||
pub enum AttrSelectorOperator {
|
pub enum AttrSelectorOperator {
|
||||||
Equal,
|
Equal,
|
||||||
Includes,
|
Includes,
|
||||||
|
@ -132,7 +136,7 @@ impl AttrSelectorOperator {
|
||||||
/// The definition of whitespace per CSS Selectors Level 3 § 4.
|
/// The definition of whitespace per CSS Selectors Level 3 § 4.
|
||||||
pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C'];
|
pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C'];
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)]
|
||||||
pub enum ParsedCaseSensitivity {
|
pub enum ParsedCaseSensitivity {
|
||||||
// 's' was specified.
|
// 's' was specified.
|
||||||
ExplicitCaseSensitive,
|
ExplicitCaseSensitive,
|
||||||
|
|
|
@ -199,7 +199,7 @@ pub const HAS_SLOTTED_BIT: u32 = 1 << 31;
|
||||||
|
|
||||||
/// We use ten bits for each specificity kind (id, class, element), and the two
|
/// We use ten bits for each specificity kind (id, class, element), and the two
|
||||||
/// high bits for the pseudo and slotted flags.
|
/// high bits for the pseudo and slotted flags.
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)]
|
||||||
pub struct SpecificityAndFlags(pub u32);
|
pub struct SpecificityAndFlags(pub u32);
|
||||||
|
|
||||||
impl SpecificityAndFlags {
|
impl SpecificityAndFlags {
|
||||||
|
|
|
@ -21,6 +21,9 @@ extern crate precomputed_hash;
|
||||||
extern crate servo_arc;
|
extern crate servo_arc;
|
||||||
extern crate smallvec;
|
extern crate smallvec;
|
||||||
extern crate thin_slice;
|
extern crate thin_slice;
|
||||||
|
extern crate to_shmem;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate to_shmem_derive;
|
||||||
|
|
||||||
pub mod attr;
|
pub mod attr;
|
||||||
pub mod bloom;
|
pub mod bloom;
|
||||||
|
|
|
@ -221,8 +221,9 @@ pub trait Parser<'i> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToShmem)]
|
||||||
pub struct SelectorList<Impl: SelectorImpl>(pub SmallVec<[Selector<Impl>; 1]>);
|
#[shmem(no_bounds)]
|
||||||
|
pub struct SelectorList<Impl: SelectorImpl>(#[shmem(field_bound)] pub SmallVec<[Selector<Impl>; 1]>);
|
||||||
|
|
||||||
impl<Impl: SelectorImpl> SelectorList<Impl> {
|
impl<Impl: SelectorImpl> SelectorList<Impl> {
|
||||||
/// Parse a comma-separated list of Selectors.
|
/// Parse a comma-separated list of Selectors.
|
||||||
|
@ -507,8 +508,9 @@ pub fn namespace_empty_string<Impl: SelectorImpl>() -> Impl::NamespaceUrl {
|
||||||
///
|
///
|
||||||
/// This reordering doesn't change the semantics of selector matching, and we
|
/// This reordering doesn't change the semantics of selector matching, and we
|
||||||
/// handle it in to_css to make it invisible to serialization.
|
/// handle it in to_css to make it invisible to serialization.
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq, ToShmem)]
|
||||||
pub struct Selector<Impl: SelectorImpl>(ThinArc<SpecificityAndFlags, Component<Impl>>);
|
#[shmem(no_bounds)]
|
||||||
|
pub struct Selector<Impl: SelectorImpl>(#[shmem(field_bound)] ThinArc<SpecificityAndFlags, Component<Impl>>);
|
||||||
|
|
||||||
impl<Impl: SelectorImpl> Selector<Impl> {
|
impl<Impl: SelectorImpl> Selector<Impl> {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -776,7 +778,7 @@ impl<'a, Impl: SelectorImpl> Iterator for AncestorIter<'a, Impl> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)]
|
||||||
pub enum Combinator {
|
pub enum Combinator {
|
||||||
Child, // >
|
Child, // >
|
||||||
Descendant, // space
|
Descendant, // space
|
||||||
|
@ -824,22 +826,24 @@ impl Combinator {
|
||||||
/// optimal packing and cache performance, see [1].
|
/// optimal packing and cache performance, see [1].
|
||||||
///
|
///
|
||||||
/// [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1357973
|
/// [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1357973
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq, ToShmem)]
|
||||||
|
#[shmem(no_bounds)]
|
||||||
pub enum Component<Impl: SelectorImpl> {
|
pub enum Component<Impl: SelectorImpl> {
|
||||||
Combinator(Combinator),
|
Combinator(Combinator),
|
||||||
|
|
||||||
ExplicitAnyNamespace,
|
ExplicitAnyNamespace,
|
||||||
ExplicitNoNamespace,
|
ExplicitNoNamespace,
|
||||||
DefaultNamespace(Impl::NamespaceUrl),
|
DefaultNamespace(#[shmem(field_bound)] Impl::NamespaceUrl),
|
||||||
Namespace(Impl::NamespacePrefix, Impl::NamespaceUrl),
|
Namespace(#[shmem(field_bound)] Impl::NamespacePrefix, #[shmem(field_bound)] Impl::NamespaceUrl),
|
||||||
|
|
||||||
ExplicitUniversalType,
|
ExplicitUniversalType,
|
||||||
LocalName(LocalName<Impl>),
|
LocalName(LocalName<Impl>),
|
||||||
|
|
||||||
ID(Impl::Identifier),
|
ID(#[shmem(field_bound)] Impl::Identifier),
|
||||||
Class(Impl::ClassName),
|
Class(#[shmem(field_bound)] Impl::ClassName),
|
||||||
|
|
||||||
AttributeInNoNamespaceExists {
|
AttributeInNoNamespaceExists {
|
||||||
|
#[shmem(field_bound)]
|
||||||
local_name: Impl::LocalName,
|
local_name: Impl::LocalName,
|
||||||
local_name_lower: Impl::LocalName,
|
local_name_lower: Impl::LocalName,
|
||||||
},
|
},
|
||||||
|
@ -847,6 +851,7 @@ pub enum Component<Impl: SelectorImpl> {
|
||||||
AttributeInNoNamespace {
|
AttributeInNoNamespace {
|
||||||
local_name: Impl::LocalName,
|
local_name: Impl::LocalName,
|
||||||
operator: AttrSelectorOperator,
|
operator: AttrSelectorOperator,
|
||||||
|
#[shmem(field_bound)]
|
||||||
value: Impl::AttrValue,
|
value: Impl::AttrValue,
|
||||||
case_sensitivity: ParsedCaseSensitivity,
|
case_sensitivity: ParsedCaseSensitivity,
|
||||||
never_matches: bool,
|
never_matches: bool,
|
||||||
|
@ -878,7 +883,7 @@ pub enum Component<Impl: SelectorImpl> {
|
||||||
FirstOfType,
|
FirstOfType,
|
||||||
LastOfType,
|
LastOfType,
|
||||||
OnlyOfType,
|
OnlyOfType,
|
||||||
NonTSPseudoClass(Impl::NonTSPseudoClass),
|
NonTSPseudoClass(#[shmem(field_bound)] Impl::NonTSPseudoClass),
|
||||||
/// The ::slotted() pseudo-element (which isn't actually a pseudo-element,
|
/// The ::slotted() pseudo-element (which isn't actually a pseudo-element,
|
||||||
/// and probably should be a pseudo-class):
|
/// and probably should be a pseudo-class):
|
||||||
///
|
///
|
||||||
|
@ -902,7 +907,7 @@ pub enum Component<Impl: SelectorImpl> {
|
||||||
///
|
///
|
||||||
/// See https://github.com/w3c/csswg-drafts/issues/2158
|
/// See https://github.com/w3c/csswg-drafts/issues/2158
|
||||||
Host(Option<Selector<Impl>>),
|
Host(Option<Selector<Impl>>),
|
||||||
PseudoElement(Impl::PseudoElement),
|
PseudoElement(#[shmem(field_bound)] Impl::PseudoElement),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Impl: SelectorImpl> Component<Impl> {
|
impl<Impl: SelectorImpl> Component<Impl> {
|
||||||
|
@ -957,8 +962,10 @@ impl<Impl: SelectorImpl> Component<Impl> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq, ToShmem)]
|
||||||
|
#[shmem(no_bounds)]
|
||||||
pub struct LocalName<Impl: SelectorImpl> {
|
pub struct LocalName<Impl: SelectorImpl> {
|
||||||
|
#[shmem(field_bound)]
|
||||||
pub name: Impl::LocalName,
|
pub name: Impl::LocalName,
|
||||||
pub lower_name: Impl::LocalName,
|
pub lower_name: Impl::LocalName,
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ macro_rules! counter_style_descriptors {
|
||||||
$( #[$doc: meta] $name: tt $ident: ident / $setter: ident [$checker: tt]: $ty: ty, )+
|
$( #[$doc: meta] $name: tt $ident: ident / $setter: ident [$checker: tt]: $ty: ty, )+
|
||||||
) => {
|
) => {
|
||||||
/// An @counter-style rule
|
/// An @counter-style rule
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, ToShmem)]
|
||||||
pub struct CounterStyleRuleData {
|
pub struct CounterStyleRuleData {
|
||||||
name: CustomIdent,
|
name: CustomIdent,
|
||||||
generation: Wrapping<u32>,
|
generation: Wrapping<u32>,
|
||||||
|
@ -337,7 +337,7 @@ impl CounterStyleRuleData {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-system>
|
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-system>
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, ToShmem)]
|
||||||
pub enum System {
|
pub enum System {
|
||||||
/// 'cyclic'
|
/// 'cyclic'
|
||||||
Cyclic,
|
Cyclic,
|
||||||
|
@ -410,7 +410,7 @@ impl ToCss for System {
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#typedef-symbol>
|
/// <https://drafts.csswg.org/css-counter-styles/#typedef-symbol>
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub enum Symbol {
|
pub enum Symbol {
|
||||||
/// <string>
|
/// <string>
|
||||||
String(String),
|
String(String),
|
||||||
|
@ -447,7 +447,7 @@ impl Symbol {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-negative>
|
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-negative>
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub struct Negative(pub Symbol, pub Option<Symbol>);
|
pub struct Negative(pub Symbol, pub Option<Symbol>);
|
||||||
|
|
||||||
impl Parse for Negative {
|
impl Parse for Negative {
|
||||||
|
@ -465,11 +465,11 @@ impl Parse for Negative {
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-range>
|
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-range>
|
||||||
///
|
///
|
||||||
/// Empty Vec represents 'auto'
|
/// Empty Vec represents 'auto'
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, ToShmem)]
|
||||||
pub struct Ranges(pub Vec<Range<CounterBound>>);
|
pub struct Ranges(pub Vec<Range<CounterBound>>);
|
||||||
|
|
||||||
/// A bound found in `Ranges`.
|
/// A bound found in `Ranges`.
|
||||||
#[derive(Clone, Copy, Debug, ToCss)]
|
#[derive(Clone, Copy, Debug, ToCss, ToShmem)]
|
||||||
pub enum CounterBound {
|
pub enum CounterBound {
|
||||||
/// An integer bound.
|
/// An integer bound.
|
||||||
Integer(Integer),
|
Integer(Integer),
|
||||||
|
@ -548,7 +548,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-pad>
|
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-pad>
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub struct Pad(pub Integer, pub Symbol);
|
pub struct Pad(pub Integer, pub Symbol);
|
||||||
|
|
||||||
impl Parse for Pad {
|
impl Parse for Pad {
|
||||||
|
@ -564,7 +564,7 @@ impl Parse for Pad {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-fallback>
|
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-fallback>
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub struct Fallback(pub CustomIdent);
|
pub struct Fallback(pub CustomIdent);
|
||||||
|
|
||||||
impl Parse for Fallback {
|
impl Parse for Fallback {
|
||||||
|
@ -578,7 +578,7 @@ impl Parse for Fallback {
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols>
|
/// <https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-symbols>
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct Symbols(#[css(iterable)] pub Vec<Symbol>);
|
pub struct Symbols(#[css(iterable)] pub Vec<Symbol>);
|
||||||
|
|
||||||
impl Parse for Symbols {
|
impl Parse for Symbols {
|
||||||
|
@ -602,7 +602,7 @@ impl Parse for Symbols {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-additive-symbols>
|
/// <https://drafts.csswg.org/css-counter-styles/#descdef-counter-style-additive-symbols>
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub struct AdditiveSymbols(pub Vec<AdditiveTuple>);
|
pub struct AdditiveSymbols(pub Vec<AdditiveTuple>);
|
||||||
|
|
||||||
impl Parse for AdditiveSymbols {
|
impl Parse for AdditiveSymbols {
|
||||||
|
@ -623,7 +623,7 @@ impl Parse for AdditiveSymbols {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <integer> && <symbol>
|
/// <integer> && <symbol>
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub struct AdditiveTuple {
|
pub struct AdditiveTuple {
|
||||||
/// <integer>
|
/// <integer>
|
||||||
pub weight: Integer,
|
pub weight: Integer,
|
||||||
|
@ -651,7 +651,7 @@ impl Parse for AdditiveTuple {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-speak-as>
|
/// <https://drafts.csswg.org/css-counter-styles/#counter-style-speak-as>
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub enum SpeakAs {
|
pub enum SpeakAs {
|
||||||
/// auto
|
/// auto
|
||||||
Auto,
|
Auto,
|
||||||
|
|
|
@ -96,7 +96,7 @@ pub fn parse_name(s: &str) -> Result<&str, ()> {
|
||||||
///
|
///
|
||||||
/// We preserve the original CSS for serialization, and also the variable
|
/// We preserve the original CSS for serialization, and also the variable
|
||||||
/// references to other custom property names.
|
/// references to other custom property names.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct VariableValue {
|
pub struct VariableValue {
|
||||||
css: String,
|
css: String,
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ use style_traits::{StyleParseErrorKind, ToCss};
|
||||||
|
|
||||||
/// A source for a font-face rule.
|
/// A source for a font-face rule.
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum Source {
|
pub enum Source {
|
||||||
/// A `url()` source.
|
/// A `url()` source.
|
||||||
Url(UrlSource),
|
Url(UrlSource),
|
||||||
|
@ -68,7 +68,7 @@ pub enum FontFaceSourceListComponent {
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-fonts/#src-desc>
|
/// <https://drafts.csswg.org/css-fonts/#src-desc>
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToShmem)]
|
||||||
pub struct UrlSource {
|
pub struct UrlSource {
|
||||||
/// The specified url.
|
/// The specified url.
|
||||||
pub url: SpecifiedUrl,
|
pub url: SpecifiedUrl,
|
||||||
|
@ -101,7 +101,9 @@ impl ToCss for UrlSource {
|
||||||
/// on whether and when it is downloaded and ready to use.
|
/// on whether and when it is downloaded and ready to use.
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum FontDisplay {
|
pub enum FontDisplay {
|
||||||
Auto,
|
Auto,
|
||||||
|
@ -144,7 +146,7 @@ macro_rules! impl_range {
|
||||||
/// The font-weight descriptor:
|
/// The font-weight descriptor:
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight
|
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
pub struct FontWeightRange(pub AbsoluteFontWeight, pub AbsoluteFontWeight);
|
pub struct FontWeightRange(pub AbsoluteFontWeight, pub AbsoluteFontWeight);
|
||||||
impl_range!(FontWeightRange, AbsoluteFontWeight);
|
impl_range!(FontWeightRange, AbsoluteFontWeight);
|
||||||
|
|
||||||
|
@ -176,7 +178,7 @@ impl FontWeightRange {
|
||||||
/// The font-stretch descriptor:
|
/// The font-stretch descriptor:
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-stretch
|
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-stretch
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
pub struct FontStretchRange(pub FontStretch, pub FontStretch);
|
pub struct FontStretchRange(pub FontStretch, pub FontStretch);
|
||||||
impl_range!(FontStretchRange, FontStretch);
|
impl_range!(FontStretchRange, FontStretch);
|
||||||
|
|
||||||
|
@ -205,7 +207,7 @@ impl FontStretchRange {
|
||||||
/// The font-style descriptor:
|
/// The font-style descriptor:
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-style
|
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-style
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum FontStyle {
|
pub enum FontStyle {
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -435,7 +437,7 @@ macro_rules! font_face_descriptors_common {
|
||||||
/// Data inside a `@font-face` rule.
|
/// Data inside a `@font-face` rule.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-fonts/#font-face-rule>
|
/// <https://drafts.csswg.org/css-fonts/#font-face-rule>
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
pub struct FontFaceRuleData {
|
pub struct FontFaceRuleData {
|
||||||
$(
|
$(
|
||||||
#[$doc]
|
#[$doc]
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
/// Gecko's pseudo-element definition.
|
/// Gecko's pseudo-element definition.
|
||||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum PseudoElement {
|
pub enum PseudoElement {
|
||||||
% for pseudo in PSEUDOS:
|
% for pseudo in PSEUDOS:
|
||||||
/// ${pseudo.value}
|
/// ${pseudo.value}
|
||||||
|
|
|
@ -44,7 +44,7 @@ pub type Lang = Atom;
|
||||||
macro_rules! pseudo_class_name {
|
macro_rules! pseudo_class_name {
|
||||||
([$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*]) => {
|
([$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*]) => {
|
||||||
/// Our representation of a non tree-structural pseudo-class.
|
/// Our representation of a non tree-structural pseudo-class.
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum NonTSPseudoClass {
|
pub enum NonTSPseudoClass {
|
||||||
$(
|
$(
|
||||||
#[doc = $css]
|
#[doc = $css]
|
||||||
|
|
|
@ -26,11 +26,11 @@ use to_shmem::{SharedMemoryBuilder, ToShmem};
|
||||||
|
|
||||||
/// A CSS url() value for gecko.
|
/// A CSS url() value for gecko.
|
||||||
#[css(function = "url")]
|
#[css(function = "url")]
|
||||||
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct CssUrl(pub Arc<CssUrlData>);
|
pub struct CssUrl(pub Arc<CssUrlData>);
|
||||||
|
|
||||||
/// Data shared between CssUrls.
|
/// Data shared between CssUrls.
|
||||||
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct CssUrlData {
|
pub struct CssUrlData {
|
||||||
/// The URL in unresolved string form.
|
/// The URL in unresolved string form.
|
||||||
serialization: String,
|
serialization: String,
|
||||||
|
@ -150,7 +150,7 @@ impl ToShmem for URLValueSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A specified non-image `url()` value.
|
/// A specified non-image `url()` value.
|
||||||
#[derive(Clone, Debug, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct SpecifiedUrl {
|
pub struct SpecifiedUrl {
|
||||||
/// The specified url value.
|
/// The specified url value.
|
||||||
pub url: CssUrl,
|
pub url: CssUrl,
|
||||||
|
@ -276,7 +276,7 @@ impl ToComputedValue for SpecifiedUrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A specified image `url()` value.
|
/// A specified image `url()` value.
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct SpecifiedImageUrl(pub SpecifiedUrl);
|
pub struct SpecifiedImageUrl(pub SpecifiedUrl);
|
||||||
|
|
||||||
impl SpecifiedImageUrl {
|
impl SpecifiedImageUrl {
|
||||||
|
|
|
@ -24,7 +24,7 @@ macro_rules! ns {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A Gecko namespace is just a wrapped atom.
|
/// A Gecko namespace is just a wrapped atom.
|
||||||
#[derive(Clone, Debug, Default, Eq, Hash, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Default, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct Namespace(pub Atom);
|
pub struct Namespace(pub Atom);
|
||||||
|
|
||||||
impl PrecomputedHash for Namespace {
|
impl PrecomputedHash for Namespace {
|
||||||
|
|
|
@ -100,6 +100,7 @@ extern crate style_traits;
|
||||||
extern crate thin_slice;
|
extern crate thin_slice;
|
||||||
extern crate time;
|
extern crate time;
|
||||||
extern crate to_shmem;
|
extern crate to_shmem;
|
||||||
|
#[macro_use]
|
||||||
extern crate to_shmem_derive;
|
extern crate to_shmem_derive;
|
||||||
extern crate uluru;
|
extern crate uluru;
|
||||||
extern crate unicode_bidi;
|
extern crate unicode_bidi;
|
||||||
|
|
|
@ -80,6 +80,7 @@ macro_rules! define_keyword_type {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct $name;
|
pub struct $name;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use std::fmt::{self, Write};
|
||||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||||
|
|
||||||
/// A binary `and` or `or` operator.
|
/// A binary `and` or `or` operator.
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss, ToShmem)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum Operator {
|
pub enum Operator {
|
||||||
And,
|
And,
|
||||||
|
@ -29,7 +29,7 @@ enum AllowOr {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents a media condition.
|
/// Represents a media condition.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum MediaCondition {
|
pub enum MediaCondition {
|
||||||
/// A simple media feature expression, implicitly parenthesized.
|
/// A simple media feature expression, implicitly parenthesized.
|
||||||
Feature(MediaFeatureExpression),
|
Feature(MediaFeatureExpression),
|
||||||
|
|
|
@ -27,7 +27,7 @@ use std::fmt::{self, Write};
|
||||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||||
|
|
||||||
/// An aspect ratio, with a numerator and denominator.
|
/// An aspect ratio, with a numerator and denominator.
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct AspectRatio(pub u32, pub u32);
|
pub struct AspectRatio(pub u32, pub u32);
|
||||||
|
|
||||||
impl ToCss for AspectRatio {
|
impl ToCss for AspectRatio {
|
||||||
|
@ -51,7 +51,7 @@ impl PartialOrd for AspectRatio {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The kind of matching that should be performed on a media feature value.
|
/// The kind of matching that should be performed on a media feature value.
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum Range {
|
pub enum Range {
|
||||||
/// At least the specified value.
|
/// At least the specified value.
|
||||||
Min,
|
Min,
|
||||||
|
@ -60,7 +60,7 @@ pub enum Range {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The operator that was specified in this media feature.
|
/// The operator that was specified in this media feature.
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum Operator {
|
pub enum Operator {
|
||||||
/// =
|
/// =
|
||||||
Equal,
|
Equal,
|
||||||
|
@ -93,7 +93,7 @@ impl ToCss for Operator {
|
||||||
///
|
///
|
||||||
/// Ranged media features are not allowed with operations (that'd make no
|
/// Ranged media features are not allowed with operations (that'd make no
|
||||||
/// sense).
|
/// sense).
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum RangeOrOperator {
|
pub enum RangeOrOperator {
|
||||||
/// A `Range`.
|
/// A `Range`.
|
||||||
Range(Range),
|
Range(Range),
|
||||||
|
@ -151,7 +151,7 @@ impl RangeOrOperator {
|
||||||
|
|
||||||
/// A feature expression contains a reference to the media feature, the value
|
/// A feature expression contains a reference to the media feature, the value
|
||||||
/// the media query contained, and the range to evaluate.
|
/// the media query contained, and the range to evaluate.
|
||||||
#[derive(Clone, Debug, MallocSizeOf)]
|
#[derive(Clone, Debug, MallocSizeOf, ToShmem)]
|
||||||
pub struct MediaFeatureExpression {
|
pub struct MediaFeatureExpression {
|
||||||
feature_index: usize,
|
feature_index: usize,
|
||||||
value: Option<MediaExpressionValue>,
|
value: Option<MediaExpressionValue>,
|
||||||
|
@ -467,7 +467,7 @@ impl MediaFeatureExpression {
|
||||||
/// If the first, this would need to store the relevant values.
|
/// If the first, this would need to store the relevant values.
|
||||||
///
|
///
|
||||||
/// See: https://github.com/w3c/csswg-drafts/issues/1968
|
/// See: https://github.com/w3c/csswg-drafts/issues/1968
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum MediaExpressionValue {
|
pub enum MediaExpressionValue {
|
||||||
/// A length.
|
/// A length.
|
||||||
Length(Length),
|
Length(Length),
|
||||||
|
|
|
@ -15,7 +15,7 @@ use cssparser::{ParserInput, Token};
|
||||||
|
|
||||||
/// A type that encapsulates a media query list.
|
/// A type that encapsulates a media query list.
|
||||||
#[css(comma, derive_debug)]
|
#[css(comma, derive_debug)]
|
||||||
#[derive(Clone, MallocSizeOf, ToCss)]
|
#[derive(Clone, MallocSizeOf, ToCss, ToShmem)]
|
||||||
pub struct MediaList {
|
pub struct MediaList {
|
||||||
/// The list of media queries.
|
/// The list of media queries.
|
||||||
#[css(iterable)]
|
#[css(iterable)]
|
||||||
|
|
|
@ -16,7 +16,7 @@ use std::fmt::{self, Write};
|
||||||
use style_traits::{CssWriter, ParseError, ToCss};
|
use style_traits::{CssWriter, ParseError, ToCss};
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/mediaqueries/#mq-prefix>
|
/// <https://drafts.csswg.org/mediaqueries/#mq-prefix>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum Qualifier {
|
pub enum Qualifier {
|
||||||
/// Hide a media query from legacy UAs:
|
/// Hide a media query from legacy UAs:
|
||||||
/// <https://drafts.csswg.org/mediaqueries/#mq-only>
|
/// <https://drafts.csswg.org/mediaqueries/#mq-only>
|
||||||
|
@ -27,7 +27,7 @@ pub enum Qualifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/mediaqueries/#media-types>
|
/// <https://drafts.csswg.org/mediaqueries/#media-types>
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct MediaType(pub CustomIdent);
|
pub struct MediaType(pub CustomIdent);
|
||||||
|
|
||||||
impl MediaType {
|
impl MediaType {
|
||||||
|
@ -58,7 +58,7 @@ impl MediaType {
|
||||||
/// A [media query][mq].
|
/// A [media query][mq].
|
||||||
///
|
///
|
||||||
/// [mq]: https://drafts.csswg.org/mediaqueries/
|
/// [mq]: https://drafts.csswg.org/mediaqueries/
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct MediaQuery {
|
pub struct MediaQuery {
|
||||||
/// The qualifier for this query.
|
/// The qualifier for this query.
|
||||||
pub qualifier: Option<Qualifier>,
|
pub qualifier: Option<Qualifier>,
|
||||||
|
@ -151,7 +151,7 @@ impl MediaQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <http://dev.w3.org/csswg/mediaqueries-3/#media0>
|
/// <http://dev.w3.org/csswg/mediaqueries-3/#media0>
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum MediaQueryType {
|
pub enum MediaQueryType {
|
||||||
/// A media type that matches every device.
|
/// A media type that matches every device.
|
||||||
All,
|
All,
|
||||||
|
|
|
@ -90,7 +90,7 @@ impl Importance {
|
||||||
|
|
||||||
/// Overridden declarations are skipped.
|
/// Overridden declarations are skipped.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone)]
|
#[derive(Clone, ToShmem)]
|
||||||
pub struct PropertyDeclarationBlock {
|
pub struct PropertyDeclarationBlock {
|
||||||
/// The group of declarations, along with their importance.
|
/// The group of declarations, along with their importance.
|
||||||
///
|
///
|
||||||
|
|
|
@ -205,7 +205,7 @@
|
||||||
% if separator == "Comma":
|
% if separator == "Comma":
|
||||||
#[css(comma)]
|
#[css(comma)]
|
||||||
% endif
|
% endif
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct SpecifiedValue(
|
pub struct SpecifiedValue(
|
||||||
% if not allow_empty:
|
% if not allow_empty:
|
||||||
#[css(iterable)]
|
#[css(iterable)]
|
||||||
|
@ -426,7 +426,7 @@
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse,
|
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse,
|
||||||
PartialEq, SpecifiedValueInfo, ToCss)]
|
PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum T {
|
pub enum T {
|
||||||
% for value in keyword.values_for(product):
|
% for value in keyword.values_for(product):
|
||||||
${to_camel_case(value)},
|
${to_camel_case(value)},
|
||||||
|
@ -437,7 +437,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum SpecifiedValue {
|
pub enum SpecifiedValue {
|
||||||
Keyword(computed_value::T),
|
Keyword(computed_value::T),
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
|
@ -589,7 +589,7 @@
|
||||||
% if extra_specified:
|
% if extra_specified:
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
|
||||||
SpecifiedValueInfo, ToCss)]
|
SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum SpecifiedValue {
|
pub enum SpecifiedValue {
|
||||||
${variants(keyword.values_for(product) + extra_specified.split(), bool(extra_specified))}
|
${variants(keyword.values_for(product) + extra_specified.split(), bool(extra_specified))}
|
||||||
}
|
}
|
||||||
|
@ -600,7 +600,7 @@
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss)]
|
||||||
% if not extra_specified:
|
% if not extra_specified:
|
||||||
#[derive(Parse, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(Parse, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
% endif
|
% endif
|
||||||
pub enum T {
|
pub enum T {
|
||||||
${variants(data.longhands_by_name[name].keyword.values_for(product), not extra_specified)}
|
${variants(data.longhands_by_name[name].keyword.values_for(product), not extra_specified)}
|
||||||
|
|
|
@ -346,7 +346,7 @@ ${helpers.predefined_type(
|
||||||
font_optical_sizing""".split()
|
font_optical_sizing""".split()
|
||||||
%>
|
%>
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq,
|
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq,
|
||||||
SpecifiedValueInfo, ToCss)]
|
SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum SystemFont {
|
pub enum SystemFont {
|
||||||
% for font in system_fonts:
|
% for font in system_fonts:
|
||||||
${to_camel_case(font)},
|
${to_camel_case(font)},
|
||||||
|
|
|
@ -257,6 +257,7 @@ pub mod shorthands {
|
||||||
%>
|
%>
|
||||||
|
|
||||||
/// Servo's representation for a property declaration.
|
/// Servo's representation for a property declaration.
|
||||||
|
#[derive(ToShmem)]
|
||||||
#[repr(u16)]
|
#[repr(u16)]
|
||||||
pub enum PropertyDeclaration {
|
pub enum PropertyDeclaration {
|
||||||
% for variant in variants:
|
% for variant in variants:
|
||||||
|
@ -896,7 +897,7 @@ impl LonghandIdSet {
|
||||||
|
|
||||||
/// An enum to represent a CSS Wide keyword.
|
/// An enum to represent a CSS Wide keyword.
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
|
||||||
ToCss)]
|
ToCss, ToShmem)]
|
||||||
pub enum CSSWideKeyword {
|
pub enum CSSWideKeyword {
|
||||||
/// The `initial` keyword.
|
/// The `initial` keyword.
|
||||||
Initial,
|
Initial,
|
||||||
|
@ -996,7 +997,7 @@ pub enum LogicalGroup {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An identifier for a given longhand property.
|
/// An identifier for a given longhand property.
|
||||||
#[derive(Clone, Copy, Eq, Hash, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
#[repr(u16)]
|
#[repr(u16)]
|
||||||
pub enum LonghandId {
|
pub enum LonghandId {
|
||||||
% for i, property in enumerate(data.longhands):
|
% for i, property in enumerate(data.longhands):
|
||||||
|
@ -1338,7 +1339,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An identifier for a given shorthand property.
|
/// An identifier for a given shorthand property.
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
#[repr(u16)]
|
#[repr(u16)]
|
||||||
pub enum ShorthandId {
|
pub enum ShorthandId {
|
||||||
% for i, property in enumerate(data.shorthands):
|
% for i, property in enumerate(data.shorthands):
|
||||||
|
@ -1536,7 +1537,7 @@ impl ShorthandId {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An unparsed property value that contains `var()` functions.
|
/// An unparsed property value that contains `var()` functions.
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq, ToShmem)]
|
||||||
pub struct UnparsedValue {
|
pub struct UnparsedValue {
|
||||||
/// The css serialization for this value.
|
/// The css serialization for this value.
|
||||||
css: String,
|
css: String,
|
||||||
|
@ -1957,7 +1958,7 @@ impl PropertyId {
|
||||||
|
|
||||||
/// A declaration using a CSS-wide keyword.
|
/// A declaration using a CSS-wide keyword.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, PartialEq, ToCss)]
|
#[derive(Clone, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct WideKeywordDeclaration {
|
pub struct WideKeywordDeclaration {
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
id: LonghandId,
|
id: LonghandId,
|
||||||
|
@ -1966,7 +1967,7 @@ pub struct WideKeywordDeclaration {
|
||||||
|
|
||||||
/// An unparsed declaration that contains `var()` functions.
|
/// An unparsed declaration that contains `var()` functions.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, PartialEq, ToCss)]
|
#[derive(Clone, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct VariableDeclaration {
|
pub struct VariableDeclaration {
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
id: LonghandId,
|
id: LonghandId,
|
||||||
|
@ -1976,7 +1977,7 @@ pub struct VariableDeclaration {
|
||||||
|
|
||||||
/// A custom property declaration value is either an unparsed value or a CSS
|
/// A custom property declaration value is either an unparsed value or a CSS
|
||||||
/// wide-keyword.
|
/// wide-keyword.
|
||||||
#[derive(Clone, PartialEq, ToCss)]
|
#[derive(Clone, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum CustomDeclarationValue {
|
pub enum CustomDeclarationValue {
|
||||||
/// A value.
|
/// A value.
|
||||||
Value(Arc<crate::custom_properties::SpecifiedValue>),
|
Value(Arc<crate::custom_properties::SpecifiedValue>),
|
||||||
|
@ -1986,7 +1987,7 @@ pub enum CustomDeclarationValue {
|
||||||
|
|
||||||
/// A custom property declaration with the property name and the declared value.
|
/// A custom property declaration with the property name and the declared value.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, PartialEq, ToCss)]
|
#[derive(Clone, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct CustomDeclaration {
|
pub struct CustomDeclaration {
|
||||||
/// The name of the custom property.
|
/// The name of the custom property.
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
|
|
|
@ -177,7 +177,7 @@ impl<T> PerPseudoElementMap<T> {
|
||||||
/// Values for the :dir() pseudo class
|
/// Values for the :dir() pseudo class
|
||||||
///
|
///
|
||||||
/// "ltr" and "rtl" values are normalized to lowercase.
|
/// "ltr" and "rtl" values are normalized to lowercase.
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct Direction(pub Atom);
|
pub struct Direction(pub Atom);
|
||||||
|
|
||||||
/// Horizontal values for the :dir() pseudo class
|
/// Horizontal values for the :dir() pseudo class
|
||||||
|
|
|
@ -20,7 +20,7 @@ use servo_arc::Arc;
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
/// A @-moz-document rule
|
/// A @-moz-document rule
|
||||||
pub struct DocumentRule {
|
pub struct DocumentRule {
|
||||||
/// The parsed condition
|
/// The parsed condition
|
||||||
|
@ -72,7 +72,7 @@ impl DeepCloneWithLock for DocumentRule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The kind of media document that the rule will match.
|
/// The kind of media document that the rule will match.
|
||||||
#[derive(Clone, Copy, Debug, Parse, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, Parse, PartialEq, ToCss, ToShmem)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum MediaDocumentKind {
|
pub enum MediaDocumentKind {
|
||||||
All,
|
All,
|
||||||
|
@ -82,7 +82,7 @@ pub enum MediaDocumentKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A matching function for a `@document` rule's condition.
|
/// A matching function for a `@document` rule's condition.
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub enum DocumentMatchingFunction {
|
pub enum DocumentMatchingFunction {
|
||||||
/// Exact URL matching function. It evaluates to true whenever the
|
/// Exact URL matching function. It evaluates to true whenever the
|
||||||
/// URL of the document being styled is exactly the URL given.
|
/// URL of the document being styled is exactly the URL given.
|
||||||
|
@ -216,7 +216,7 @@ impl DocumentMatchingFunction {
|
||||||
/// URL matching functions, and the condition evaluates to true whenever any
|
/// URL matching functions, and the condition evaluates to true whenever any
|
||||||
/// one of those functions evaluates to true.
|
/// one of those functions evaluates to true.
|
||||||
#[css(comma)]
|
#[css(comma)]
|
||||||
#[derive(Clone, Debug, ToCss)]
|
#[derive(Clone, Debug, ToCss, ToShmem)]
|
||||||
pub struct DocumentCondition(#[css(iterable)] Vec<DocumentMatchingFunction>);
|
pub struct DocumentCondition(#[css(iterable)] Vec<DocumentMatchingFunction>);
|
||||||
|
|
||||||
impl DocumentCondition {
|
impl DocumentCondition {
|
||||||
|
|
|
@ -30,7 +30,7 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||||
/// - `SingleValue` is to keep just one unsigned integer value.
|
/// - `SingleValue` is to keep just one unsigned integer value.
|
||||||
/// - `PairValues` is to keep one or two unsigned integer values.
|
/// - `PairValues` is to keep one or two unsigned integer values.
|
||||||
/// - `VectorValues` is to keep a list of unsigned integer values.
|
/// - `VectorValues` is to keep a list of unsigned integer values.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
pub struct FFVDeclaration<T> {
|
pub struct FFVDeclaration<T> {
|
||||||
/// An `<ident>` for declaration name.
|
/// An `<ident>` for declaration name.
|
||||||
pub name: Atom,
|
pub name: Atom,
|
||||||
|
@ -58,7 +58,7 @@ pub trait ToGeckoFontFeatureValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A @font-feature-values block declaration value that keeps one value.
|
/// A @font-feature-values block declaration value that keeps one value.
|
||||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
#[derive(Clone, Debug, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct SingleValue(pub u32);
|
pub struct SingleValue(pub u32);
|
||||||
|
|
||||||
impl Parse for SingleValue {
|
impl Parse for SingleValue {
|
||||||
|
@ -87,7 +87,7 @@ impl ToGeckoFontFeatureValues for SingleValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A @font-feature-values block declaration value that keeps one or two values.
|
/// A @font-feature-values block declaration value that keeps one or two values.
|
||||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
#[derive(Clone, Debug, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct PairValues(pub u32, pub Option<u32>);
|
pub struct PairValues(pub u32, pub Option<u32>);
|
||||||
|
|
||||||
impl Parse for PairValues {
|
impl Parse for PairValues {
|
||||||
|
@ -131,7 +131,7 @@ impl ToGeckoFontFeatureValues for PairValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A @font-feature-values block declaration value that keeps a list of values.
|
/// A @font-feature-values block declaration value that keeps a list of values.
|
||||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
#[derive(Clone, Debug, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct VectorValues(#[css(iterable)] pub Vec<u32>);
|
pub struct VectorValues(#[css(iterable)] pub Vec<u32>);
|
||||||
|
|
||||||
impl Parse for VectorValues {
|
impl Parse for VectorValues {
|
||||||
|
@ -225,7 +225,7 @@ macro_rules! font_feature_values_blocks {
|
||||||
/// The [`@font-feature-values`][font-feature-values] at-rule.
|
/// The [`@font-feature-values`][font-feature-values] at-rule.
|
||||||
///
|
///
|
||||||
/// [font-feature-values]: https://drafts.csswg.org/css-fonts-3/#at-font-feature-values-rule
|
/// [font-feature-values]: https://drafts.csswg.org/css-fonts-3/#at-font-feature-values-rule
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
pub struct FontFeatureValuesRule {
|
pub struct FontFeatureValuesRule {
|
||||||
/// Font family list for @font-feature-values rule.
|
/// Font family list for @font-feature-values rule.
|
||||||
/// Family names cannot contain generic families. FamilyName
|
/// Family names cannot contain generic families. FamilyName
|
||||||
|
|
|
@ -26,7 +26,7 @@ use style_traits::{CssWriter, ParseError, ParsingMode, StyleParseErrorKind, ToCs
|
||||||
/// A [`@keyframes`][keyframes] rule.
|
/// A [`@keyframes`][keyframes] rule.
|
||||||
///
|
///
|
||||||
/// [keyframes]: https://drafts.csswg.org/css-animations/#keyframes
|
/// [keyframes]: https://drafts.csswg.org/css-animations/#keyframes
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
pub struct KeyframesRule {
|
pub struct KeyframesRule {
|
||||||
/// The name of the current animation.
|
/// The name of the current animation.
|
||||||
pub name: KeyframesName,
|
pub name: KeyframesName,
|
||||||
|
@ -99,7 +99,7 @@ impl DeepCloneWithLock for KeyframesRule {
|
||||||
|
|
||||||
/// A number from 0 to 1, indicating the percentage of the animation when this
|
/// A number from 0 to 1, indicating the percentage of the animation when this
|
||||||
/// keyframe should run.
|
/// keyframe should run.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToShmem)]
|
||||||
pub struct KeyframePercentage(pub f32);
|
pub struct KeyframePercentage(pub f32);
|
||||||
|
|
||||||
impl ::std::cmp::Ord for KeyframePercentage {
|
impl ::std::cmp::Ord for KeyframePercentage {
|
||||||
|
@ -150,7 +150,7 @@ impl KeyframePercentage {
|
||||||
/// A keyframes selector is a list of percentages or from/to symbols, which are
|
/// A keyframes selector is a list of percentages or from/to symbols, which are
|
||||||
/// converted at parse time to percentages.
|
/// converted at parse time to percentages.
|
||||||
#[css(comma)]
|
#[css(comma)]
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, ToCss)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct KeyframeSelector(#[css(iterable)] Vec<KeyframePercentage>);
|
pub struct KeyframeSelector(#[css(iterable)] Vec<KeyframePercentage>);
|
||||||
|
|
||||||
impl KeyframeSelector {
|
impl KeyframeSelector {
|
||||||
|
@ -174,7 +174,7 @@ impl KeyframeSelector {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A keyframe.
|
/// A keyframe.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
pub struct Keyframe {
|
pub struct Keyframe {
|
||||||
/// The selector this keyframe was specified from.
|
/// The selector this keyframe was specified from.
|
||||||
pub selector: KeyframeSelector,
|
pub selector: KeyframeSelector,
|
||||||
|
|
|
@ -21,7 +21,7 @@ use style_traits::{CssWriter, ToCss};
|
||||||
/// An [`@media`][media] urle.
|
/// An [`@media`][media] urle.
|
||||||
///
|
///
|
||||||
/// [media]: https://drafts.csswg.org/css-conditional/#at-ruledef-media
|
/// [media]: https://drafts.csswg.org/css-conditional/#at-ruledef-media
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
pub struct MediaRule {
|
pub struct MediaRule {
|
||||||
/// The list of media queries used by this media rule.
|
/// The list of media queries used by this media rule.
|
||||||
pub media_queries: Arc<Locked<MediaList>>,
|
pub media_queries: Arc<Locked<MediaList>>,
|
||||||
|
|
|
@ -204,7 +204,7 @@ impl Eq for UrlExtraData {}
|
||||||
/// A CSS rule.
|
/// A CSS rule.
|
||||||
///
|
///
|
||||||
/// TODO(emilio): Lots of spec links should be around.
|
/// TODO(emilio): Lots of spec links should be around.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, ToShmem)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum CssRule {
|
pub enum CssRule {
|
||||||
// No Charset here, CSSCharsetRule has been removed from CSSOM
|
// No Charset here, CSSCharsetRule has been removed from CSSOM
|
||||||
|
|
|
@ -11,7 +11,7 @@ use cssparser::SourceLocation;
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
|
|
||||||
/// A `@namespace` rule.
|
/// A `@namespace` rule.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub struct NamespaceRule {
|
pub struct NamespaceRule {
|
||||||
/// The namespace prefix, and `None` if it's the default Namespace
|
/// The namespace prefix, and `None` if it's the default Namespace
|
||||||
|
|
|
@ -10,7 +10,7 @@ use std::ops::BitOrAssign;
|
||||||
/// Each style rule has an origin, which determines where it enters the cascade.
|
/// Each style rule has an origin, which determines where it enters the cascade.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-cascade/#cascading-origins>
|
/// <https://drafts.csswg.org/css-cascade/#cascading-origins>
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToShmem)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||||
pub enum Origin {
|
pub enum Origin {
|
||||||
|
|
|
@ -25,7 +25,7 @@ use std::fmt::{self, Write};
|
||||||
///
|
///
|
||||||
/// [page]: https://drafts.csswg.org/css2/page.html#page-box
|
/// [page]: https://drafts.csswg.org/css2/page.html#page-box
|
||||||
/// [page-selectors]: https://drafts.csswg.org/css2/page.html#page-selectors
|
/// [page-selectors]: https://drafts.csswg.org/css2/page.html#page-selectors
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
pub struct PageRule {
|
pub struct PageRule {
|
||||||
/// The declaration block this page rule contains.
|
/// The declaration block this page rule contains.
|
||||||
pub block: Arc<Locked<PropertyDeclarationBlock>>,
|
pub block: Arc<Locked<PropertyDeclarationBlock>>,
|
||||||
|
|
|
@ -17,7 +17,7 @@ use servo_arc::{Arc, RawOffsetArc};
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
|
|
||||||
/// A list of CSS rules.
|
/// A list of CSS rules.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
pub struct CssRules(pub Vec<CssRule>);
|
pub struct CssRules(pub Vec<CssRule>);
|
||||||
|
|
||||||
impl CssRules {
|
impl CssRules {
|
||||||
|
|
|
@ -133,7 +133,7 @@ pub enum State {
|
||||||
Body = 4,
|
Body = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf)]
|
#[derive(Clone, Debug, MallocSizeOf, ToShmem)]
|
||||||
/// Vendor prefix.
|
/// Vendor prefix.
|
||||||
pub enum VendorPrefix {
|
pub enum VendorPrefix {
|
||||||
/// -moz prefix.
|
/// -moz prefix.
|
||||||
|
|
|
@ -19,7 +19,7 @@ use servo_arc::Arc;
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
|
|
||||||
/// A style rule, with selectors and declarations.
|
/// A style rule, with selectors and declarations.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
pub struct StyleRule {
|
pub struct StyleRule {
|
||||||
/// The list of selectors in this rule.
|
/// The list of selectors in this rule.
|
||||||
pub selectors: SelectorList<SelectorImpl>,
|
pub selectors: SelectorList<SelectorImpl>,
|
||||||
|
|
|
@ -26,7 +26,7 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||||
/// An [`@supports`][supports] rule.
|
/// An [`@supports`][supports] rule.
|
||||||
///
|
///
|
||||||
/// [supports]: https://drafts.csswg.org/css-conditional-3/#at-supports
|
/// [supports]: https://drafts.csswg.org/css-conditional-3/#at-supports
|
||||||
#[derive(Debug)]
|
#[derive(Debug, ToShmem)]
|
||||||
pub struct SupportsRule {
|
pub struct SupportsRule {
|
||||||
/// The parsed condition
|
/// The parsed condition
|
||||||
pub condition: SupportsCondition,
|
pub condition: SupportsCondition,
|
||||||
|
@ -76,7 +76,7 @@ impl DeepCloneWithLock for SupportsRule {
|
||||||
/// An @supports condition
|
/// An @supports condition
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-conditional-3/#at-supports>
|
/// <https://drafts.csswg.org/css-conditional-3/#at-supports>
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, ToShmem)]
|
||||||
pub enum SupportsCondition {
|
pub enum SupportsCondition {
|
||||||
/// `not (condition)`
|
/// `not (condition)`
|
||||||
Not(Box<SupportsCondition>),
|
Not(Box<SupportsCondition>),
|
||||||
|
@ -305,7 +305,7 @@ impl ToCss for SupportsCondition {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, ToShmem)]
|
||||||
/// A possibly-invalid CSS selector.
|
/// A possibly-invalid CSS selector.
|
||||||
pub struct RawSelector(pub String);
|
pub struct RawSelector(pub String);
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ impl RawSelector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, ToShmem)]
|
||||||
/// A possibly-invalid property declaration
|
/// A possibly-invalid property declaration
|
||||||
pub struct Declaration(pub String);
|
pub struct Declaration(pub String);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ macro_rules! declare_viewport_descriptor_inner {
|
||||||
[ ]
|
[ ]
|
||||||
$number_of_variants: expr
|
$number_of_variants: expr
|
||||||
) => {
|
) => {
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum ViewportDescriptor {
|
pub enum ViewportDescriptor {
|
||||||
|
@ -147,7 +147,7 @@ trait FromMeta: Sized {
|
||||||
/// * http://dev.w3.org/csswg/css-device-adapt/#extend-to-zoom
|
/// * http://dev.w3.org/csswg/css-device-adapt/#extend-to-zoom
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
#[derive(Clone, Debug, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum ViewportLength {
|
pub enum ViewportLength {
|
||||||
Specified(NonNegativeLengthPercentageOrAuto),
|
Specified(NonNegativeLengthPercentageOrAuto),
|
||||||
ExtendToZoom,
|
ExtendToZoom,
|
||||||
|
@ -225,7 +225,7 @@ struct ViewportRuleParser<'a, 'b: 'a> {
|
||||||
context: &'a ParserContext<'b>,
|
context: &'a ParserContext<'b>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub struct ViewportDescriptorDeclaration {
|
pub struct ViewportDescriptorDeclaration {
|
||||||
|
@ -335,7 +335,7 @@ impl<'a, 'b, 'i> DeclarationParser<'i> for ViewportRuleParser<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A `@viewport` rule.
|
/// A `@viewport` rule.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, ToShmem)]
|
||||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||||
pub struct ViewportRule {
|
pub struct ViewportRule {
|
||||||
/// The declarations contained in this @viewport rule.
|
/// The declarations contained in this @viewport rule.
|
||||||
|
|
|
@ -225,7 +225,7 @@ impl ToCss for FontFamily {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
/// The name of a font family of choice
|
/// The name of a font family of choice
|
||||||
pub struct FamilyName {
|
pub struct FamilyName {
|
||||||
|
@ -268,7 +268,7 @@ impl ToCss for FamilyName {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
/// Font family names must either be given quoted as strings,
|
/// Font family names must either be given quoted as strings,
|
||||||
/// or unquoted as a sequence of one or more identifiers.
|
/// or unquoted as a sequence of one or more identifiers.
|
||||||
|
|
|
@ -608,6 +608,7 @@ impl Size {
|
||||||
PartialOrd,
|
PartialOrd,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct CSSPixelLength(CSSFloat);
|
pub struct CSSPixelLength(CSSFloat);
|
||||||
|
@ -809,6 +810,7 @@ pub type NonNegativeLengthOrNumber = GenericLengthOrNumber<NonNegativeLength, No
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum ExtremumLength {
|
pub enum ExtremumLength {
|
||||||
|
|
|
@ -27,6 +27,7 @@ use style_traits::{CssWriter, ToCss};
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct Percentage(pub CSSFloat);
|
pub struct Percentage(pub CSSFloat);
|
||||||
|
|
|
@ -27,6 +27,7 @@ fn width_and_height_are_auto<L>(
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
pub enum GenericBackgroundSize<LengthPercent> {
|
pub enum GenericBackgroundSize<LengthPercent> {
|
||||||
|
|
|
@ -31,6 +31,7 @@ pub type ClippingShape<BasicShape, Url> = ShapeSource<BasicShape, GeometryBox, U
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum GeometryBox {
|
pub enum GeometryBox {
|
||||||
FillBox,
|
FillBox,
|
||||||
|
@ -58,6 +59,7 @@ pub type FloatAreaShape<BasicShape, Image> = ShapeSource<BasicShape, ShapeBox, I
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum ShapeBox {
|
pub enum ShapeBox {
|
||||||
MarginBox,
|
MarginBox,
|
||||||
|
@ -79,6 +81,7 @@ pub enum ShapeBox {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum ShapeSource<BasicShape, ReferenceBox, ImageOrUrl> {
|
pub enum ShapeSource<BasicShape, ReferenceBox, ImageOrUrl> {
|
||||||
#[animation(error)]
|
#[animation(error)]
|
||||||
|
@ -104,11 +107,24 @@ pub enum ShapeSource<BasicShape, ReferenceBox, ImageOrUrl> {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum BasicShape<H, V, LengthPercentage, NonNegativeLengthPercentage> {
|
pub enum BasicShape<H, V, LengthPercentage, NonNegativeLengthPercentage> {
|
||||||
Inset(#[css(field_bound)] InsetRect<LengthPercentage, NonNegativeLengthPercentage>),
|
Inset(
|
||||||
Circle(#[css(field_bound)] Circle<H, V, NonNegativeLengthPercentage>),
|
#[css(field_bound)]
|
||||||
Ellipse(#[css(field_bound)] Ellipse<H, V, NonNegativeLengthPercentage>),
|
#[shmem(field_bound)]
|
||||||
|
InsetRect<LengthPercentage, NonNegativeLengthPercentage>,
|
||||||
|
),
|
||||||
|
Circle(
|
||||||
|
#[css(field_bound)]
|
||||||
|
#[shmem(field_bound)]
|
||||||
|
Circle<H, V, NonNegativeLengthPercentage>,
|
||||||
|
),
|
||||||
|
Ellipse(
|
||||||
|
#[css(field_bound)]
|
||||||
|
#[shmem(field_bound)]
|
||||||
|
Ellipse<H, V, NonNegativeLengthPercentage>,
|
||||||
|
),
|
||||||
Polygon(Polygon<LengthPercentage>),
|
Polygon(Polygon<LengthPercentage>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,9 +141,11 @@ pub enum BasicShape<H, V, LengthPercentage, NonNegativeLengthPercentage> {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> {
|
pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> {
|
||||||
pub rect: Rect<LengthPercentage>,
|
pub rect: Rect<LengthPercentage>,
|
||||||
|
#[shmem(field_bound)]
|
||||||
pub round: BorderRadius<NonNegativeLengthPercentage>,
|
pub round: BorderRadius<NonNegativeLengthPercentage>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +163,7 @@ pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct Circle<H, V, NonNegativeLengthPercentage> {
|
pub struct Circle<H, V, NonNegativeLengthPercentage> {
|
||||||
pub position: Position<H, V>,
|
pub position: Position<H, V>,
|
||||||
|
@ -165,6 +184,7 @@ pub struct Circle<H, V, NonNegativeLengthPercentage> {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct Ellipse<H, V, NonNegativeLengthPercentage> {
|
pub struct Ellipse<H, V, NonNegativeLengthPercentage> {
|
||||||
pub position: Position<H, V>,
|
pub position: Position<H, V>,
|
||||||
|
@ -186,6 +206,7 @@ pub struct Ellipse<H, V, NonNegativeLengthPercentage> {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum ShapeRadius<NonNegativeLengthPercentage> {
|
pub enum ShapeRadius<NonNegativeLengthPercentage> {
|
||||||
Length(NonNegativeLengthPercentage),
|
Length(NonNegativeLengthPercentage),
|
||||||
|
@ -208,6 +229,7 @@ pub enum ShapeRadius<NonNegativeLengthPercentage> {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct Polygon<LengthPercentage> {
|
pub struct Polygon<LengthPercentage> {
|
||||||
/// The filling rule for a polygon.
|
/// The filling rule for a polygon.
|
||||||
|
@ -228,6 +250,7 @@ pub struct Polygon<LengthPercentage> {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct PolygonCoord<LengthPercentage>(pub LengthPercentage, pub LengthPercentage);
|
pub struct PolygonCoord<LengthPercentage>(pub LengthPercentage, pub LengthPercentage);
|
||||||
|
|
||||||
|
@ -249,6 +272,7 @@ pub struct PolygonCoord<LengthPercentage>(pub LengthPercentage, pub LengthPercen
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum FillRule {
|
pub enum FillRule {
|
||||||
|
@ -270,6 +294,7 @@ pub enum FillRule {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct Path {
|
pub struct Path {
|
||||||
/// The filling rule for the svg path.
|
/// The filling rule for the svg path.
|
||||||
|
|
|
@ -12,7 +12,15 @@ use style_traits::{CssWriter, ToCss};
|
||||||
|
|
||||||
/// A generic value for a single side of a `border-image-width` property.
|
/// A generic value for a single side of a `border-image-width` property.
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum BorderImageSideWidth<LengthPercentage, Number> {
|
pub enum BorderImageSideWidth<LengthPercentage, Number> {
|
||||||
/// `<length-or-percentage>`
|
/// `<length-or-percentage>`
|
||||||
|
@ -25,7 +33,15 @@ pub enum BorderImageSideWidth<LengthPercentage, Number> {
|
||||||
|
|
||||||
/// A generic value for the `border-image-slice` property.
|
/// A generic value for the `border-image-slice` property.
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct GenericBorderImageSlice<NumberOrPercentage> {
|
pub struct GenericBorderImageSlice<NumberOrPercentage> {
|
||||||
|
@ -53,9 +69,10 @@ pub use self::GenericBorderImageSlice as BorderImageSlice;
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct GenericBorderCornerRadius<L>(#[css(field_bound)] pub Size2D<L>);
|
pub struct GenericBorderCornerRadius<L>(#[css(field_bound)] #[shmem(field_bound)] pub Size2D<L>);
|
||||||
|
|
||||||
pub use self::GenericBorderCornerRadius as BorderCornerRadius;
|
pub use self::GenericBorderCornerRadius as BorderCornerRadius;
|
||||||
|
|
||||||
|
@ -90,9 +107,10 @@ impl<L: Zero> Zero for BorderCornerRadius<L> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct BorderSpacing<L>(#[css(field_bound)] pub Size2D<L>);
|
pub struct BorderSpacing<L>(#[css(field_bound)] #[shmem(field_bound)] pub Size2D<L>);
|
||||||
|
|
||||||
impl<L> BorderSpacing<L> {
|
impl<L> BorderSpacing<L> {
|
||||||
/// Trivially create a `BorderCornerRadius`.
|
/// Trivially create a `BorderCornerRadius`.
|
||||||
|
@ -115,10 +133,12 @@ impl<L> BorderSpacing<L> {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct GenericBorderRadius<LengthPercentage> {
|
pub struct GenericBorderRadius<LengthPercentage> {
|
||||||
/// The top left radius.
|
/// The top left radius.
|
||||||
|
#[shmem(field_bound)]
|
||||||
pub top_left: GenericBorderCornerRadius<LengthPercentage>,
|
pub top_left: GenericBorderCornerRadius<LengthPercentage>,
|
||||||
/// The top right radius.
|
/// The top right radius.
|
||||||
pub top_right: GenericBorderCornerRadius<LengthPercentage>,
|
pub top_right: GenericBorderCornerRadius<LengthPercentage>,
|
||||||
|
|
|
@ -18,6 +18,7 @@ use crate::values::animated::ToAnimatedZero;
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum VerticalAlign<LengthPercentage> {
|
pub enum VerticalAlign<LengthPercentage> {
|
||||||
/// `baseline`
|
/// `baseline`
|
||||||
|
@ -58,7 +59,9 @@ impl<L> ToAnimatedZero for VerticalAlign<L> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://drafts.csswg.org/css-animations/#animation-iteration-count
|
/// https://drafts.csswg.org/css-animations/#animation-iteration-count
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum AnimationIterationCount<Number> {
|
pub enum AnimationIterationCount<Number> {
|
||||||
/// A `<number>` value.
|
/// A `<number>` value.
|
||||||
Number(Number),
|
Number(Number),
|
||||||
|
@ -81,6 +84,7 @@ pub enum AnimationIterationCount<Number> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
pub enum GenericPerspective<NonNegativeLength> {
|
pub enum GenericPerspective<NonNegativeLength> {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
/// Ratios representing the contribution of color and currentcolor to
|
/// Ratios representing the contribution of color and currentcolor to
|
||||||
/// the final color value.
|
/// the final color value.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue, ToShmem)]
|
||||||
pub struct ComplexColorRatios {
|
pub struct ComplexColorRatios {
|
||||||
/// Numeric color contribution.
|
/// Numeric color contribution.
|
||||||
pub bg: f32,
|
pub bg: f32,
|
||||||
|
@ -23,7 +23,7 @@ impl ComplexColorRatios {
|
||||||
|
|
||||||
/// This enum represents a combined color from a numeric color and
|
/// This enum represents a combined color from a numeric color and
|
||||||
/// the current foreground color (currentcolor keyword).
|
/// the current foreground color (currentcolor keyword).
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue, ToShmem)]
|
||||||
pub enum Color<RGBA> {
|
pub enum Color<RGBA> {
|
||||||
/// Numeric RGBA color.
|
/// Numeric RGBA color.
|
||||||
Numeric(RGBA),
|
Numeric(RGBA),
|
||||||
|
@ -90,6 +90,7 @@ impl<RGBA> From<RGBA> for Color<RGBA> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum ColorOrAuto<C> {
|
pub enum ColorOrAuto<C> {
|
||||||
/// A `<color>
|
/// A `<color>
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum ColumnCount<PositiveInteger> {
|
pub enum ColumnCount<PositiveInteger> {
|
||||||
/// A positive integer.
|
/// A positive integer.
|
||||||
|
|
|
@ -14,7 +14,9 @@ use crate::values::CustomIdent;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
/// A name / value pair for counters.
|
/// A name / value pair for counters.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct CounterPair<Integer> {
|
pub struct CounterPair<Integer> {
|
||||||
/// The name of the counter.
|
/// The name of the counter.
|
||||||
pub name: CustomIdent,
|
pub name: CustomIdent,
|
||||||
|
@ -24,7 +26,15 @@ pub struct CounterPair<Integer> {
|
||||||
|
|
||||||
/// A generic value for the `counter-increment` property.
|
/// A generic value for the `counter-increment` property.
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Debug,
|
||||||
|
Default,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct CounterIncrement<I>(Counters<I>);
|
pub struct CounterIncrement<I>(Counters<I>);
|
||||||
|
|
||||||
|
@ -47,7 +57,15 @@ impl<I> Deref for CounterIncrement<I> {
|
||||||
|
|
||||||
/// A generic value for the `counter-set` and `counter-reset` properties.
|
/// A generic value for the `counter-set` and `counter-reset` properties.
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Debug,
|
||||||
|
Default,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct CounterSetOrReset<I>(Counters<I>);
|
pub struct CounterSetOrReset<I>(Counters<I>);
|
||||||
|
|
||||||
|
@ -71,7 +89,9 @@ impl<I> Deref for CounterSetOrReset<I> {
|
||||||
/// A generic value for lists of counters.
|
/// A generic value for lists of counters.
|
||||||
///
|
///
|
||||||
/// Keyword `none` is represented by an empty vector.
|
/// Keyword `none` is represented by an empty vector.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct Counters<I>(#[css(iterable, if_empty = "none")] Box<[CounterPair<I>]>);
|
pub struct Counters<I>(#[css(iterable, if_empty = "none")] Box<[CounterPair<I>]>);
|
||||||
|
|
||||||
impl<I> Default for Counters<I> {
|
impl<I> Default for Counters<I> {
|
||||||
|
@ -102,7 +122,9 @@ fn is_decimal(counter_type: &CounterStyleType) -> bool {
|
||||||
/// The specified value for the `content` property.
|
/// The specified value for the `content` property.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-content/#propdef-content
|
/// https://drafts.csswg.org/css-content/#propdef-content
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum Content<ImageUrl> {
|
pub enum Content<ImageUrl> {
|
||||||
/// `normal` reserved keyword.
|
/// `normal` reserved keyword.
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -124,7 +146,9 @@ impl<ImageUrl> Content<ImageUrl> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Items for the `content` property.
|
/// Items for the `content` property.
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum ContentItem<ImageUrl> {
|
pub enum ContentItem<ImageUrl> {
|
||||||
/// Literal string content.
|
/// Literal string content.
|
||||||
String(Box<str>),
|
String(Box<str>),
|
||||||
|
|
|
@ -10,7 +10,15 @@ use crate::values::CSSFloat;
|
||||||
|
|
||||||
/// A generic easing function.
|
/// A generic easing function.
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[value_info(ty = "TIMING_FUNCTION")]
|
#[value_info(ty = "TIMING_FUNCTION")]
|
||||||
#[repr(u8, C)]
|
#[repr(u8, C)]
|
||||||
|
@ -46,6 +54,7 @@ pub enum TimingFunction<Integer, Number> {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum TimingKeyword {
|
pub enum TimingKeyword {
|
||||||
|
@ -69,7 +78,9 @@ fn step_position_jump_enabled(_context: &ParserContext) -> bool {
|
||||||
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum StepPosition {
|
pub enum StepPosition {
|
||||||
#[parse(condition = "step_position_jump_enabled")]
|
#[parse(condition = "step_position_jump_enabled")]
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
|
pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
|
||||||
/// The base shadow.
|
/// The base shadow.
|
||||||
|
@ -41,6 +42,7 @@ pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum Filter<Angle, Factor, Length, DropShadow, Url> {
|
pub enum Filter<Angle, Factor, Length, DropShadow, Url> {
|
||||||
/// `blur(<length>)`
|
/// `blur(<length>)`
|
||||||
|
@ -93,6 +95,7 @@ pub enum Filter<Angle, Factor, Length, DropShadow, Url> {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct SimpleShadow<Color, SizeLength, ShapeLength> {
|
pub struct SimpleShadow<Color, SizeLength, ShapeLength> {
|
||||||
/// Color.
|
/// Color.
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum GenericFlexBasis<S> {
|
pub enum GenericFlexBasis<S> {
|
||||||
|
|
|
@ -15,7 +15,9 @@ use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
|
||||||
use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
||||||
|
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#feature-tag-value
|
/// https://drafts.csswg.org/css-fonts-4/#feature-tag-value
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct FeatureTagValue<Integer> {
|
pub struct FeatureTagValue<Integer> {
|
||||||
/// A four-character tag, packed into a u32 (one byte per character).
|
/// A four-character tag, packed into a u32 (one byte per character).
|
||||||
pub tag: FontTag,
|
pub tag: FontTag,
|
||||||
|
@ -56,6 +58,7 @@ where
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct VariationValue<Number> {
|
pub struct VariationValue<Number> {
|
||||||
/// A four-character tag, packed into a u32 (one byte per character).
|
/// A four-character tag, packed into a u32 (one byte per character).
|
||||||
|
@ -67,7 +70,9 @@ pub struct VariationValue<Number> {
|
||||||
|
|
||||||
/// A value both for font-variation-settings and font-feature-settings.
|
/// A value both for font-variation-settings and font-feature-settings.
|
||||||
#[css(comma)]
|
#[css(comma)]
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct FontSettings<T>(#[css(if_empty = "normal", iterable)] pub Box<[T]>);
|
pub struct FontSettings<T>(#[css(if_empty = "normal", iterable)] pub Box<[T]>);
|
||||||
|
|
||||||
impl<T> FontSettings<T> {
|
impl<T> FontSettings<T> {
|
||||||
|
@ -103,7 +108,9 @@ impl<T: Parse> Parse for FontSettings<T> {
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def
|
/// https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-feature-settings
|
/// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-feature-settings
|
||||||
///
|
///
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct FontTag(pub u32);
|
pub struct FontTag(pub u32);
|
||||||
|
|
||||||
impl ToCss for FontTag {
|
impl ToCss for FontTag {
|
||||||
|
@ -149,6 +156,7 @@ impl Parse for FontTag {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// Additional information for keyword-derived font sizes.
|
/// Additional information for keyword-derived font sizes.
|
||||||
pub struct KeywordInfo<Length> {
|
pub struct KeywordInfo<Length> {
|
||||||
|
@ -205,6 +213,7 @@ impl<L> SpecifiedValueInfo for KeywordInfo<L> {
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum KeywordSize {
|
pub enum KeywordSize {
|
||||||
|
@ -254,6 +263,7 @@ impl Default for KeywordSize {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum FontStyle<Angle> {
|
pub enum FontStyle<Angle> {
|
||||||
#[animation(error)]
|
#[animation(error)]
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
/// A generic value for scroll snap points.
|
/// A generic value for scroll snap points.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub enum ScrollSnapPoint<LengthPercentage> {
|
pub enum ScrollSnapPoint<LengthPercentage> {
|
||||||
/// `none`
|
/// `none`
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -18,7 +18,9 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||||
/// A `<grid-line>` type.
|
/// A `<grid-line>` type.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line>
|
/// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line>
|
||||||
#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct GridLine<Integer> {
|
pub struct GridLine<Integer> {
|
||||||
/// Flag to check whether it's a `span` keyword.
|
/// Flag to check whether it's a `span` keyword.
|
||||||
pub is_span: bool,
|
pub is_span: bool,
|
||||||
|
@ -162,6 +164,7 @@ impl Parse for GridLine<specified::Integer> {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum TrackKeyword {
|
pub enum TrackKeyword {
|
||||||
Auto,
|
Auto,
|
||||||
|
@ -174,7 +177,15 @@ pub enum TrackKeyword {
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-breadth>
|
/// <https://drafts.csswg.org/css-grid/#typedef-track-breadth>
|
||||||
#[derive(
|
#[derive(
|
||||||
Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Animate,
|
||||||
|
Clone,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum TrackBreadth<L> {
|
pub enum TrackBreadth<L> {
|
||||||
/// The generic type is almost always a non-negative `<length-percentage>`
|
/// The generic type is almost always a non-negative `<length-percentage>`
|
||||||
|
@ -200,7 +211,7 @@ impl<L> TrackBreadth<L> {
|
||||||
/// generic only to avoid code bloat. It only takes `<length-percentage>`
|
/// generic only to avoid code bloat. It only takes `<length-percentage>`
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-size>
|
/// <https://drafts.csswg.org/css-grid/#typedef-track-size>
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)]
|
||||||
pub enum TrackSize<L> {
|
pub enum TrackSize<L> {
|
||||||
/// A flexible `<track-breadth>`
|
/// A flexible `<track-breadth>`
|
||||||
Breadth(TrackBreadth<L>),
|
Breadth(TrackBreadth<L>),
|
||||||
|
@ -358,7 +369,7 @@ where
|
||||||
/// The initial argument of the `repeat` function.
|
/// The initial argument of the `repeat` function.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-repeat>
|
/// <https://drafts.csswg.org/css-grid/#typedef-track-repeat>
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub enum RepeatCount<Integer> {
|
pub enum RepeatCount<Integer> {
|
||||||
/// A positive integer. This is allowed only for `<track-repeat>` and `<fixed-repeat>`
|
/// A positive integer. This is allowed only for `<track-repeat>` and `<fixed-repeat>`
|
||||||
Number(Integer),
|
Number(Integer),
|
||||||
|
@ -393,7 +404,7 @@ impl Parse for RepeatCount<specified::Integer> {
|
||||||
///
|
///
|
||||||
/// It can also hold `repeat()` function parameters, which expands into the respective
|
/// It can also hold `repeat()` function parameters, which expands into the respective
|
||||||
/// values in its computed form.
|
/// values in its computed form.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
#[css(function = "repeat")]
|
#[css(function = "repeat")]
|
||||||
pub struct TrackRepeat<L, I> {
|
pub struct TrackRepeat<L, I> {
|
||||||
/// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`)
|
/// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`)
|
||||||
|
@ -482,7 +493,15 @@ impl<L: Clone> TrackRepeat<L, specified::Integer> {
|
||||||
|
|
||||||
/// Track list values. Can be <track-size> or <track-repeat>
|
/// Track list values. Can be <track-size> or <track-repeat>
|
||||||
#[derive(
|
#[derive(
|
||||||
Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Animate,
|
||||||
|
Clone,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum TrackListValue<LengthPercentage, Integer> {
|
pub enum TrackListValue<LengthPercentage, Integer> {
|
||||||
/// A <track-size> value.
|
/// A <track-size> value.
|
||||||
|
@ -494,7 +513,7 @@ pub enum TrackListValue<LengthPercentage, Integer> {
|
||||||
/// The type of a `<track-list>` as determined during parsing.
|
/// The type of a `<track-list>` as determined during parsing.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
|
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
|
||||||
pub enum TrackListType {
|
pub enum TrackListType {
|
||||||
/// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list)
|
/// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list)
|
||||||
///
|
///
|
||||||
|
@ -516,7 +535,7 @@ pub enum TrackListType {
|
||||||
/// A grid `<track-list>` type.
|
/// A grid `<track-list>` type.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
|
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)]
|
||||||
pub struct TrackList<LengthPercentage, Integer> {
|
pub struct TrackList<LengthPercentage, Integer> {
|
||||||
/// The type of this `<track-list>` (auto, explicit or general).
|
/// The type of this `<track-list>` (auto, explicit or general).
|
||||||
///
|
///
|
||||||
|
@ -589,7 +608,9 @@ impl<L: ToCss, I: ToCss> ToCss for TrackList<L, I> {
|
||||||
///
|
///
|
||||||
/// `subgrid [ <line-names> | repeat(<positive-integer> | auto-fill, <line-names>+) ]+`
|
/// `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
|
/// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list
|
||||||
#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct LineNameList {
|
pub struct LineNameList {
|
||||||
/// The optional `<line-name-list>`
|
/// The optional `<line-name-list>`
|
||||||
pub names: Box<[Box<[CustomIdent]>]>,
|
pub names: Box<[Box<[CustomIdent]>]>,
|
||||||
|
@ -695,7 +716,15 @@ impl ToCss for LineNameList {
|
||||||
/// Subgrid deferred to Level 2 spec due to lack of implementation.
|
/// Subgrid deferred to Level 2 spec due to lack of implementation.
|
||||||
/// But it's implemented in gecko, so we have to as well.
|
/// But it's implemented in gecko, so we have to as well.
|
||||||
#[derive(
|
#[derive(
|
||||||
Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Animate,
|
||||||
|
Clone,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum GridTemplateComponent<L, I> {
|
pub enum GridTemplateComponent<L, I> {
|
||||||
/// `none` value.
|
/// `none` value.
|
||||||
|
@ -704,6 +733,7 @@ pub enum GridTemplateComponent<L, I> {
|
||||||
TrackList(
|
TrackList(
|
||||||
#[animation(field_bound)]
|
#[animation(field_bound)]
|
||||||
#[compute(field_bound)]
|
#[compute(field_bound)]
|
||||||
|
#[shmem(field_bound)]
|
||||||
TrackList<L, I>,
|
TrackList<L, I>,
|
||||||
),
|
),
|
||||||
/// A `subgrid <line-name-list>?`
|
/// A `subgrid <line-name-list>?`
|
||||||
|
|
|
@ -16,7 +16,7 @@ use style_traits::{CssWriter, ToCss};
|
||||||
/// An [image].
|
/// An [image].
|
||||||
///
|
///
|
||||||
/// [image]: https://drafts.csswg.org/css-images/#image-values
|
/// [image]: https://drafts.csswg.org/css-images/#image-values
|
||||||
#[derive(Clone, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(Clone, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
pub enum Image<Gradient, MozImageRect, ImageUrl> {
|
pub enum Image<Gradient, MozImageRect, ImageUrl> {
|
||||||
/// A `<url()>` image.
|
/// A `<url()>` image.
|
||||||
Url(ImageUrl),
|
Url(ImageUrl),
|
||||||
|
@ -36,7 +36,7 @@ pub enum Image<Gradient, MozImageRect, ImageUrl> {
|
||||||
|
|
||||||
/// A CSS gradient.
|
/// A CSS gradient.
|
||||||
/// <https://drafts.csswg.org/css-images/#gradients>
|
/// <https://drafts.csswg.org/css-images/#gradients>
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
|
||||||
pub struct Gradient<LineDirection, Length, LengthPercentage, Position, Color, Angle> {
|
pub struct Gradient<LineDirection, Length, LengthPercentage, Position, Color, Angle> {
|
||||||
/// Gradients can be linear or radial.
|
/// Gradients can be linear or radial.
|
||||||
pub kind: GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>,
|
pub kind: GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>,
|
||||||
|
@ -48,7 +48,7 @@ pub struct Gradient<LineDirection, Length, LengthPercentage, Position, Color, An
|
||||||
pub compat_mode: CompatMode,
|
pub compat_mode: CompatMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
|
||||||
/// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes.
|
/// Whether we used the modern notation or the compatibility `-webkit`, `-moz` prefixes.
|
||||||
pub enum CompatMode {
|
pub enum CompatMode {
|
||||||
/// Modern syntax.
|
/// Modern syntax.
|
||||||
|
@ -60,7 +60,7 @@ pub enum CompatMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A gradient kind.
|
/// A gradient kind.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
|
||||||
pub enum GradientKind<LineDirection, Length, LengthPercentage, Position, Angle> {
|
pub enum GradientKind<LineDirection, Length, LengthPercentage, Position, Angle> {
|
||||||
/// A linear gradient.
|
/// A linear gradient.
|
||||||
Linear(LineDirection),
|
Linear(LineDirection),
|
||||||
|
@ -73,7 +73,7 @@ pub enum GradientKind<LineDirection, Length, LengthPercentage, Position, Angle>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A radial gradient's ending shape.
|
/// A radial gradient's ending shape.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub enum EndingShape<Length, LengthPercentage> {
|
pub enum EndingShape<Length, LengthPercentage> {
|
||||||
/// A circular gradient.
|
/// A circular gradient.
|
||||||
Circle(Circle<Length>),
|
Circle(Circle<Length>),
|
||||||
|
@ -82,7 +82,7 @@ pub enum EndingShape<Length, LengthPercentage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A circle shape.
|
/// A circle shape.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
|
||||||
pub enum Circle<Length> {
|
pub enum Circle<Length> {
|
||||||
/// A circle radius.
|
/// A circle radius.
|
||||||
Radius(Length),
|
Radius(Length),
|
||||||
|
@ -91,7 +91,7 @@ pub enum Circle<Length> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An ellipse shape.
|
/// An ellipse shape.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub enum Ellipse<LengthPercentage> {
|
pub enum Ellipse<LengthPercentage> {
|
||||||
/// An ellipse pair of radii.
|
/// An ellipse pair of radii.
|
||||||
Radii(LengthPercentage, LengthPercentage),
|
Radii(LengthPercentage, LengthPercentage),
|
||||||
|
@ -102,7 +102,9 @@ pub enum Ellipse<LengthPercentage> {
|
||||||
/// <https://drafts.csswg.org/css-images/#typedef-extent-keyword>
|
/// <https://drafts.csswg.org/css-images/#typedef-extent-keyword>
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum ShapeExtent {
|
pub enum ShapeExtent {
|
||||||
ClosestSide,
|
ClosestSide,
|
||||||
FarthestSide,
|
FarthestSide,
|
||||||
|
@ -114,7 +116,7 @@ pub enum ShapeExtent {
|
||||||
|
|
||||||
/// A gradient item.
|
/// A gradient item.
|
||||||
/// <https://drafts.csswg.org/css-images-4/#color-stop-syntax>
|
/// <https://drafts.csswg.org/css-images-4/#color-stop-syntax>
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub enum GradientItem<Color, LengthPercentage> {
|
pub enum GradientItem<Color, LengthPercentage> {
|
||||||
/// A color stop.
|
/// A color stop.
|
||||||
ColorStop(ColorStop<Color, LengthPercentage>),
|
ColorStop(ColorStop<Color, LengthPercentage>),
|
||||||
|
@ -124,7 +126,7 @@ pub enum GradientItem<Color, LengthPercentage> {
|
||||||
|
|
||||||
/// A color stop.
|
/// A color stop.
|
||||||
/// <https://drafts.csswg.org/css-images/#typedef-color-stop-list>
|
/// <https://drafts.csswg.org/css-images/#typedef-color-stop-list>
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct ColorStop<Color, LengthPercentage> {
|
pub struct ColorStop<Color, LengthPercentage> {
|
||||||
/// The color of this stop.
|
/// The color of this stop.
|
||||||
pub color: Color,
|
pub color: Color,
|
||||||
|
@ -167,7 +169,9 @@ impl ToCss for PaintWorklet {
|
||||||
/// `-moz-image-rect(<uri>, top, right, bottom, left);`
|
/// `-moz-image-rect(<uri>, top, right, bottom, left);`
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[css(comma, function)]
|
#[css(comma, function)]
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct MozImageRect<NumberOrPercentage, MozImageRectUrl> {
|
pub struct MozImageRect<NumberOrPercentage, MozImageRectUrl> {
|
||||||
pub url: MozImageRectUrl,
|
pub url: MozImageRectUrl,
|
||||||
pub top: NumberOrPercentage,
|
pub top: NumberOrPercentage,
|
||||||
|
|
|
@ -26,6 +26,7 @@ use style_traits::ParseError;
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
pub enum GenericLengthPercentageOrAuto<LengthPercent> {
|
pub enum GenericLengthPercentageOrAuto<LengthPercent> {
|
||||||
|
@ -109,6 +110,7 @@ impl<LengthPercentage: Parse> Parse for LengthPercentageOrAuto<LengthPercentage>
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
pub enum GenericSize<LengthPercent> {
|
pub enum GenericSize<LengthPercent> {
|
||||||
|
@ -150,6 +152,7 @@ impl<LengthPercentage> Size<LengthPercentage> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
pub enum GenericMaxSize<LengthPercent> {
|
pub enum GenericMaxSize<LengthPercent> {
|
||||||
|
@ -185,6 +188,7 @@ impl<LengthPercentage> MaxSize<LengthPercentage> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
pub enum GenericLengthOrNumber<L, N> {
|
pub enum GenericLengthOrNumber<L, N> {
|
||||||
|
|
|
@ -43,7 +43,9 @@ pub mod url;
|
||||||
// https://drafts.csswg.org/css-counter-styles/#typedef-symbols-type
|
// https://drafts.csswg.org/css-counter-styles/#typedef-symbols-type
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum SymbolsType {
|
pub enum SymbolsType {
|
||||||
Cyclic,
|
Cyclic,
|
||||||
Numeric,
|
Numeric,
|
||||||
|
@ -85,7 +87,7 @@ impl SymbolsType {
|
||||||
/// Since wherever <counter-style> is used, 'none' is a valid value as
|
/// Since wherever <counter-style> is used, 'none' is a valid value as
|
||||||
/// well, we combine them into one type to make code simpler.
|
/// well, we combine them into one type to make code simpler.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub enum CounterStyleOrNone {
|
pub enum CounterStyleOrNone {
|
||||||
/// `none`
|
/// `none`
|
||||||
None,
|
None,
|
||||||
|
@ -173,6 +175,7 @@ impl SpecifiedValueInfo for CounterStyleOrNone {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct NonNegative<T>(pub T);
|
pub struct NonNegative<T>(pub T);
|
||||||
|
@ -210,6 +213,7 @@ impl<T: Zero> Zero for NonNegative<T> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct GreaterThanOrEqualToOne<T>(pub T);
|
pub struct GreaterThanOrEqualToOne<T>(pub T);
|
||||||
|
|
||||||
|
@ -227,6 +231,7 @@ pub struct GreaterThanOrEqualToOne<T>(pub T);
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[css(function = "rect", comma)]
|
#[css(function = "rect", comma)]
|
||||||
pub struct ClipRect<LengthOrAuto> {
|
pub struct ClipRect<LengthOrAuto> {
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct GenericPosition<H, V> {
|
pub struct GenericPosition<H, V> {
|
||||||
|
@ -53,6 +54,7 @@ impl<H, V> Position<H, V> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
pub enum GenericZIndex<I> {
|
pub enum GenericZIndex<I> {
|
||||||
|
|
|
@ -22,6 +22,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct Rect<T>(pub T, pub T, pub T, pub T);
|
pub struct Rect<T>(pub T, pub T, pub T, pub T);
|
||||||
|
|
|
@ -24,6 +24,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
|
|
@ -24,6 +24,7 @@ use style_traits::{ParseError, StyleParseErrorKind};
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct SVGPaint<ColorType, UrlPaintServer> {
|
pub struct SVGPaint<ColorType, UrlPaintServer> {
|
||||||
/// The paint source
|
/// The paint source
|
||||||
|
@ -50,6 +51,7 @@ pub struct SVGPaint<ColorType, UrlPaintServer> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum SVGPaintKind<ColorType, UrlPaintServer> {
|
pub enum SVGPaintKind<ColorType, UrlPaintServer> {
|
||||||
/// `none`
|
/// `none`
|
||||||
|
@ -142,6 +144,7 @@ impl<ColorType: Parse, UrlPaintServer: Parse> Parse for SVGPaint<ColorType, UrlP
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum SVGLength<L> {
|
pub enum SVGLength<L> {
|
||||||
/// `<length> | <percentage> | <number>`
|
/// `<length> | <percentage> | <number>`
|
||||||
|
@ -162,6 +165,7 @@ pub enum SVGLength<L> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum SVGStrokeDashArray<L> {
|
pub enum SVGStrokeDashArray<L> {
|
||||||
/// `[ <length> | <percentage> | <number> ]#`
|
/// `[ <length> | <percentage> | <number> ]#`
|
||||||
|
@ -186,6 +190,7 @@ pub enum SVGStrokeDashArray<L> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum SVGOpacity<OpacityType> {
|
pub enum SVGOpacity<OpacityType> {
|
||||||
/// `<opacity-value>`
|
/// `<opacity-value>`
|
||||||
|
|
|
@ -11,7 +11,15 @@ use style_traits::ParseError;
|
||||||
|
|
||||||
/// A generic value for the `initial-letter` property.
|
/// A generic value for the `initial-letter` property.
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum InitialLetter<Number, Integer> {
|
pub enum InitialLetter<Number, Integer> {
|
||||||
/// `normal`
|
/// `normal`
|
||||||
|
@ -29,7 +37,9 @@ impl<N, I> InitialLetter<N, I> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A generic spacing value for the `letter-spacing` and `word-spacing` properties.
|
/// A generic spacing value for the `letter-spacing` and `word-spacing` properties.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum Spacing<Value> {
|
pub enum Spacing<Value> {
|
||||||
/// `normal`
|
/// `normal`
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -81,6 +91,7 @@ fn line_height_moz_block_height_enabled(context: &ParserContext) -> bool {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedValue,
|
ToAnimatedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
Parse,
|
Parse,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
|
|
|
@ -19,7 +19,15 @@ use style_traits::{CssWriter, ToCss};
|
||||||
/// A generic 2D transformation matrix.
|
/// A generic 2D transformation matrix.
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[css(comma, function)]
|
#[css(comma, function)]
|
||||||
pub struct Matrix<T> {
|
pub struct Matrix<T> {
|
||||||
|
@ -35,7 +43,7 @@ pub struct Matrix<T> {
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||||
#[css(comma, function = "matrix3d")]
|
#[css(comma, function = "matrix3d")]
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
|
||||||
ToComputedValue, ToCss)]
|
ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct Matrix3D<T> {
|
pub struct Matrix3D<T> {
|
||||||
pub m11: T, pub m12: T, pub m13: T, pub m14: T,
|
pub m11: T, pub m12: T, pub m13: T, pub m14: T,
|
||||||
pub m21: T, pub m22: T, pub m23: T, pub m24: T,
|
pub m21: T, pub m22: T, pub m23: T, pub m24: T,
|
||||||
|
@ -82,6 +90,7 @@ impl<T: Into<f64>> From<Matrix3D<T>> for Transform3D<f64> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct GenericTransformOrigin<H, V, Depth> {
|
pub struct GenericTransformOrigin<H, V, Depth> {
|
||||||
|
@ -110,7 +119,9 @@ fn is_same<N: PartialEq>(x: &N, y: &N) -> bool {
|
||||||
x == y
|
x == y
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
/// A single operation in the list of a `transform` value
|
/// A single operation in the list of a `transform` value
|
||||||
pub enum TransformOperation<Angle, Number, Length, Integer, LengthPercentage>
|
pub enum TransformOperation<Angle, Number, Length, Integer, LengthPercentage>
|
||||||
where
|
where
|
||||||
|
@ -215,7 +226,9 @@ where
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
/// A value of the `transform` property
|
/// A value of the `transform` property
|
||||||
pub struct Transform<T>(#[css(if_empty = "none", iterable)] pub Vec<T>);
|
pub struct Transform<T>(#[css(if_empty = "none", iterable)] pub Vec<T>);
|
||||||
|
|
||||||
|
@ -537,7 +550,15 @@ pub fn get_normalized_vector_and_angle<T: Zero>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToAnimatedZero,
|
||||||
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// A value of the `Rotate` property
|
/// A value of the `Rotate` property
|
||||||
///
|
///
|
||||||
|
@ -599,7 +620,15 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToAnimatedZero,
|
||||||
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// A value of the `Scale` property
|
/// A value of the `Scale` property
|
||||||
///
|
///
|
||||||
|
@ -648,6 +677,7 @@ impl<Number: ToCss + PartialEq> ToCss for Scale<Number> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// A value of the `translate` property
|
/// A value of the `translate` property
|
||||||
///
|
///
|
||||||
|
@ -680,7 +710,16 @@ where
|
||||||
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
Parse,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum TransformStyle {
|
pub enum TransformStyle {
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
|
|
|
@ -11,7 +11,7 @@ use values::specified::ui::CursorKind;
|
||||||
/// A generic value for the `cursor` property.
|
/// A generic value for the `cursor` property.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-ui/#cursor
|
/// https://drafts.csswg.org/css-ui/#cursor
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
pub struct Cursor<Image> {
|
pub struct Cursor<Image> {
|
||||||
/// The parsed images for the cursor.
|
/// The parsed images for the cursor.
|
||||||
pub images: Box<[Image]>,
|
pub images: Box<[Image]>,
|
||||||
|
@ -44,7 +44,7 @@ impl<Image: ToCss> ToCss for Cursor<Image> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A generic value for item of `image cursors`.
|
/// A generic value for item of `image cursors`.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
pub struct CursorImage<ImageUrl, Number> {
|
pub struct CursorImage<ImageUrl, Number> {
|
||||||
/// The url to parse images from.
|
/// The url to parse images from.
|
||||||
pub url: ImageUrl,
|
pub url: ImageUrl,
|
||||||
|
@ -84,6 +84,7 @@ impl<ImageUrl: ToCss, Number: ToCss> ToCss for CursorImage<ImageUrl, Number> {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum ScrollbarColor<Color> {
|
pub enum ScrollbarColor<Color> {
|
||||||
/// `auto`
|
/// `auto`
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum UrlOrNone<Url> {
|
pub enum UrlOrNone<Url> {
|
||||||
/// `none`
|
/// `none`
|
||||||
|
|
|
@ -134,6 +134,7 @@ impl Parse for Impossible {
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum Either<A, B> {
|
pub enum Either<A, B> {
|
||||||
/// The first value.
|
/// The first value.
|
||||||
|
@ -152,7 +153,9 @@ impl<A: Debug, B: Debug> Debug for Either<A, B> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-values-4/#custom-idents>
|
/// <https://drafts.csswg.org/css-values-4/#custom-idents>
|
||||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct CustomIdent(pub Atom);
|
pub struct CustomIdent(pub Atom);
|
||||||
|
|
||||||
impl CustomIdent {
|
impl CustomIdent {
|
||||||
|
@ -189,7 +192,7 @@ impl ToCss for CustomIdent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-animations/#typedef-keyframes-name>
|
/// <https://drafts.csswg.org/css-animations/#typedef-keyframes-name>
|
||||||
#[derive(Clone, Debug, MallocSizeOf, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(Clone, Debug, MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
pub enum KeyframesName {
|
pub enum KeyframesName {
|
||||||
/// <custom-ident>
|
/// <custom-ident>
|
||||||
Ident(CustomIdent),
|
Ident(CustomIdent),
|
||||||
|
|
|
@ -16,7 +16,7 @@ bitflags! {
|
||||||
/// Constants shared by multiple CSS Box Alignment properties
|
/// Constants shared by multiple CSS Box Alignment properties
|
||||||
///
|
///
|
||||||
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
||||||
#[derive(MallocSizeOf, ToComputedValue)]
|
#[derive(MallocSizeOf, ToComputedValue, ToShmem)]
|
||||||
pub struct AlignFlags: u8 {
|
pub struct AlignFlags: u8 {
|
||||||
// Enumeration stored in the lower 5 bits:
|
// Enumeration stored in the lower 5 bits:
|
||||||
/// 'auto'
|
/// 'auto'
|
||||||
|
@ -134,7 +134,7 @@ pub enum AxisDirection {
|
||||||
/// Shared value for the `align-content` and `justify-content` properties.
|
/// Shared value for the `align-content` and `justify-content` properties.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-align/#content-distribution>
|
/// <https://drafts.csswg.org/css-align/#content-distribution>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
pub struct ContentDistribution {
|
pub struct ContentDistribution {
|
||||||
primary: AlignFlags,
|
primary: AlignFlags,
|
||||||
|
@ -247,7 +247,7 @@ impl ContentDistribution {
|
||||||
/// Value for the `align-content` property.
|
/// Value for the `align-content` property.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-align/#propdef-align-content>
|
/// <https://drafts.csswg.org/css-align/#propdef-align-content>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct AlignContent(pub ContentDistribution);
|
pub struct AlignContent(pub ContentDistribution);
|
||||||
|
|
||||||
impl Parse for AlignContent {
|
impl Parse for AlignContent {
|
||||||
|
@ -287,7 +287,7 @@ impl From<AlignContent> for u16 {
|
||||||
/// Value for the `justify-content` property.
|
/// Value for the `justify-content` property.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-align/#propdef-justify-content>
|
/// <https://drafts.csswg.org/css-align/#propdef-justify-content>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct JustifyContent(pub ContentDistribution);
|
pub struct JustifyContent(pub ContentDistribution);
|
||||||
|
|
||||||
impl Parse for JustifyContent {
|
impl Parse for JustifyContent {
|
||||||
|
@ -325,7 +325,7 @@ impl From<JustifyContent> for u16 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-align/#self-alignment>
|
/// <https://drafts.csswg.org/css-align/#self-alignment>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct SelfAlignment(pub AlignFlags);
|
pub struct SelfAlignment(pub AlignFlags);
|
||||||
|
|
||||||
impl SelfAlignment {
|
impl SelfAlignment {
|
||||||
|
@ -385,7 +385,7 @@ impl SelfAlignment {
|
||||||
/// The specified value of the align-self property.
|
/// The specified value of the align-self property.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-align/#propdef-align-self>
|
/// <https://drafts.csswg.org/css-align/#propdef-align-self>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct AlignSelf(pub SelfAlignment);
|
pub struct AlignSelf(pub SelfAlignment);
|
||||||
|
|
||||||
impl Parse for AlignSelf {
|
impl Parse for AlignSelf {
|
||||||
|
@ -423,7 +423,7 @@ impl From<AlignSelf> for u8 {
|
||||||
/// The specified value of the justify-self property.
|
/// The specified value of the justify-self property.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-align/#propdef-justify-self>
|
/// <https://drafts.csswg.org/css-align/#propdef-justify-self>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct JustifySelf(pub SelfAlignment);
|
pub struct JustifySelf(pub SelfAlignment);
|
||||||
|
|
||||||
impl Parse for JustifySelf {
|
impl Parse for JustifySelf {
|
||||||
|
@ -461,7 +461,7 @@ impl From<JustifySelf> for u8 {
|
||||||
/// Value of the `align-items` property
|
/// Value of the `align-items` property
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-align/#propdef-align-items>
|
/// <https://drafts.csswg.org/css-align/#propdef-align-items>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
|
||||||
pub struct AlignItems(pub AlignFlags);
|
pub struct AlignItems(pub AlignFlags);
|
||||||
|
|
||||||
impl AlignItems {
|
impl AlignItems {
|
||||||
|
@ -512,7 +512,7 @@ impl SpecifiedValueInfo for AlignItems {
|
||||||
/// Value of the `justify-items` property
|
/// Value of the `justify-items` property
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-align/#justify-items-property>
|
/// <https://drafts.csswg.org/css-align/#justify-items-property>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct JustifyItems(pub AlignFlags);
|
pub struct JustifyItems(pub AlignFlags);
|
||||||
|
|
||||||
impl JustifyItems {
|
impl JustifyItems {
|
||||||
|
|
|
@ -17,7 +17,7 @@ use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, ToCss};
|
||||||
|
|
||||||
/// A specified angle dimension.
|
/// A specified angle dimension.
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToCss, ToShmem)]
|
||||||
pub enum AngleDimension {
|
pub enum AngleDimension {
|
||||||
/// An angle with degree unit.
|
/// An angle with degree unit.
|
||||||
#[css(dimension)]
|
#[css(dimension)]
|
||||||
|
@ -68,7 +68,7 @@ impl AngleDimension {
|
||||||
/// A specified Angle value, which is just the angle dimension, plus whether it
|
/// A specified Angle value, which is just the angle dimension, plus whether it
|
||||||
/// was specified as `calc()` or not.
|
/// was specified as `calc()` or not.
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct Angle {
|
pub struct Angle {
|
||||||
value: AngleDimension,
|
value: AngleDimension,
|
||||||
was_calc: bool,
|
was_calc: bool,
|
||||||
|
|
|
@ -47,6 +47,7 @@ impl Parse for BackgroundSize {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[value_info(other_values = "repeat-x,repeat-y")]
|
#[value_info(other_values = "repeat-x,repeat-y")]
|
||||||
|
@ -62,7 +63,7 @@ pub enum BackgroundRepeatKeyword {
|
||||||
/// axes.
|
/// axes.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-backgrounds/#the-background-repeat
|
/// https://drafts.csswg.org/css-backgrounds/#the-background-repeat
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
pub struct BackgroundRepeat(pub BackgroundRepeatKeyword, pub BackgroundRepeatKeyword);
|
pub struct BackgroundRepeat(pub BackgroundRepeatKeyword, pub BackgroundRepeatKeyword);
|
||||||
|
|
||||||
impl BackgroundRepeat {
|
impl BackgroundRepeat {
|
||||||
|
|
|
@ -40,6 +40,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum BorderStyle {
|
pub enum BorderStyle {
|
||||||
|
@ -64,7 +65,7 @@ impl BorderStyle {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A specified value for a single side of the `border-width` property.
|
/// A specified value for a single side of the `border-width` property.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum BorderSideWidth {
|
pub enum BorderSideWidth {
|
||||||
/// `thin`
|
/// `thin`
|
||||||
Thin,
|
Thin,
|
||||||
|
@ -249,7 +250,9 @@ impl Parse for BorderSpacing {
|
||||||
/// A single border-image-repeat keyword.
|
/// A single border-image-repeat keyword.
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum BorderImageRepeatKeyword {
|
pub enum BorderImageRepeatKeyword {
|
||||||
Stretch,
|
Stretch,
|
||||||
Repeat,
|
Repeat,
|
||||||
|
@ -260,7 +263,9 @@ pub enum BorderImageRepeatKeyword {
|
||||||
/// The specified value for the `border-image-repeat` property.
|
/// The specified value for the `border-image-repeat` property.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat
|
/// https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct BorderImageRepeat(pub BorderImageRepeatKeyword, pub BorderImageRepeatKeyword);
|
pub struct BorderImageRepeat(pub BorderImageRepeatKeyword, pub BorderImageRepeatKeyword);
|
||||||
|
|
||||||
impl ToCss for BorderImageRepeat {
|
impl ToCss for BorderImageRepeat {
|
||||||
|
|
|
@ -61,6 +61,7 @@ fn moz_box_display_values_enabled(context: &ParserContext) -> bool {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
|
@ -324,7 +325,9 @@ impl AnimationIterationCount {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A value for the `animation-name` property.
|
/// A value for the `animation-name` property.
|
||||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
#[value_info(other_values = "none")]
|
#[value_info(other_values = "none")]
|
||||||
pub struct AnimationName(pub Option<KeyframesName>);
|
pub struct AnimationName(pub Option<KeyframesName>);
|
||||||
|
|
||||||
|
@ -379,6 +382,7 @@ impl Parse for AnimationName {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum ScrollSnapType {
|
pub enum ScrollSnapType {
|
||||||
|
@ -402,6 +406,7 @@ pub enum ScrollSnapType {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum ScrollSnapAlignKeyword {
|
pub enum ScrollSnapAlignKeyword {
|
||||||
|
@ -413,7 +418,9 @@ pub enum ScrollSnapAlignKeyword {
|
||||||
|
|
||||||
/// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align
|
/// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct ScrollSnapAlign {
|
pub struct ScrollSnapAlign {
|
||||||
block: ScrollSnapAlignKeyword,
|
block: ScrollSnapAlignKeyword,
|
||||||
|
@ -470,6 +477,7 @@ impl ToCss for ScrollSnapAlign {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum OverscrollBehavior {
|
pub enum OverscrollBehavior {
|
||||||
|
@ -491,6 +499,7 @@ pub enum OverscrollBehavior {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum OverflowAnchor {
|
pub enum OverflowAnchor {
|
||||||
|
@ -511,6 +520,7 @@ pub enum OverflowAnchor {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum OverflowClipBox {
|
pub enum OverflowClipBox {
|
||||||
|
@ -518,7 +528,9 @@ pub enum OverflowClipBox {
|
||||||
ContentBox,
|
ContentBox,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
/// Provides a rendering hint to the user agent,
|
/// Provides a rendering hint to the user agent,
|
||||||
/// stating what kinds of changes the author expects
|
/// stating what kinds of changes the author expects
|
||||||
/// to perform on the element
|
/// to perform on the element
|
||||||
|
@ -550,7 +562,7 @@ impl WillChange {
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
/// The change bits that we care about.
|
/// The change bits that we care about.
|
||||||
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct WillChangeBits: u8 {
|
pub struct WillChangeBits: u8 {
|
||||||
/// Whether the stacking context will change.
|
/// Whether the stacking context will change.
|
||||||
|
@ -646,7 +658,8 @@ impl Parse for WillChange {
|
||||||
bitflags! {
|
bitflags! {
|
||||||
/// Values for the `touch-action` property.
|
/// Values for the `touch-action` property.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(SpecifiedValueInfo, ToComputedValue)]
|
#[derive(SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
|
/// These constants match Gecko's `NS_STYLE_TOUCH_ACTION_*` constants.
|
||||||
#[value_info(other_values = "auto,none,manipulation,pan-x,pan-y")]
|
#[value_info(other_values = "auto,none,manipulation,pan-x,pan-y")]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct TouchAction: u8 {
|
pub struct TouchAction: u8 {
|
||||||
|
@ -718,7 +731,7 @@ impl Parse for TouchAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
#[value_info(other_values = "none,strict,content,size,layout,paint")]
|
#[value_info(other_values = "none,strict,content,size,layout,paint")]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
/// Constants for contain: https://drafts.csswg.org/css-contain/#contain-property
|
/// Constants for contain: https://drafts.csswg.org/css-contain/#contain-property
|
||||||
|
@ -820,7 +833,7 @@ pub type Perspective = GenericPerspective<NonNegativeLength>;
|
||||||
|
|
||||||
/// A given transition property, that is either `All`, a longhand or shorthand
|
/// A given transition property, that is either `All`, a longhand or shorthand
|
||||||
/// property, or an unsupported or custom property.
|
/// property, or an unsupported or custom property.
|
||||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue)]
|
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
|
||||||
pub enum TransitionProperty {
|
pub enum TransitionProperty {
|
||||||
/// A shorthand.
|
/// A shorthand.
|
||||||
Shorthand(ShorthandId),
|
Shorthand(ShorthandId),
|
||||||
|
@ -915,7 +928,17 @@ impl TransitionProperty {
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
Hash,
|
||||||
|
MallocSizeOf,
|
||||||
|
Parse,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// https://drafts.csswg.org/css-box/#propdef-float
|
/// https://drafts.csswg.org/css-box/#propdef-float
|
||||||
pub enum Float {
|
pub enum Float {
|
||||||
|
@ -930,7 +953,17 @@ pub enum Float {
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
Hash,
|
||||||
|
MallocSizeOf,
|
||||||
|
Parse,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// https://drafts.csswg.org/css-box/#propdef-clear
|
/// https://drafts.csswg.org/css-box/#propdef-clear
|
||||||
pub enum Clear {
|
pub enum Clear {
|
||||||
|
@ -947,7 +980,17 @@ pub enum Clear {
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
Hash,
|
||||||
|
MallocSizeOf,
|
||||||
|
Parse,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum Resize {
|
pub enum Resize {
|
||||||
None,
|
None,
|
||||||
|
@ -975,6 +1018,7 @@ pub enum Resize {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToCss,
|
ToCss,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum Appearance {
|
pub enum Appearance {
|
||||||
|
@ -1326,6 +1370,7 @@ pub enum Appearance {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToCss,
|
ToCss,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum BreakBetween {
|
pub enum BreakBetween {
|
||||||
|
@ -1397,6 +1442,7 @@ impl BreakBetween {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToCss,
|
ToCss,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum BreakWithin {
|
pub enum BreakWithin {
|
||||||
|
@ -1418,6 +1464,7 @@ pub enum BreakWithin {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToCss,
|
ToCss,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum Overflow {
|
pub enum Overflow {
|
||||||
|
|
|
@ -65,7 +65,7 @@ pub enum CalcUnit {
|
||||||
/// relative lengths, and to_computed_pixel_length_without_context() handles
|
/// relative lengths, and to_computed_pixel_length_without_context() handles
|
||||||
/// this case. Therefore, if you want to add a new field, please make sure this
|
/// this case. Therefore, if you want to add a new field, please make sure this
|
||||||
/// function work properly.
|
/// function work properly.
|
||||||
#[derive(Clone, Copy, Debug, Default, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Default, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub struct CalcLengthPercentage {
|
pub struct CalcLengthPercentage {
|
||||||
pub clamping_mode: AllowedNumericType,
|
pub clamping_mode: AllowedNumericType,
|
||||||
|
|
|
@ -22,7 +22,7 @@ use style_traits::{CssType, CssWriter, KeywordsCollectFn, ParseError, StyleParse
|
||||||
use style_traits::{SpecifiedValueInfo, ToCss, ValueParseErrorKind};
|
use style_traits::{SpecifiedValueInfo, ToCss, ValueParseErrorKind};
|
||||||
|
|
||||||
/// Specified color value
|
/// Specified color value
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum Color {
|
pub enum Color {
|
||||||
/// The 'currentColor' keyword
|
/// The 'currentColor' keyword
|
||||||
CurrentColor,
|
CurrentColor,
|
||||||
|
@ -49,7 +49,7 @@ pub enum Color {
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
mod gecko {
|
mod gecko {
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum SpecialColorKeyword {
|
pub enum SpecialColorKeyword {
|
||||||
MozDefaultColor,
|
MozDefaultColor,
|
||||||
MozDefaultBackgroundColor,
|
MozDefaultBackgroundColor,
|
||||||
|
@ -395,7 +395,7 @@ impl ToComputedValue for Color {
|
||||||
|
|
||||||
/// Specified color value, but resolved to just RGBA for computed value
|
/// Specified color value, but resolved to just RGBA for computed value
|
||||||
/// with value from color property at the same context.
|
/// with value from color property at the same context.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct RGBAColor(pub Color);
|
pub struct RGBAColor(pub Color);
|
||||||
|
|
||||||
impl Parse for RGBAColor {
|
impl Parse for RGBAColor {
|
||||||
|
@ -443,7 +443,7 @@ impl SpecifiedValueInfo for Color {
|
||||||
/// Specified value for the "color" property, which resolves the `currentcolor`
|
/// Specified value for the "color" property, which resolves the `currentcolor`
|
||||||
/// keyword to the parent color instead of self's color.
|
/// keyword to the parent color instead of self's color.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct ColorPropertyValue(pub Color);
|
pub struct ColorPropertyValue(pub Color);
|
||||||
|
|
||||||
impl ToComputedValue for ColorPropertyValue {
|
impl ToComputedValue for ColorPropertyValue {
|
||||||
|
|
|
@ -37,7 +37,7 @@ pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, SimpleShadow,
|
||||||
pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, Impossible, Impossible>;
|
pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, Impossible, Impossible>;
|
||||||
|
|
||||||
/// A value for the `<factor>` parts in `Filter`.
|
/// A value for the `<factor>` parts in `Filter`.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub struct Factor(NumberOrPercentage);
|
pub struct Factor(NumberOrPercentage);
|
||||||
|
|
||||||
impl Factor {
|
impl Factor {
|
||||||
|
|
|
@ -81,7 +81,7 @@ pub const MAX_FONT_WEIGHT: f32 = 1000.;
|
||||||
/// A specified font-weight value.
|
/// A specified font-weight value.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
|
/// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum FontWeight {
|
pub enum FontWeight {
|
||||||
/// `<font-weight-absolute>`
|
/// `<font-weight-absolute>`
|
||||||
Absolute(AbsoluteFontWeight),
|
Absolute(AbsoluteFontWeight),
|
||||||
|
@ -143,7 +143,7 @@ impl ToComputedValue for FontWeight {
|
||||||
/// An absolute font-weight value for a @font-face rule.
|
/// An absolute font-weight value for a @font-face rule.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-fonts-4/#font-weight-absolute-values
|
/// https://drafts.csswg.org/css-fonts-4/#font-weight-absolute-values
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum AbsoluteFontWeight {
|
pub enum AbsoluteFontWeight {
|
||||||
/// A `<number>`, with the additional constraints specified in:
|
/// A `<number>`, with the additional constraints specified in:
|
||||||
///
|
///
|
||||||
|
@ -319,7 +319,7 @@ impl SpecifiedFontStyle {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The specified value of the `font-style` property.
|
/// The specified value of the `font-style` property.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum FontStyle {
|
pub enum FontStyle {
|
||||||
Specified(SpecifiedFontStyle),
|
Specified(SpecifiedFontStyle),
|
||||||
|
@ -358,7 +358,7 @@ impl ToComputedValue for FontStyle {
|
||||||
///
|
///
|
||||||
/// TODO(emilio): We could derive Parse if we had NonNegativePercentage.
|
/// TODO(emilio): We could derive Parse if we had NonNegativePercentage.
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum FontStretch {
|
pub enum FontStretch {
|
||||||
Stretch(Percentage),
|
Stretch(Percentage),
|
||||||
|
@ -368,7 +368,9 @@ pub enum FontStretch {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A keyword value for `font-stretch`.
|
/// A keyword value for `font-stretch`.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum FontStretchKeyword {
|
pub enum FontStretchKeyword {
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -481,7 +483,7 @@ impl ToComputedValue for FontStretch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// A specified font-size value
|
/// A specified font-size value
|
||||||
pub enum FontSize {
|
pub enum FontSize {
|
||||||
/// A length; e.g. 10px.
|
/// A length; e.g. 10px.
|
||||||
|
@ -513,7 +515,7 @@ impl From<LengthPercentage> for FontSize {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specifies a prioritized list of font family names or generic family names.
|
/// Specifies a prioritized list of font family names or generic family names.
|
||||||
#[derive(Clone, Debug, Eq, Hash, PartialEq, ToCss)]
|
#[derive(Clone, Debug, Eq, Hash, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum FontFamily {
|
pub enum FontFamily {
|
||||||
/// List of `font-family`
|
/// List of `font-family`
|
||||||
#[css(comma)]
|
#[css(comma)]
|
||||||
|
@ -612,7 +614,7 @@ impl Parse for FamilyName {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Preserve the readability of text when font fallback occurs
|
/// Preserve the readability of text when font fallback occurs
|
||||||
pub enum FontSizeAdjust {
|
pub enum FontSizeAdjust {
|
||||||
/// None variant
|
/// None variant
|
||||||
|
@ -1002,7 +1004,7 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Set of variant alternates
|
/// Set of variant alternates
|
||||||
pub enum VariantAlternates {
|
pub enum VariantAlternates {
|
||||||
/// Enables display of stylistic alternates
|
/// Enables display of stylistic alternates
|
||||||
|
@ -1027,7 +1029,7 @@ pub enum VariantAlternates {
|
||||||
HistoricalForms,
|
HistoricalForms,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// List of Variant Alternates
|
/// List of Variant Alternates
|
||||||
pub struct VariantAlternatesList(
|
pub struct VariantAlternatesList(
|
||||||
#[css(if_empty = "normal", iterable)] pub Box<[VariantAlternates]>,
|
#[css(if_empty = "normal", iterable)] pub Box<[VariantAlternates]>,
|
||||||
|
@ -1048,7 +1050,7 @@ impl VariantAlternatesList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Control over the selection of these alternate glyphs
|
/// Control over the selection of these alternate glyphs
|
||||||
pub enum FontVariantAlternates {
|
pub enum FontVariantAlternates {
|
||||||
/// Use alternative glyph from value
|
/// Use alternative glyph from value
|
||||||
|
@ -1195,7 +1197,7 @@ macro_rules! impl_variant_east_asian {
|
||||||
)+
|
)+
|
||||||
} => {
|
} => {
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(MallocSizeOf)]
|
#[derive(MallocSizeOf, ToShmem)]
|
||||||
/// Vairants for east asian variant
|
/// Vairants for east asian variant
|
||||||
pub struct VariantEastAsian: u16 {
|
pub struct VariantEastAsian: u16 {
|
||||||
/// None of the features
|
/// None of the features
|
||||||
|
@ -1284,7 +1286,7 @@ impl VariantEastAsian {
|
||||||
impl_gecko_keyword_conversions!(VariantEastAsian, u16);
|
impl_gecko_keyword_conversions!(VariantEastAsian, u16);
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Allows control of glyph substitution and sizing in East Asian text.
|
/// Allows control of glyph substitution and sizing in East Asian text.
|
||||||
pub enum FontVariantEastAsian {
|
pub enum FontVariantEastAsian {
|
||||||
/// Value variant with `variant-east-asian`
|
/// Value variant with `variant-east-asian`
|
||||||
|
@ -1402,7 +1404,7 @@ macro_rules! impl_variant_ligatures {
|
||||||
)+
|
)+
|
||||||
} => {
|
} => {
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(MallocSizeOf)]
|
#[derive(MallocSizeOf, ToShmem)]
|
||||||
/// Variants of ligatures
|
/// Variants of ligatures
|
||||||
pub struct VariantLigatures: u16 {
|
pub struct VariantLigatures: u16 {
|
||||||
/// Specifies that common default features are enabled
|
/// Specifies that common default features are enabled
|
||||||
|
@ -1495,7 +1497,7 @@ impl VariantLigatures {
|
||||||
impl_gecko_keyword_conversions!(VariantLigatures, u16);
|
impl_gecko_keyword_conversions!(VariantLigatures, u16);
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Ligatures and contextual forms are ways of combining glyphs
|
/// Ligatures and contextual forms are ways of combining glyphs
|
||||||
/// to produce more harmonized forms
|
/// to produce more harmonized forms
|
||||||
pub enum FontVariantLigatures {
|
pub enum FontVariantLigatures {
|
||||||
|
@ -1624,7 +1626,7 @@ macro_rules! impl_variant_numeric {
|
||||||
)+
|
)+
|
||||||
} => {
|
} => {
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(MallocSizeOf)]
|
#[derive(MallocSizeOf, ToShmem)]
|
||||||
/// Vairants of numeric values
|
/// Vairants of numeric values
|
||||||
pub struct VariantNumeric: u8 {
|
pub struct VariantNumeric: u8 {
|
||||||
/// None of other variants are enabled.
|
/// None of other variants are enabled.
|
||||||
|
@ -1711,7 +1713,7 @@ impl VariantNumeric {
|
||||||
impl_gecko_keyword_conversions!(VariantNumeric, u8);
|
impl_gecko_keyword_conversions!(VariantNumeric, u8);
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Specifies control over numerical forms.
|
/// Specifies control over numerical forms.
|
||||||
pub enum FontVariantNumeric {
|
pub enum FontVariantNumeric {
|
||||||
/// Value variant with `variant-numeric`
|
/// Value variant with `variant-numeric`
|
||||||
|
@ -1820,7 +1822,7 @@ pub type SpecifiedFontFeatureSettings = FontSettings<FeatureTagValue<Integer>>;
|
||||||
|
|
||||||
/// Define initial settings that apply when the font defined by an @font-face
|
/// Define initial settings that apply when the font defined by an @font-face
|
||||||
/// rule is rendered.
|
/// rule is rendered.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum FontFeatureSettings {
|
pub enum FontFeatureSettings {
|
||||||
/// Value of `FontSettings`
|
/// Value of `FontSettings`
|
||||||
Value(SpecifiedFontFeatureSettings),
|
Value(SpecifiedFontFeatureSettings),
|
||||||
|
@ -1864,7 +1866,9 @@ impl Parse for FontFeatureSettings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
/// Whether user agents are allowed to synthesize bold or oblique font faces
|
/// Whether user agents are allowed to synthesize bold or oblique font faces
|
||||||
/// when a font family lacks bold or italic faces
|
/// when a font family lacks bold or italic faces
|
||||||
pub struct FontSynthesis {
|
pub struct FontSynthesis {
|
||||||
|
@ -1964,7 +1968,7 @@ impl From<FontSynthesis> for u8 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Allows authors to explicitly specify the language system of the font,
|
/// Allows authors to explicitly specify the language system of the font,
|
||||||
/// overriding the language system implied by the content language
|
/// overriding the language system implied by the content language
|
||||||
pub enum FontLanguageOverride {
|
pub enum FontLanguageOverride {
|
||||||
|
@ -2068,7 +2072,7 @@ pub type SpecifiedFontVariationSettings = FontSettings<VariationValue<Number>>;
|
||||||
|
|
||||||
/// Define initial settings that apply when the font defined by an @font-face
|
/// Define initial settings that apply when the font defined by an @font-face
|
||||||
/// rule is rendered.
|
/// rule is rendered.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum FontVariationSettings {
|
pub enum FontVariationSettings {
|
||||||
/// Value of `FontSettings`
|
/// Value of `FontSettings`
|
||||||
Value(SpecifiedFontVariationSettings),
|
Value(SpecifiedFontVariationSettings),
|
||||||
|
@ -2155,7 +2159,15 @@ impl Parse for VariationValue<Number> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// text-zoom. Enable if true, disable if false
|
/// text-zoom. Enable if true, disable if false
|
||||||
pub struct XTextZoom(#[css(skip)] pub bool);
|
pub struct XTextZoom(#[css(skip)] pub bool);
|
||||||
|
@ -2173,7 +2185,9 @@ impl Parse for XTextZoom {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
/// Internal property that reflects the lang attribute
|
/// Internal property that reflects the lang attribute
|
||||||
pub struct XLang(#[css(skip)] pub Atom);
|
pub struct XLang(#[css(skip)] pub Atom);
|
||||||
|
|
||||||
|
@ -2199,7 +2213,7 @@ impl Parse for XLang {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Specifies the minimum font size allowed due to changes in scriptlevel.
|
/// Specifies the minimum font size allowed due to changes in scriptlevel.
|
||||||
/// Ref: https://wiki.mozilla.org/MathML:mstyle
|
/// Ref: https://wiki.mozilla.org/MathML:mstyle
|
||||||
pub struct MozScriptMinSize(pub NoCalcLength);
|
pub struct MozScriptMinSize(pub NoCalcLength);
|
||||||
|
@ -2226,7 +2240,7 @@ impl Parse for MozScriptMinSize {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// Changes the scriptlevel in effect for the children.
|
/// Changes the scriptlevel in effect for the children.
|
||||||
/// Ref: https://wiki.mozilla.org/MathML:mstyle
|
/// Ref: https://wiki.mozilla.org/MathML:mstyle
|
||||||
///
|
///
|
||||||
|
@ -2261,7 +2275,7 @@ impl Parse for MozScriptLevel {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem)]
|
||||||
/// Specifies the multiplier to be used to adjust font size
|
/// Specifies the multiplier to be used to adjust font size
|
||||||
/// due to changes in scriptlevel.
|
/// due to changes in scriptlevel.
|
||||||
///
|
///
|
||||||
|
|
|
@ -96,7 +96,7 @@ pub type GradientKind =
|
||||||
generic::GradientKind<LineDirection, Length, LengthPercentage, GradientPosition, Angle>;
|
generic::GradientKind<LineDirection, Length, LengthPercentage, GradientPosition, Angle>;
|
||||||
|
|
||||||
/// A specified gradient line direction.
|
/// A specified gradient line direction.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum LineDirection {
|
pub enum LineDirection {
|
||||||
/// An angular direction.
|
/// An angular direction.
|
||||||
Angle(Angle),
|
Angle(Angle),
|
||||||
|
@ -115,7 +115,7 @@ pub enum LineDirection {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A binary enum to hold either Position or LegacyPosition.
|
/// A binary enum to hold either Position or LegacyPosition.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
pub enum GradientPosition {
|
pub enum GradientPosition {
|
||||||
/// 1, 2, 3, 4-valued <position>.
|
/// 1, 2, 3, 4-valued <position>.
|
||||||
|
|
|
@ -56,7 +56,7 @@ pub fn au_to_int_px(au: f32) -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A font relative length.
|
/// A font relative length.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum FontRelativeLength {
|
pub enum FontRelativeLength {
|
||||||
/// A "em" value: https://drafts.csswg.org/css-values/#em
|
/// A "em" value: https://drafts.csswg.org/css-values/#em
|
||||||
#[css(dimension)]
|
#[css(dimension)]
|
||||||
|
@ -236,7 +236,7 @@ impl FontRelativeLength {
|
||||||
/// A viewport-relative length.
|
/// A viewport-relative length.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-values/#viewport-relative-lengths>
|
/// <https://drafts.csswg.org/css-values/#viewport-relative-lengths>
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum ViewportPercentageLength {
|
pub enum ViewportPercentageLength {
|
||||||
/// A vw unit: https://drafts.csswg.org/css-values/#vw
|
/// A vw unit: https://drafts.csswg.org/css-values/#vw
|
||||||
#[css(dimension)]
|
#[css(dimension)]
|
||||||
|
@ -285,7 +285,7 @@ impl ViewportPercentageLength {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// HTML5 "character width", as defined in HTML5 § 14.5.4.
|
/// HTML5 "character width", as defined in HTML5 § 14.5.4.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
pub struct CharacterWidth(pub i32);
|
pub struct CharacterWidth(pub i32);
|
||||||
|
|
||||||
impl CharacterWidth {
|
impl CharacterWidth {
|
||||||
|
@ -303,7 +303,7 @@ impl CharacterWidth {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents an absolute length with its unit
|
/// Represents an absolute length with its unit
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum AbsoluteLength {
|
pub enum AbsoluteLength {
|
||||||
/// An absolute length in pixels (px)
|
/// An absolute length in pixels (px)
|
||||||
#[css(dimension)]
|
#[css(dimension)]
|
||||||
|
@ -409,7 +409,7 @@ impl Add<AbsoluteLength> for AbsoluteLength {
|
||||||
/// A `<length>` without taking `calc` expressions into account
|
/// A `<length>` without taking `calc` expressions into account
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-values/#lengths>
|
/// <https://drafts.csswg.org/css-values/#lengths>
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum NoCalcLength {
|
pub enum NoCalcLength {
|
||||||
/// An absolute length
|
/// An absolute length
|
||||||
///
|
///
|
||||||
|
@ -522,7 +522,7 @@ impl Zero for NoCalcLength {
|
||||||
/// This is commonly used for the `<length>` values.
|
/// This is commonly used for the `<length>` values.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-values/#lengths>
|
/// <https://drafts.csswg.org/css-values/#lengths>
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum Length {
|
pub enum Length {
|
||||||
/// The internal length type that cannot parse `calc`
|
/// The internal length type that cannot parse `calc`
|
||||||
NoCalc(NoCalcLength),
|
NoCalc(NoCalcLength),
|
||||||
|
@ -742,7 +742,7 @@ impl NonNegativeLength {
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-values-4/#typedef-length-percentage
|
/// https://drafts.csswg.org/css-values-4/#typedef-length-percentage
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum LengthPercentage {
|
pub enum LengthPercentage {
|
||||||
Length(NoCalcLength),
|
Length(NoCalcLength),
|
||||||
Percentage(computed::Percentage),
|
Percentage(computed::Percentage),
|
||||||
|
|
|
@ -15,7 +15,9 @@ use style_traits::{ParseError, StyleParseErrorKind};
|
||||||
|
|
||||||
/// Specified and computed `list-style-type` property.
|
/// Specified and computed `list-style-type` property.
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum ListStyleType {
|
pub enum ListStyleType {
|
||||||
/// <counter-style> | none
|
/// <counter-style> | none
|
||||||
CounterStyle(CounterStyleOrNone),
|
CounterStyle(CounterStyleOrNone),
|
||||||
|
@ -74,7 +76,9 @@ impl Parse for ListStyleType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A quote pair.
|
/// A quote pair.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct QuotePair {
|
pub struct QuotePair {
|
||||||
/// The opening quote.
|
/// The opening quote.
|
||||||
pub opening: Box<str>,
|
pub opening: Box<str>,
|
||||||
|
@ -84,7 +88,9 @@ pub struct QuotePair {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specified and computed `quotes` property.
|
/// Specified and computed `quotes` property.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct Quotes(
|
pub struct Quotes(
|
||||||
#[css(iterable, if_empty = "none")]
|
#[css(iterable, if_empty = "none")]
|
||||||
#[ignore_malloc_size_of = "Arc"]
|
#[ignore_malloc_size_of = "Arc"]
|
||||||
|
@ -137,6 +143,7 @@ impl Parse for Quotes {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum MozListReversed {
|
pub enum MozListReversed {
|
||||||
|
|
|
@ -159,7 +159,7 @@ fn parse_number_with_clamping_mode<'i, 't>(
|
||||||
/// A CSS `<number>` specified value.
|
/// A CSS `<number>` specified value.
|
||||||
///
|
///
|
||||||
/// https://drafts.csswg.org/css-values-3/#number-value
|
/// https://drafts.csswg.org/css-values-3/#number-value
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToShmem)]
|
||||||
pub struct Number {
|
pub struct Number {
|
||||||
/// The numeric value itself.
|
/// The numeric value itself.
|
||||||
value: CSSFloat,
|
value: CSSFloat,
|
||||||
|
@ -346,7 +346,7 @@ impl Parse for GreaterThanOrEqualToOneNumber {
|
||||||
///
|
///
|
||||||
/// FIXME(emilio): Should probably use Either.
|
/// FIXME(emilio): Should probably use Either.
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum NumberOrPercentage {
|
pub enum NumberOrPercentage {
|
||||||
Percentage(Percentage),
|
Percentage(Percentage),
|
||||||
Number(Number),
|
Number(Number),
|
||||||
|
@ -406,7 +406,9 @@ impl Parse for NonNegativeNumberOrPercentage {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, SpecifiedValueInfo, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, SpecifiedValueInfo, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct Opacity(Number);
|
pub struct Opacity(Number);
|
||||||
|
|
||||||
impl Parse for Opacity {
|
impl Parse for Opacity {
|
||||||
|
@ -442,7 +444,7 @@ impl ToComputedValue for Opacity {
|
||||||
/// A specified `<integer>`, optionally coming from a `calc()` expression.
|
/// A specified `<integer>`, optionally coming from a `calc()` expression.
|
||||||
///
|
///
|
||||||
/// <https://drafts.csswg.org/css-values/#integers>
|
/// <https://drafts.csswg.org/css-values/#integers>
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, PartialOrd, ToShmem)]
|
||||||
pub struct Integer {
|
pub struct Integer {
|
||||||
value: CSSInteger,
|
value: CSSInteger,
|
||||||
was_calc: bool,
|
was_calc: bool,
|
||||||
|
@ -706,7 +708,9 @@ impl AllowQuirks {
|
||||||
/// An attr(...) rule
|
/// An attr(...) rule
|
||||||
///
|
///
|
||||||
/// `[namespace? `|`]? ident`
|
/// `[namespace? `|`]? ident`
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
#[css(function)]
|
#[css(function)]
|
||||||
pub struct Attr {
|
pub struct Attr {
|
||||||
/// Optional namespace prefix and URL.
|
/// Optional namespace prefix and URL.
|
||||||
|
|
|
@ -23,6 +23,7 @@ use style_traits::{ParseError, StyleParseErrorKind};
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum OffsetPath {
|
pub enum OffsetPath {
|
||||||
// We could merge SVGPathData into ShapeSource, so we could reuse them. However,
|
// We could merge SVGPathData into ShapeSource, so we could reuse them. However,
|
||||||
|
|
|
@ -22,6 +22,7 @@ use style_traits::ParseError;
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
/// <https://drafts.csswg.org/css-ui/#propdef-outline-style>
|
/// <https://drafts.csswg.org/css-ui/#propdef-outline-style>
|
||||||
|
|
|
@ -15,7 +15,7 @@ use style_traits::values::specified::AllowedNumericType;
|
||||||
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, ToCss};
|
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, ToCss};
|
||||||
|
|
||||||
/// A percentage value.
|
/// A percentage value.
|
||||||
#[derive(Clone, Copy, Debug, Default, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Default, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct Percentage {
|
pub struct Percentage {
|
||||||
/// The percentage value as a float.
|
/// The percentage value as a float.
|
||||||
///
|
///
|
||||||
|
|
|
@ -35,7 +35,7 @@ pub type HorizontalPosition = PositionComponent<X>;
|
||||||
pub type VerticalPosition = PositionComponent<Y>;
|
pub type VerticalPosition = PositionComponent<Y>;
|
||||||
|
|
||||||
/// The specified value of a component of a CSS `<position>`.
|
/// The specified value of a component of a CSS `<position>`.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum PositionComponent<S> {
|
pub enum PositionComponent<S> {
|
||||||
/// `center`
|
/// `center`
|
||||||
Center,
|
Center,
|
||||||
|
@ -58,6 +58,7 @@ pub enum PositionComponent<S> {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum X {
|
pub enum X {
|
||||||
|
@ -78,6 +79,7 @@ pub enum X {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum Y {
|
pub enum Y {
|
||||||
|
@ -434,7 +436,16 @@ impl ToCss for LegacyPosition {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// Auto-placement algorithm Option
|
/// Auto-placement algorithm Option
|
||||||
pub enum AutoFlow {
|
pub enum AutoFlow {
|
||||||
|
@ -447,7 +458,16 @@ pub enum AutoFlow {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// Controls how the auto-placement algorithm works
|
/// Controls how the auto-placement algorithm works
|
||||||
/// specifying exactly how auto-placed items get flowed into the grid
|
/// specifying exactly how auto-placed items get flowed into the grid
|
||||||
|
@ -548,7 +568,7 @@ impl From<GridAutoFlow> for u8 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem)]
|
||||||
/// https://drafts.csswg.org/css-grid/#named-grid-area
|
/// https://drafts.csswg.org/css-grid/#named-grid-area
|
||||||
pub struct TemplateAreas {
|
pub struct TemplateAreas {
|
||||||
/// `named area` containing for each template area
|
/// `named area` containing for each template area
|
||||||
|
@ -654,7 +674,9 @@ impl Parse for TemplateAreas {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Arc type for `Arc<TemplateAreas>`
|
/// Arc type for `Arc<TemplateAreas>`
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct TemplateAreasArc(#[ignore_malloc_size_of = "Arc"] pub Arc<TemplateAreas>);
|
pub struct TemplateAreasArc(#[ignore_malloc_size_of = "Arc"] pub Arc<TemplateAreas>);
|
||||||
|
|
||||||
impl Parse for TemplateAreasArc {
|
impl Parse for TemplateAreasArc {
|
||||||
|
@ -669,7 +691,7 @@ impl Parse for TemplateAreasArc {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo)]
|
#[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToShmem)]
|
||||||
/// Not associated with any particular grid item, but can
|
/// Not associated with any particular grid item, but can
|
||||||
/// be referenced from the grid-placement properties.
|
/// be referenced from the grid-placement properties.
|
||||||
pub struct NamedArea {
|
pub struct NamedArea {
|
||||||
|
|
|
@ -12,7 +12,7 @@ use cssparser::{Parser, Token};
|
||||||
use style_traits::{ParseError, StyleParseErrorKind};
|
use style_traits::{ParseError, StyleParseErrorKind};
|
||||||
|
|
||||||
/// A specified resolution.
|
/// A specified resolution.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss, ToShmem)]
|
||||||
pub enum Resolution {
|
pub enum Resolution {
|
||||||
/// Dots per inch.
|
/// Dots per inch.
|
||||||
#[css(dimension)]
|
#[css(dimension)]
|
||||||
|
|
|
@ -128,7 +128,9 @@ const PAINT_ORDER_MASK: u8 = 0b11;
|
||||||
///
|
///
|
||||||
/// Higher priority values, i.e. the values specified first,
|
/// Higher priority values, i.e. the values specified first,
|
||||||
/// will be painted first (and may be covered by paintings of lower priority)
|
/// will be painted first (and may be covered by paintings of lower priority)
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct SVGPaintOrder(pub u8);
|
pub struct SVGPaintOrder(pub u8);
|
||||||
|
|
||||||
impl SVGPaintOrder {
|
impl SVGPaintOrder {
|
||||||
|
@ -235,7 +237,9 @@ impl ToCss for SVGPaintOrder {
|
||||||
|
|
||||||
/// Specified MozContextProperties value.
|
/// Specified MozContextProperties value.
|
||||||
/// Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)
|
/// Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
|
#[derive(
|
||||||
|
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub struct MozContextProperties(pub CustomIdent);
|
pub struct MozContextProperties(pub CustomIdent);
|
||||||
|
|
||||||
impl Parse for MozContextProperties {
|
impl Parse for MozContextProperties {
|
||||||
|
|
|
@ -19,7 +19,14 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||||
///
|
///
|
||||||
/// https://www.w3.org/TR/SVG11/paths.html#PathData
|
/// https://www.w3.org/TR/SVG11/paths.html#PathData
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue,
|
Clone,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToAnimatedZero,
|
||||||
|
ToComputedValue,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct SVGPathData(Box<[PathCommand]>);
|
pub struct SVGPathData(Box<[PathCommand]>);
|
||||||
|
|
||||||
|
@ -147,6 +154,7 @@ impl ComputeSquaredDistance for SVGPathData {
|
||||||
PartialEq,
|
PartialEq,
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[repr(C, u8)]
|
#[repr(C, u8)]
|
||||||
|
@ -473,6 +481,7 @@ impl ToCss for PathCommand {
|
||||||
PartialEq,
|
PartialEq,
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum IsAbsolute {
|
pub enum IsAbsolute {
|
||||||
|
@ -501,6 +510,7 @@ impl IsAbsolute {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToAnimatedZero,
|
ToAnimatedZero,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct CoordPair(CSSFloat, CSSFloat);
|
pub struct CoordPair(CSSFloat, CSSFloat);
|
||||||
|
@ -514,7 +524,7 @@ impl CoordPair {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The EllipticalArc flag type.
|
/// The EllipticalArc flag type.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct ArcFlag(bool);
|
pub struct ArcFlag(bool);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,15 @@ use cssparser::Parser;
|
||||||
use style_traits::{ParseError, StyleParseErrorKind};
|
use style_traits::{ParseError, StyleParseErrorKind};
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
/// span. for `<col span>` pres attr
|
/// span. for `<col span>` pres attr
|
||||||
pub struct XSpan(#[css(skip)] pub i32);
|
pub struct XSpan(#[css(skip)] pub i32);
|
||||||
|
|
|
@ -134,7 +134,7 @@ impl ToComputedValue for LineHeight {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A generic value for the `text-overflow` property.
|
/// A generic value for the `text-overflow` property.
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum TextOverflowSide {
|
pub enum TextOverflowSide {
|
||||||
/// Clip inline content.
|
/// Clip inline content.
|
||||||
Clip,
|
Clip,
|
||||||
|
@ -168,7 +168,7 @@ impl Parse for TextOverflowSide {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
/// text-overflow. Specifies rendering when inline content overflows its line box edge.
|
/// text-overflow. Specifies rendering when inline content overflows its line box edge.
|
||||||
pub struct TextOverflow {
|
pub struct TextOverflow {
|
||||||
/// First value. Applies to end line box edge if no second is supplied; line-left edge otherwise.
|
/// First value. Applies to end line box edge if no second is supplied; line-left edge otherwise.
|
||||||
|
@ -228,7 +228,7 @@ impl ToComputedValue for TextOverflow {
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToShmem)]
|
||||||
#[value_info(other_values = "none,underline,overline,line-through,blink")]
|
#[value_info(other_values = "none,underline,overline,line-through,blink")]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
/// Specified keyword values for the text-decoration-line property.
|
/// Specified keyword values for the text-decoration-line property.
|
||||||
|
@ -365,6 +365,7 @@ impl TextDecorationLine {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum TextAlignKeyword {
|
pub enum TextAlignKeyword {
|
||||||
|
@ -393,7 +394,7 @@ pub enum TextAlignKeyword {
|
||||||
|
|
||||||
/// Specified value of text-align property.
|
/// Specified value of text-align property.
|
||||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum TextAlign {
|
pub enum TextAlign {
|
||||||
/// Keyword value of text-align property.
|
/// Keyword value of text-align property.
|
||||||
Keyword(TextAlignKeyword),
|
Keyword(TextAlignKeyword),
|
||||||
|
@ -470,7 +471,7 @@ impl ToComputedValue for TextAlign {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specified value of text-emphasis-style property.
|
/// Specified value of text-emphasis-style property.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum TextEmphasisStyle {
|
pub enum TextEmphasisStyle {
|
||||||
/// <fill> <shape>
|
/// <fill> <shape>
|
||||||
Keyword(TextEmphasisKeywordValue),
|
Keyword(TextEmphasisKeywordValue),
|
||||||
|
@ -481,7 +482,7 @@ pub enum TextEmphasisStyle {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Keyword value for the text-emphasis-style property
|
/// Keyword value for the text-emphasis-style property
|
||||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum TextEmphasisKeywordValue {
|
pub enum TextEmphasisKeywordValue {
|
||||||
/// <fill>
|
/// <fill>
|
||||||
Fill(TextEmphasisFillMode),
|
Fill(TextEmphasisFillMode),
|
||||||
|
@ -510,7 +511,9 @@ impl TextEmphasisKeywordValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fill mode for the text-emphasis-style property
|
/// Fill mode for the text-emphasis-style property
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum TextEmphasisFillMode {
|
pub enum TextEmphasisFillMode {
|
||||||
/// `filled`
|
/// `filled`
|
||||||
Filled,
|
Filled,
|
||||||
|
@ -519,7 +522,9 @@ pub enum TextEmphasisFillMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shape keyword for the text-emphasis-style property
|
/// Shape keyword for the text-emphasis-style property
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
|
||||||
|
)]
|
||||||
pub enum TextEmphasisShapeKeyword {
|
pub enum TextEmphasisShapeKeyword {
|
||||||
/// `dot`
|
/// `dot`
|
||||||
Dot,
|
Dot,
|
||||||
|
@ -669,6 +674,7 @@ impl Parse for TextEmphasisStyle {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum TextEmphasisHorizontalWritingModeValue {
|
pub enum TextEmphasisHorizontalWritingModeValue {
|
||||||
/// Draw marks over the text in horizontal writing mode.
|
/// Draw marks over the text in horizontal writing mode.
|
||||||
|
@ -689,6 +695,7 @@ pub enum TextEmphasisHorizontalWritingModeValue {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub enum TextEmphasisVerticalWritingModeValue {
|
pub enum TextEmphasisVerticalWritingModeValue {
|
||||||
/// Draws marks to the right of the text in vertical writing mode.
|
/// Draws marks to the right of the text in vertical writing mode.
|
||||||
|
@ -699,7 +706,15 @@ pub enum TextEmphasisVerticalWritingModeValue {
|
||||||
|
|
||||||
/// Specified value of `text-emphasis-position` property.
|
/// Specified value of `text-emphasis-position` property.
|
||||||
#[derive(
|
#[derive(
|
||||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
MallocSizeOf,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
pub struct TextEmphasisPosition(
|
pub struct TextEmphasisPosition(
|
||||||
pub TextEmphasisHorizontalWritingModeValue,
|
pub TextEmphasisHorizontalWritingModeValue,
|
||||||
|
@ -800,6 +815,7 @@ impl From<TextEmphasisPosition> for u8 {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum WordBreak {
|
pub enum WordBreak {
|
||||||
|
@ -827,6 +843,7 @@ pub enum WordBreak {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum OverflowWrap {
|
pub enum OverflowWrap {
|
||||||
|
|
|
@ -15,7 +15,7 @@ use style_traits::values::specified::AllowedNumericType;
|
||||||
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
||||||
|
|
||||||
/// A time value according to CSS-VALUES § 6.2.
|
/// A time value according to CSS-VALUES § 6.2.
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub struct Time {
|
pub struct Time {
|
||||||
seconds: CSSFloat,
|
seconds: CSSFloat,
|
||||||
unit: TimeUnit,
|
unit: TimeUnit,
|
||||||
|
@ -23,7 +23,7 @@ pub struct Time {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A time unit.
|
/// A time unit.
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum TimeUnit {
|
pub enum TimeUnit {
|
||||||
/// `s`
|
/// `s`
|
||||||
Second,
|
Second,
|
||||||
|
|
|
@ -232,7 +232,7 @@ impl Parse for Transform {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The specified value of a component of a CSS `<transform-origin>`.
|
/// The specified value of a component of a CSS `<transform-origin>`.
|
||||||
#[derive(Clone, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||||
pub enum OriginComponent<S> {
|
pub enum OriginComponent<S> {
|
||||||
/// `center`
|
/// `center`
|
||||||
Center,
|
Center,
|
||||||
|
|
|
@ -56,7 +56,9 @@ impl Parse for CursorImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specified value of `-moz-force-broken-image-icon`
|
/// Specified value of `-moz-force-broken-image-icon`
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
#[derive(
|
||||||
|
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
|
||||||
|
)]
|
||||||
pub struct MozForceBrokenImageIcon(pub bool);
|
pub struct MozForceBrokenImageIcon(pub bool);
|
||||||
|
|
||||||
impl MozForceBrokenImageIcon {
|
impl MozForceBrokenImageIcon {
|
||||||
|
@ -139,6 +141,7 @@ impl Parse for ScrollbarColor {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum UserSelect {
|
pub enum UserSelect {
|
||||||
|
@ -166,6 +169,7 @@ pub enum UserSelect {
|
||||||
SpecifiedValueInfo,
|
SpecifiedValueInfo,
|
||||||
ToComputedValue,
|
ToComputedValue,
|
||||||
ToCss,
|
ToCss,
|
||||||
|
ToShmem,
|
||||||
)]
|
)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum CursorKind {
|
pub enum CursorKind {
|
||||||
|
|
|
@ -26,3 +26,5 @@ webrender_api = {git = "https://github.com/servo/webrender", optional = true}
|
||||||
servo_atoms = {path = "../atoms", optional = true}
|
servo_atoms = {path = "../atoms", optional = true}
|
||||||
servo_arc = { path = "../servo_arc" }
|
servo_arc = { path = "../servo_arc" }
|
||||||
servo_url = { path = "../url", optional = true }
|
servo_url = { path = "../url", optional = true }
|
||||||
|
to_shmem = { path = "../to_shmem" }
|
||||||
|
to_shmem_derive = { path = "../to_shmem_derive" }
|
||||||
|
|
|
@ -28,6 +28,9 @@ extern crate servo_arc;
|
||||||
extern crate servo_atoms;
|
extern crate servo_atoms;
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
extern crate servo_url;
|
extern crate servo_url;
|
||||||
|
extern crate to_shmem;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate to_shmem_derive;
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
extern crate webrender_api;
|
extern crate webrender_api;
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
|
|
|
@ -441,7 +441,7 @@ macro_rules! define_css_keyword_enum {
|
||||||
(pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
|
(pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||||
pub enum $name {
|
pub enum $name {
|
||||||
$($variant),+
|
$($variant),+
|
||||||
}
|
}
|
||||||
|
@ -497,7 +497,7 @@ pub mod specified {
|
||||||
|
|
||||||
/// Whether to allow negative lengths or not.
|
/// Whether to allow negative lengths or not.
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, PartialOrd, ToShmem)]
|
||||||
pub enum AllowedNumericType {
|
pub enum AllowedNumericType {
|
||||||
/// Allow all kind of numeric values.
|
/// Allow all kind of numeric values.
|
||||||
All,
|
All,
|
||||||
|
|
|
@ -80,7 +80,7 @@ impl ToCss for ViewportConstraints {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://drafts.csswg.org/css-device-adapt/#descdef-viewport-zoom>
|
/// <https://drafts.csswg.org/css-device-adapt/#descdef-viewport-zoom>
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug, PartialEq, ToShmem)]
|
||||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||||
pub enum Zoom {
|
pub enum Zoom {
|
||||||
/// A number value.
|
/// A number value.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue