pub struct StyleAdjuster<'a, 'b: 'a> { /* private fields */ }Expand description
A struct that implements all the adjustment methods.
NOTE(emilio): If new adjustments are introduced that depend on reset
properties of the parent, you may need tweaking the
ChildCascadeRequirement code in matching.rs.
NOTE(emilio): Also, if new adjustments are introduced that break the following invariant:
Given same tag name, namespace, rules and parent style, two elements would end up with exactly the same style.
Then you need to adjust the lookup_by_rules conditions in the sharing cache.
Implementations§
Source§impl<'a, 'b: 'a> StyleAdjuster<'a, 'b>
impl<'a, 'b: 'a> StyleAdjuster<'a, 'b>
Sourcepub fn new(style: &'a mut StyleBuilder<'b>) -> Self
pub fn new(style: &'a mut StyleBuilder<'b>) -> Self
Trivially constructs a new StyleAdjuster.
Sourcepub fn adjust<E>(
&mut self,
layout_parent_style: &ComputedValues,
element: Option<E>,
try_tactic: &PositionTryFallbacksTryTactic,
)where
E: TElement,
pub fn adjust<E>(
&mut self,
layout_parent_style: &ComputedValues,
element: Option<E>,
try_tactic: &PositionTryFallbacksTryTactic,
)where
E: TElement,
Adjusts the style to account for various fixups that don’t fit naturally into the cascade.
Auto Trait Implementations§
impl<'a, 'b> Freeze for StyleAdjuster<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for StyleAdjuster<'a, 'b>
impl<'a, 'b> Send for StyleAdjuster<'a, 'b>
impl<'a, 'b> !Sync for StyleAdjuster<'a, 'b>
impl<'a, 'b> Unpin for StyleAdjuster<'a, 'b>
impl<'a, 'b> UnsafeUnpin for StyleAdjuster<'a, 'b>
impl<'a, 'b> !UnwindSafe for StyleAdjuster<'a, 'b>
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> 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