pub enum FontSize {
Length(LengthPercentage),
Keyword(KeywordInfo),
Smaller,
Larger,
System(SystemFont),
}
Expand description
A specified font-size value
Variants§
Length(LengthPercentage)
A length; e.g. 10px.
Keyword(KeywordInfo)
A keyword value, along with a ratio and absolute offset. The ratio in any specified keyword value will be 1 (with offset 0), but we cascade keywordness even after font-relative (percent and em) values have been applied, which is where the ratio comes in. The offset comes in if we cascaded a calc value, where the font-relative portion (em and percentage) will go into the ratio, and the remaining units all computed together will go into the offset. See bug 1355707.
Smaller
font-size: smaller
Larger
font-size: larger
System(SystemFont)
Derived from a specified system font.
Implementations§
source§impl FontSize
impl FontSize
sourcepub fn from_html_size(size: u8) -> Self
pub fn from_html_size(size: u8) -> Self
sourcepub fn to_computed_value_against(
&self,
context: &Context<'_>,
base_size: FontBaseSize
) -> FontSize
pub fn to_computed_value_against( &self, context: &Context<'_>, base_size: FontBaseSize ) -> FontSize
Compute it against a given base font size
source§impl FontSize
impl FontSize
sourcepub fn system_font(f: SystemFont) -> Self
pub fn system_font(f: SystemFont) -> Self
Get a specified value that represents a system font.
sourcepub fn get_system(&self) -> Option<SystemFont>
pub fn get_system(&self) -> Option<SystemFont>
Retreive a SystemFont from the specified value.
sourcepub fn parse_quirky<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks
) -> Result<FontSize, ParseError<'i>>
pub fn parse_quirky<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, allow_quirks: AllowQuirks ) -> Result<FontSize, ParseError<'i>>
Parses a font-size, with quirks.
Trait Implementations§
source§impl MallocSizeOf for FontSize
impl MallocSizeOf for FontSize
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl Parse for FontSize
impl Parse for FontSize
source§fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>
) -> Result<FontSize, ParseError<'i>>
fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't> ) -> Result<FontSize, ParseError<'i>>
source§impl PartialEq<FontSize> for FontSize
impl PartialEq<FontSize> for FontSize
source§impl SpecifiedValueInfo for FontSize
impl SpecifiedValueInfo for FontSize
source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
source§impl ToComputedValue for FontSize
impl ToComputedValue for FontSize
§type ComputedValue = FontSize
type ComputedValue = FontSize
source§fn to_computed_value(&self, context: &Context<'_>) -> FontSize
fn to_computed_value(&self, context: &Context<'_>) -> FontSize
Context
.