pub struct GenericAnchorFunctionFallback<L> {
pub node: GenericCalcNode<L>,
/* private fields */
}Expand description
Fallback type for anchor functions within calc().
Ideally, the fallback type is initial type of the property (e.g.
GenericInset for left), but that causes circular reference.
TODO(dshin, bug 2034100): Investigate ways to not require this.
This handles the parsing of unitless zeros, as well as ensuring
that e.g. calc(anchor(--foo left, 1px) + 10%) round trips
(sorting aside), instead of becoming
calc(anchor(--foo left, calc(1px)) + 10%).
Fields§
§node: GenericCalcNode<L>The parsed fallback value. Stored as a calc node to break the circular reference.
Implementations§
Source§impl<L> GenericAnchorFunctionFallback<L>
impl<L> GenericAnchorFunctionFallback<L>
Sourcepub fn new(is_calc_node: bool, node: GenericCalcNode<L>) -> Self
pub fn new(is_calc_node: bool, node: GenericCalcNode<L>) -> Self
Create a new anchor function fallback value.
Trait Implementations§
Source§impl<L: Clone> Clone for GenericAnchorFunctionFallback<L>
impl<L: Clone> Clone for GenericAnchorFunctionFallback<L>
Source§fn clone(&self) -> GenericAnchorFunctionFallback<L>
fn clone(&self) -> GenericAnchorFunctionFallback<L>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<L: Debug> Debug for GenericAnchorFunctionFallback<L>
impl<L: Debug> Debug for GenericAnchorFunctionFallback<L>
Source§impl<'de, L> Deserialize<'de> for GenericAnchorFunctionFallback<L>where
L: Deserialize<'de>,
impl<'de, L> Deserialize<'de> for GenericAnchorFunctionFallback<L>where
L: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<L> MallocSizeOf for GenericAnchorFunctionFallback<L>where
L: MallocSizeOf,
impl<L> MallocSizeOf for GenericAnchorFunctionFallback<L>where
L: MallocSizeOf,
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<L: PartialEq> PartialEq for GenericAnchorFunctionFallback<L>
impl<L: PartialEq> PartialEq for GenericAnchorFunctionFallback<L>
Source§fn eq(&self, other: &GenericAnchorFunctionFallback<L>) -> bool
fn eq(&self, other: &GenericAnchorFunctionFallback<L>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<L> Serialize for GenericAnchorFunctionFallback<L>where
L: Serialize,
impl<L> Serialize for GenericAnchorFunctionFallback<L>where
L: Serialize,
Source§impl<L> ToAnimatedZero for GenericAnchorFunctionFallback<L>where
L: ToAnimatedZero,
impl<L> ToAnimatedZero for GenericAnchorFunctionFallback<L>where
L: ToAnimatedZero,
Source§fn to_animated_zero(&self) -> Result<Self, ()>
fn to_animated_zero(&self) -> Result<Self, ()>
Returns a value that, when added with an underlying value, will produce the underlying
value. This is used for SMIL animation’s “by-animation” where SMIL first interpolates from
the zero value to the ‘by’ value, and then adds the result to the underlying value. Read more
Source§impl<L: CalcNodeLeaf> ToCss for GenericAnchorFunctionFallback<L>
impl<L: CalcNodeLeaf> ToCss for GenericAnchorFunctionFallback<L>
Source§fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
Serialize
self in CSS syntax, writing to dest.Source§fn to_css_string(&self) -> String
fn to_css_string(&self) -> String
Serialize
self in CSS syntax and return a string. Read moreSource§fn to_css_cssstring(&self) -> String
fn to_css_cssstring(&self) -> String
Serialize
self in CSS syntax and return a CssString. Read moreSource§impl<L> ToResolvedValue for GenericAnchorFunctionFallback<L>where
L: ToResolvedValue,
impl<L> ToResolvedValue for GenericAnchorFunctionFallback<L>where
L: ToResolvedValue,
Source§type ResolvedValue = GenericAnchorFunctionFallback<<L as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericAnchorFunctionFallback<<L as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.
Source§impl<L> ToShmem for GenericAnchorFunctionFallback<L>where
L: ToShmem,
impl<L> ToShmem for GenericAnchorFunctionFallback<L>where
L: ToShmem,
impl<L> StructuralPartialEq for GenericAnchorFunctionFallback<L>
Auto Trait Implementations§
impl<L> Freeze for GenericAnchorFunctionFallback<L>where
L: Freeze,
impl<L> RefUnwindSafe for GenericAnchorFunctionFallback<L>where
L: RefUnwindSafe,
impl<L> Send for GenericAnchorFunctionFallback<L>where
L: Send,
impl<L> Sync for GenericAnchorFunctionFallback<L>where
L: Sync,
impl<L> Unpin for GenericAnchorFunctionFallback<L>where
L: Unpin,
impl<L> UnsafeUnpin for GenericAnchorFunctionFallback<L>where
L: UnsafeUnpin,
impl<L> UnwindSafe for GenericAnchorFunctionFallback<L>where
L: UnwindSafe + RefUnwindSafe,
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