mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Derive ToResolvedValue.
Differential Revision: https://phabricator.services.mozilla.com/D26783
This commit is contained in:
parent
6ac777ebf2
commit
a47dcb5707
53 changed files with 359 additions and 108 deletions
|
@ -40,7 +40,7 @@ pub use crate::values::specified::font::{XLang, XTextZoom};
|
|||
/// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
|
||||
///
|
||||
/// This is effectively just a `Number`.
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
pub struct FontWeight(pub Number);
|
||||
|
||||
|
@ -74,6 +74,7 @@ impl ToAnimatedValue for FontWeight {
|
|||
PartialEq,
|
||||
ToAnimatedZero,
|
||||
ToCss,
|
||||
ToResolvedValue,
|
||||
)]
|
||||
/// The computed value of font-size
|
||||
pub struct FontSize {
|
||||
|
@ -174,7 +175,7 @@ impl ToAnimatedValue for FontSize {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, ToResolvedValue)]
|
||||
#[cfg_attr(feature = "servo", derive(Hash, MallocSizeOf))]
|
||||
/// Specifies a prioritized list of font family names or generic family names.
|
||||
pub struct FontFamily {
|
||||
|
@ -221,7 +222,7 @@ impl ToCss for FontFamily {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToResolvedValue, ToShmem)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
/// The name of a font family of choice
|
||||
pub struct FamilyName {
|
||||
|
@ -264,7 +265,7 @@ impl ToCss for FamilyName {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToResolvedValue, ToShmem)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
/// Font family names must either be given quoted as strings,
|
||||
/// or unquoted as a sequence of one or more identifiers.
|
||||
|
@ -279,7 +280,7 @@ pub enum FontFamilyNameSyntax {
|
|||
Identifiers,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToCss)]
|
||||
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize, Hash))]
|
||||
/// A set of faces that vary in weight, width or slope.
|
||||
pub enum SingleFontFamily {
|
||||
|
@ -294,7 +295,7 @@ pub enum SingleFontFamily {
|
|||
/// The order here is important, if you change it make sure that
|
||||
/// `gfxPlatformFontList.h`s ranged array and `gfxFontFamilyList`'s
|
||||
/// sSingleGenerics are updated as well.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, Parse, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, Parse, ToCss, ToResolvedValue)]
|
||||
#[repr(u8)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum GenericFontFamily {
|
||||
|
@ -384,7 +385,7 @@ impl SingleFontFamily {
|
|||
}
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToResolvedValue)]
|
||||
/// A list of SingleFontFamily
|
||||
pub struct FontFamilyList(Box<[SingleFontFamily]>);
|
||||
|
||||
|
@ -546,7 +547,7 @@ impl<'a> Iterator for FontFamilyNameIter<'a> {
|
|||
}
|
||||
|
||||
/// Preserve the readability of text when font fallback occurs
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
|
||||
pub enum FontSizeAdjust {
|
||||
#[animation(error)]
|
||||
/// None variant
|
||||
|
@ -627,7 +628,7 @@ pub type FontVariationSettings = FontSettings<VariationValue<Number>>;
|
|||
/// OpenType "language system" tag, so we should be able to compute
|
||||
/// it and store it as a 32-bit integer
|
||||
/// (see http://www.microsoft.com/typography/otspec/languagetags.htm).
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToResolvedValue)]
|
||||
#[repr(C)]
|
||||
pub struct FontLanguageOverride(pub u32);
|
||||
|
||||
|
@ -733,7 +734,7 @@ impl ToComputedValue for specified::MozScriptLevel {
|
|||
|
||||
/// A wrapper over an `Angle`, that handles clamping to the appropriate range
|
||||
/// for `font-style` animation.
|
||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
pub struct FontStyleAngle(pub Angle);
|
||||
|
||||
|
@ -830,7 +831,7 @@ impl ToCss for FontStyle {
|
|||
/// A value for the font-stretch property per:
|
||||
///
|
||||
/// https://drafts.csswg.org/css-fonts-4/#propdef-font-stretch
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
pub struct FontStretch(pub NonNegativePercentage);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue