mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Revert "style: Preserve font-family identifier sequence when serializing."
This reverts commit 4f525f6fa0
.
This commit is contained in:
parent
ac37f81c1f
commit
e163352714
4 changed files with 24 additions and 52 deletions
|
@ -2181,7 +2181,7 @@ fn static_assert() {
|
|||
}
|
||||
|
||||
pub fn set_font_family(&mut self, v: longhands::font_family::computed_value::T) {
|
||||
use properties::longhands::font_family::computed_value::{FontFamily, FamilyNameSyntax};
|
||||
use properties::longhands::font_family::computed_value::FontFamily;
|
||||
|
||||
let list = &mut self.gecko.mFont.fontlist;
|
||||
unsafe { Gecko_FontFamilyList_Clear(list); }
|
||||
|
@ -2191,8 +2191,7 @@ fn static_assert() {
|
|||
for family in &v.0 {
|
||||
match *family {
|
||||
FontFamily::FamilyName(ref f) => {
|
||||
let quoted = matches!(f.syntax, FamilyNameSyntax::Quoted);
|
||||
unsafe { Gecko_FontFamilyList_AppendNamed(list, f.name.as_ptr(), quoted); }
|
||||
unsafe { Gecko_FontFamilyList_AppendNamed(list, f.name.as_ptr(), f.quoted); }
|
||||
}
|
||||
FontFamily::Generic(ref name) => {
|
||||
let (family_type, generic) = FontFamily::generic(name);
|
||||
|
@ -2223,7 +2222,7 @@ fn static_assert() {
|
|||
}
|
||||
|
||||
pub fn clone_font_family(&self) -> longhands::font_family::computed_value::T {
|
||||
use properties::longhands::font_family::computed_value::{FontFamily, FamilyName, FamilyNameSyntax};
|
||||
use properties::longhands::font_family::computed_value::{FontFamily, FamilyName};
|
||||
use gecko_bindings::structs::FontFamilyType;
|
||||
use gecko_string_cache::Atom;
|
||||
|
||||
|
@ -2236,16 +2235,13 @@ fn static_assert() {
|
|||
FontFamilyType::eFamily_cursive => FontFamily::Generic(atom!("cursive")),
|
||||
FontFamilyType::eFamily_fantasy => FontFamily::Generic(atom!("fantasy")),
|
||||
FontFamilyType::eFamily_moz_fixed => FontFamily::Generic(Atom::from("-moz-fixed")),
|
||||
FontFamilyType::eFamily_named => {
|
||||
let name = Atom::from(&*gecko_font_family_name.mName);
|
||||
FontFamily::FamilyName(FamilyName {
|
||||
name: name.clone(),
|
||||
syntax: FamilyNameSyntax::Identifiers(vec![name]),
|
||||
})
|
||||
},
|
||||
FontFamilyType::eFamily_named => FontFamily::FamilyName(FamilyName {
|
||||
name: (&*gecko_font_family_name.mName).into(),
|
||||
quoted: false
|
||||
}),
|
||||
FontFamilyType::eFamily_named_quoted => FontFamily::FamilyName(FamilyName {
|
||||
name: (&*gecko_font_family_name.mName).into(),
|
||||
syntax: FamilyNameSyntax::Quoted,
|
||||
quoted: true
|
||||
}),
|
||||
x => panic!("Found unexpected font FontFamilyType: {:?}", x),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue