mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
style: Reformat recent changes.
This commit is contained in:
parent
7c4f9bbf49
commit
8c004c0858
40 changed files with 571 additions and 212 deletions
|
@ -40,7 +40,9 @@ 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, ToResolvedValue)]
|
||||
#[derive(
|
||||
Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue,
|
||||
)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
pub struct FontWeight(pub Number);
|
||||
|
||||
|
@ -190,7 +192,9 @@ impl FontFamily {
|
|||
/// Get default font family as `serif` which is a generic font-family
|
||||
pub fn serif() -> Self {
|
||||
FontFamily {
|
||||
families: FontFamilyList::new(Box::new([SingleFontFamily::Generic(GenericFontFamily::Serif)])),
|
||||
families: FontFamilyList::new(Box::new([SingleFontFamily::Generic(
|
||||
GenericFontFamily::Serif,
|
||||
)])),
|
||||
is_system_font: false,
|
||||
}
|
||||
}
|
||||
|
@ -427,8 +431,10 @@ impl PartialEq for FontFamilyList {
|
|||
return false;
|
||||
}
|
||||
for (a, b) in self_list.mNames.iter().zip(other_list.mNames.iter()) {
|
||||
if a.mSyntax != b.mSyntax || a.mName.mRawPtr != b.mName.mRawPtr ||
|
||||
a.mGeneric != b.mGeneric {
|
||||
if a.mSyntax != b.mSyntax ||
|
||||
a.mName.mRawPtr != b.mName.mRawPtr ||
|
||||
a.mGeneric != b.mGeneric
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -459,19 +465,15 @@ impl FontFamilyList {
|
|||
|
||||
for family in families.iter() {
|
||||
match *family {
|
||||
SingleFontFamily::FamilyName(ref f) => {
|
||||
unsafe {
|
||||
bindings::Gecko_nsTArray_FontFamilyName_AppendNamed(
|
||||
names,
|
||||
f.name.as_ptr(),
|
||||
f.syntax,
|
||||
);
|
||||
}
|
||||
SingleFontFamily::FamilyName(ref f) => unsafe {
|
||||
bindings::Gecko_nsTArray_FontFamilyName_AppendNamed(
|
||||
names,
|
||||
f.name.as_ptr(),
|
||||
f.syntax,
|
||||
);
|
||||
},
|
||||
SingleFontFamily::Generic(family) => {
|
||||
unsafe {
|
||||
bindings::Gecko_nsTArray_FontFamilyName_AppendGeneric(names, family);
|
||||
}
|
||||
SingleFontFamily::Generic(family) => unsafe {
|
||||
bindings::Gecko_nsTArray_FontFamilyName_AppendGeneric(names, family);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -547,7 +549,17 @@ impl<'a> Iterator for FontFamilyNameIter<'a> {
|
|||
}
|
||||
|
||||
/// Preserve the readability of text when font fallback occurs
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)]
|
||||
#[derive(
|
||||
Animate,
|
||||
Clone,
|
||||
ComputeSquaredDistance,
|
||||
Copy,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
ToCss,
|
||||
ToResolvedValue,
|
||||
)]
|
||||
pub enum FontSizeAdjust {
|
||||
#[animation(error)]
|
||||
/// None variant
|
||||
|
@ -831,7 +843,9 @@ 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, ToResolvedValue)]
|
||||
#[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