#[repr(u8)]pub enum FontRelativeLength {
Em(CSSFloat),
Ex(CSSFloat),
Ch(CSSFloat),
Cap(CSSFloat),
Ic(CSSFloat),
Rem(CSSFloat),
Lh(CSSFloat),
Rlh(CSSFloat),
}Expand description
A font relative length. Note that if any new value is
added here, custom_properties::NonCustomReferences::from_unit
must also be updated. Consult the comment in that function as to why.
Variants§
Em(CSSFloat)
A “em” value: https://drafts.csswg.org/css-values/#em
Ex(CSSFloat)
A “ex” value: https://drafts.csswg.org/css-values/#ex
Ch(CSSFloat)
A “ch” value: https://drafts.csswg.org/css-values/#ch
Cap(CSSFloat)
A “cap” value: https://drafts.csswg.org/css-values/#cap
Ic(CSSFloat)
An “ic” value: https://drafts.csswg.org/css-values/#ic
Rem(CSSFloat)
A “rem” value: https://drafts.csswg.org/css-values/#rem
Lh(CSSFloat)
A “lh” value: https://drafts.csswg.org/css-values/#lh
Rlh(CSSFloat)
A “rlh” value: https://drafts.csswg.org/css-values/#lh
Implementations§
Source§impl FontRelativeLength
impl FontRelativeLength
Sourcepub fn to_computed_value(
&self,
context: &Context<'_>,
base_size: FontBaseSize,
line_height_base: LineHeightBase,
) -> Length
pub fn to_computed_value( &self, context: &Context<'_>, base_size: FontBaseSize, line_height_base: LineHeightBase, ) -> Length
Computes the font-relative length.
Trait Implementations§
Source§impl Clone for FontRelativeLength
impl Clone for FontRelativeLength
Source§fn clone(&self) -> FontRelativeLength
fn clone(&self) -> FontRelativeLength
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FontRelativeLength
impl Debug for FontRelativeLength
Source§impl MallocSizeOf for FontRelativeLength
impl MallocSizeOf for FontRelativeLength
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl PartialEq for FontRelativeLength
impl PartialEq for FontRelativeLength
Source§impl PartialOrd for FontRelativeLength
impl PartialOrd for FontRelativeLength
Source§impl ToCss for FontRelativeLength
impl ToCss for FontRelativeLength
Source§impl ToShmem for FontRelativeLength
impl ToShmem for FontRelativeLength
impl Copy for FontRelativeLength
impl StructuralPartialEq for FontRelativeLength
Auto Trait Implementations§
impl Freeze for FontRelativeLength
impl RefUnwindSafe for FontRelativeLength
impl Send for FontRelativeLength
impl Sync for FontRelativeLength
impl Unpin for FontRelativeLength
impl UnwindSafe for FontRelativeLength
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert