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,
line_height_base: LineHeightBase,
) -> FontSize
pub fn to_computed_value_against( &self, context: &Context<'_>, base_size: FontBaseSize, line_height_base: LineHeightBase, ) -> 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 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
source§type ComputedValue = FontSize
type ComputedValue = FontSize
source§fn to_computed_value(&self, context: &Context<'_>) -> FontSize
fn to_computed_value(&self, context: &Context<'_>) -> FontSize
Context
.source§fn from_computed_value(computed: &FontSize) -> Self
fn from_computed_value(computed: &FontSize) -> Self
impl StructuralPartialEq for FontSize
Auto Trait Implementations§
impl Freeze for FontSize
impl RefUnwindSafe for FontSize
impl Send for FontSize
impl Sync for FontSize
impl Unpin for FontSize
impl UnwindSafe for FontSize
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more