mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Cleanup generic font-family handling.
To be more similar between Rust and C++. This introduces GenericFontFamily and exposes that plus FontFamilyNameSyntax to C++, using that where appropriate instead of plain uint8_t as we were doing. As a follow-up, as discussed on IRC with Jonathan, we can remove the -moz-fixed family, and turn it just into an alias of Monospace. The only non-trivial change is the MatchType changes, but they're ok I think. The code already assumed at most one CSS generic, and the struct still takes 8 bits. I've verified that the relevant tests are passing (though try is closed). Differential Revision: https://phabricator.services.mozilla.com/D24272
This commit is contained in:
parent
c49a88ec84
commit
2184e3f2e5
7 changed files with 124 additions and 250 deletions
|
@ -326,7 +326,7 @@ ${helpers.predefined_type(
|
|||
|
||||
use app_units::Au;
|
||||
use cssparser::{Parser, ToCss};
|
||||
use crate::gecko_bindings::structs::FontFamilyType;
|
||||
use crate::values::computed::font::GenericFontFamily;
|
||||
use crate::properties::longhands;
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
@ -466,7 +466,7 @@ ${helpers.predefined_type(
|
|||
pub ${name}: longhands::${name}::computed_value::T,
|
||||
% endfor
|
||||
pub system_font: SystemFont,
|
||||
pub default_font_type: FontFamilyType,
|
||||
pub default_font_type: GenericFontFamily,
|
||||
}
|
||||
|
||||
impl SystemFont {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue