Enum style::values::specified::font::FontSize
[−]
[src]
pub enum FontSize { Length(LengthOrPercentage), Keyword(KeywordInfo), Smaller, Larger, System(SystemFont), }
A specified font-size value
Variants
Length(LengthOrPercentage)
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.
Methods
impl FontSize
[src]
pub fn from_html_size(size: u8) -> Self
[src]
pub fn to_computed_value_against(
&self,
context: &Context,
base_size: FontBaseSize
) -> FontSize
[src]
&self,
context: &Context,
base_size: FontBaseSize
) -> FontSize
Compute it against a given base font size
impl FontSize
[src]
pub fn system_font(f: SystemFont) -> Self
[src]
Construct a system font value.
pub fn get_system(&self) -> Option<SystemFont>
[src]
Obtain the system font, if any
pub fn medium() -> Self
[src]
Get initial value for specified font size.
pub fn parse_quirky<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks
) -> Result<FontSize, ParseError<'i>>
[src]
context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks
) -> Result<FontSize, ParseError<'i>>
Parses a font-size, with quirks.
pub fn cascade_specified_font_size(
context: &mut Context,
specified_value: &FontSize,
computed: FontSize
)
[src]
context: &mut Context,
specified_value: &FontSize,
computed: FontSize
)
Cascade font-size
with specified value
Trait Implementations
impl Clone for FontSize
[src]
fn clone(&self) -> FontSize
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for FontSize
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl MallocSizeOf for FontSize
[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
impl PartialEq for FontSize
[src]
fn eq(&self, __arg_0: &FontSize) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &FontSize) -> bool
[src]
This method tests for !=
.
impl ToCss for FontSize
[src]
fn to_css<W>(&self, dest: &mut W) -> Result where
W: Write,
[src]
W: Write,
Serialize self
in CSS syntax, writing to dest
.
fn to_css_string(&self) -> String
[src]
Serialize self
in CSS syntax and return a string. Read more
impl From<LengthOrPercentage> for FontSize
[src]
fn from(other: LengthOrPercentage) -> Self
[src]
Performs the conversion.
impl ToComputedValue for FontSize
[src]
type ComputedValue = FontSize
The computed value type we're going to be converted to.
fn to_computed_value(&self, context: &Context) -> FontSize
[src]
Convert a specified value to a computed value, using itself and the data inside the Context
. Read more
fn from_computed_value(computed: &FontSize) -> Self
[src]
Convert a computed value to specified value form. Read more
impl Parse for FontSize
[src]
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<FontSize, ParseError<'i>>
[src]
context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<FontSize, ParseError<'i>>