Struct layout_2020::flow::inline::BaselineRelativeSize
source · struct BaselineRelativeSize {
ascent: Au,
descent: Au,
}
Expand description
A block size relative to a line’s final baseline. This is to track the size contribution of a particular element of a line above and below the baseline. These sizes can be combined with other baseline relative sizes before the final baseline position is known. The values here are relative to the overall line’s baseline and not the nested baseline of an inline box.
Fields§
§ascent: Au
The ascent above the baseline, where a positive value means a larger
ascent. Thus, the top of this size contribution is baseline_offset - ascent
.
descent: Au
The descent below the baseline, where a positive value means a larger
descent. Thus, the bottom of this size contribution is baseline_offset + descent
.
Implementations§
source§impl BaselineRelativeSize
impl BaselineRelativeSize
fn zero() -> Self
fn max(&self, other: &Self) -> Self
sourcefn adjust_for_nested_baseline_offset(&mut self, baseline_offset: Au)
fn adjust_for_nested_baseline_offset(&mut self, baseline_offset: Au)
Given an offset from the line’s root baseline, adjust this BaselineRelativeSize
by that offset. This is used to adjust a BaselineRelativeSize
for different kinds
of baseline-relative vertical-align
. This will “move” measured size of a particular
inline box’s block size. For example, in the following HTML:
<div>
<span style="vertical-align: 5px">child content</span>
</div>
If this BaselineRelativeSize
is for the <span>
then the adjustment
passed here would be equivalent to -5px.
Trait Implementations§
source§impl Clone for BaselineRelativeSize
impl Clone for BaselineRelativeSize
source§fn clone(&self) -> BaselineRelativeSize
fn clone(&self) -> BaselineRelativeSize
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for BaselineRelativeSize
impl RefUnwindSafe for BaselineRelativeSize
impl Send for BaselineRelativeSize
impl Sync for BaselineRelativeSize
impl Unpin for BaselineRelativeSize
impl UnwindSafe for BaselineRelativeSize
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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