Skip to main content

StyleCascade

Struct StyleCascade 

Source
pub struct StyleCascade<'a, R: ResponsivePatches + ?Sized = dyn ResponsivePatches> {
    pub responsive: &'a R,
    pub interaction: Option<&'a InteractionTracker>,
    pub inert: Option<&'a OverlayState>,
}
Expand description

base -> @media -> @container -> state for one scene. Copy, zero allocations; generic over the responsive source so scenes dispatch statically (dyn only where a source is erased).

Fields§

§responsive: &'a R§interaction: Option<&'a InteractionTracker>

Live pseudo-state; None resolves without state rules.

§inert: Option<&'a OverlayState>

The scene’s overlay resolution, for modal inertness (SemanticStyleOracle::is_inert); None (layout-internal cascades) treats nothing as inert.

Implementations§

Source§

impl<R: ResponsivePatches + ?Sized> StyleCascade<'_, R>

Source

pub fn visit<'s>( &self, store: &'s NodeStore, id: NodeId, f: impl FnMut(Option<ConditionalTier>, RowPatchView<'s>), )

Visits every patch overriding id’s base rows in cascade order; tier is None for state rules.

Source

pub fn effective_box(&self, store: &NodeStore, id: NodeId) -> EffectiveBox

id’s effective box: hidden input / closed overlay / failing show_on -> none; base row; @media / @container patches (under the contents rule of cascade_display); active state-rule patches. The one definition layout (Taffy, Yoga), top-layer hoisting, paint, stacking, hit-testing, semantics, focus and accessibility share.

Source

pub fn patched<T: NvTable, V: ScalarField>( &self, store: &NodeStore, id: NodeId, prop: Prop<T, V>, ) -> Option<V>

The last cascaded override of prop on id (None = the base row value stands).

Source

pub fn display(&self, store: &NodeStore, id: NodeId) -> Display

id’s effective display, the one definition layout, top-layer hoisting, paint, stacking, hit-testing and accessibility share: hidden input / closed overlay / failing show_on -> none; base row; @media / @container patches (under the contents rule of cascade_display); active state-rule patches.

Trait Implementations§

Source§

impl<R: ResponsivePatches + ?Sized> Clone for StyleCascade<'_, R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: ResponsivePatches + ?Sized> Copy for StyleCascade<'_, R>

Source§

impl<R: ResponsivePatches + ?Sized> SemanticStyleOracle for StyleCascade<'_, R>

The cascade as the display half of a SemanticStyleOracle: focus management, semantic queries and the shared top-layer predicate resolve exactly what layout and paint resolve.

Source§

fn is_display_none(&self, store: &NodeStore, id: NodeId) -> bool

Source§

fn is_display_contents(&self, store: &NodeStore, id: NodeId) -> bool

Effectively display: contents (non-root).
Source§

fn visibility(&self, store: &NodeStore, id: NodeId) -> Visibility

Source§

fn is_inert(&self, store: &NodeStore, id: NodeId) -> bool

Inert under the topmost modal (HTML modal-dialog inert: neither focusable nor targetable). Oracles without the scene’s overlay resolution answer false.
Source§

fn is_node_disabled(&self, store: &NodeStore, id: NodeId) -> bool

Source§

fn is_subtree_display_none(&self, store: &NodeStore, id: NodeId) -> bool

Whether id or any ancestor is Self::is_display_none.

Auto Trait Implementations§

§

impl<'a, R> Forget for StyleCascade<'a, R>
where R: ?Sized,

§

impl<'a, R> Freeze for StyleCascade<'a, R>

§

impl<'a, R> Move for StyleCascade<'a, R>
where R: ?Sized,

§

impl<'a, R> RefUnwindSafe for StyleCascade<'a, R>
where R: RefUnwindSafe + ?Sized,

§

impl<'a, R> Send for StyleCascade<'a, R>

§

impl<'a, R> Sync for StyleCascade<'a, R>
where R: Sync + ?Sized, RawVecInner: Sync, RawTable<(NodeId, ())>: Sync, RawTable<(u64, NodeId)>: Sync,

§

impl<'a, R> Unpin for StyleCascade<'a, R>

§

impl<'a, R> UnsafeUnpin for StyleCascade<'a, R>

§

impl<'a, R> UnwindSafe for StyleCascade<'a, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.