#[repr(C)]pub struct SizeQuery {
pub axis: SizeQueryAxis,
pub op: SizeQueryOp,
pub threshold_px: f32,
pub answer: bool,
}Expand description
One recorded window-size query made by a layout() callback.
See LayoutCallbackInfo::window_width_less_than & co. The engine replays
these against a
prospective new size to decide whether a resize could change the DOM at
all: if no recorded answer flips (and no CSS breakpoint is crossed), the
callback is provably size-stable across that resize and is not re-invoked.
Fields§
§axis: SizeQueryAxis§op: SizeQueryOp§threshold_px: f32§answer: boolThe answer given at recording time, evaluated against the size the callback actually saw.
Implementations§
Source§impl SizeQuery
impl SizeQuery
Sourcepub fn answer_at(&self, size: LogicalSize) -> bool
pub fn answer_at(&self, size: LogicalSize) -> bool
What this query would answer at size — compare with Self::answer
to detect a flip. MUST mirror the operators of the recording methods
exactly (see SizeQueryOp), or the engine would skip a layout()
re-invocation right at the boundary the app asked about.
Sourcepub fn flips_at(&self, size: LogicalSize) -> bool
pub fn flips_at(&self, size: LogicalSize) -> bool
Would this query’s answer differ at size from the recorded one?