pub struct InlineBorderInfo {Show 16 fields
pub top: f32,
pub right: f32,
pub bottom: f32,
pub left: f32,
pub top_color: ColorU,
pub right_color: ColorU,
pub bottom_color: ColorU,
pub left_color: ColorU,
pub radius: Option<f32>,
pub padding_top: f32,
pub padding_right: f32,
pub padding_bottom: f32,
pub padding_left: f32,
pub is_first_fragment: bool,
pub is_last_fragment: bool,
pub is_rtl: bool,
}Expand description
Border information for inline elements (display: inline, inline-block)
This stores the resolved border properties needed for rendering inline element borders. Unlike block elements which render borders via paint_node_background_and_border(), inline element borders must be rendered per glyph-run to handle line breaks correctly.
Fields§
§top: f32Border widths in pixels for each side
right: f32§bottom: f32§left: f32§top_color: ColorUBorder colors for each side
right_color: ColorU§bottom_color: ColorU§left_color: ColorU§radius: Option<f32>Border radius (if any)
padding_top: f32Padding widths in pixels for each side (needed to expand background rect)
padding_right: f32§padding_bottom: f32§padding_left: f32§is_first_fragment: boolCSS 2.2 §9.4.2 / §8.6: when an inline box is split across line boxes, margins, borders, and padding have no visible effect at the split points. True if this is the first fragment of the inline box.
is_last_fragment: boolTrue if this is the last fragment of the inline box.
is_rtl: boolCSS 2.2 §8.6: direction flag for visual-order rendering in bidi context. LTR: first fragment gets left edge, last gets right edge. RTL: first fragment gets right edge, last gets left edge.
Implementations§
Source§impl InlineBorderInfo
impl InlineBorderInfo
Sourcepub fn has_border(&self) -> bool
pub fn has_border(&self) -> bool
Returns true if any border has a non-zero width
Sourcepub fn has_chrome(&self) -> bool
pub fn has_chrome(&self) -> bool
Returns true if any border or padding is present
Sourcepub fn left_inset(&self) -> f32
pub fn left_inset(&self) -> f32
Total left inset (border + padding), suppressed at split points per §8.6. In LTR: left edge drawn on first fragment. In RTL: left edge drawn on last fragment.
Sourcepub fn right_inset(&self) -> f32
pub fn right_inset(&self) -> f32
Total right inset (border + padding), suppressed at split points per §8.6. In LTR: right edge drawn on last fragment. In RTL: right edge drawn on first fragment.
Sourcepub fn bottom_inset(&self) -> f32
pub fn bottom_inset(&self) -> f32
Total bottom inset (border + padding)
Trait Implementations§
Source§impl Clone for InlineBorderInfo
impl Clone for InlineBorderInfo
Source§fn clone(&self) -> InlineBorderInfo
fn clone(&self) -> InlineBorderInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InlineBorderInfo
impl Debug for InlineBorderInfo
Source§impl Default for InlineBorderInfo
impl Default for InlineBorderInfo
Source§impl PartialEq for InlineBorderInfo
impl PartialEq for InlineBorderInfo
Source§fn eq(&self, other: &InlineBorderInfo) -> bool
fn eq(&self, other: &InlineBorderInfo) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for InlineBorderInfo
Auto Trait Implementations§
impl Freeze for InlineBorderInfo
impl RefUnwindSafe for InlineBorderInfo
impl Send for InlineBorderInfo
impl Sync for InlineBorderInfo
impl Unpin for InlineBorderInfo
impl UnsafeUnpin for InlineBorderInfo
impl UnwindSafe for InlineBorderInfo
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§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