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>
impl<R: ResponsivePatches + ?Sized> StyleCascade<'_, R>
Sourcepub fn visit<'s>(
&self,
store: &'s NodeStore,
id: NodeId,
f: impl FnMut(Option<ConditionalTier>, RowPatchView<'s>),
)
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.
Sourcepub fn effective_box(&self, store: &NodeStore, id: NodeId) -> EffectiveBox
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.
Sourcepub fn patched<T: NvTable, V: ScalarField>(
&self,
store: &NodeStore,
id: NodeId,
prop: Prop<T, V>,
) -> Option<V>
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).
Sourcepub fn display(&self, store: &NodeStore, id: NodeId) -> Display
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>
impl<R: ResponsivePatches + ?Sized> Clone for StyleCascade<'_, R>
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.
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.
fn is_display_none(&self, store: &NodeStore, id: NodeId) -> bool
Source§fn is_display_contents(&self, store: &NodeStore, id: NodeId) -> bool
fn is_display_contents(&self, store: &NodeStore, id: NodeId) -> bool
display: contents (non-root).fn visibility(&self, store: &NodeStore, id: NodeId) -> Visibility
Source§fn is_inert(&self, store: &NodeStore, id: NodeId) -> bool
fn is_inert(&self, store: &NodeStore, id: NodeId) -> bool
inert: neither focusable nor
targetable). Oracles without the scene’s overlay resolution answer false.fn is_node_disabled(&self, store: &NodeStore, id: NodeId) -> bool
Source§fn is_subtree_display_none(&self, store: &NodeStore, id: NodeId) -> bool
fn is_subtree_display_none(&self, store: &NodeStore, id: NodeId) -> bool
id or any ancestor is Self::is_display_none.