struct IntersectionObservationOutput {
pub(crate) threshold_index: i32,
pub(crate) is_intersecting: bool,
pub(crate) target_rect: Rect<Au>,
pub(crate) intersection_rect: Rect<Au>,
pub(crate) intersection_ratio: f64,
pub(crate) is_visible: bool,
pub(crate) root_bounds: Rect<Au>,
}
Expand description
The values from computing step 2.2.4-2.2.14 in
https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo.
See IntersectionObserver::maybe_compute_intersection_output
.
Fields§
§threshold_index: i32
§is_intersecting: bool
§target_rect: Rect<Au>
§intersection_rect: Rect<Au>
§intersection_ratio: f64
§is_visible: bool
§root_bounds: Rect<Au>
The root intersection rectangle IntersectionObserver::root_intersection_rectangle
.
If the processing is skipped, computation should report the default zero value.
Implementations§
Source§impl IntersectionObservationOutput
impl IntersectionObservationOutput
Sourcefn default_skipped() -> Self
fn default_skipped() -> Self
Default values according to https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo. Step 4.
Let:
- thresholdIndex be 0.
- isIntersecting be false.
- targetRect be a DOMRectReadOnly with x, y, width, and height set to 0.
- intersectionRect be a DOMRectReadOnly with x, y, width, and height set to 0.
For fields that the default values is not directly mentioned, the values conformant to current browser implementation or WPT test is used instead.
fn new_computed( threshold_index: i32, is_intersecting: bool, target_rect: Rect<Au>, intersection_rect: Rect<Au>, intersection_ratio: f64, is_visible: bool, root_bounds: Rect<Au>, ) -> Self
Auto Trait Implementations§
impl Freeze for IntersectionObservationOutput
impl RefUnwindSafe for IntersectionObservationOutput
impl Send for IntersectionObservationOutput
impl Sync for IntersectionObservationOutput
impl Unpin for IntersectionObservationOutput
impl UnwindSafe for IntersectionObservationOutput
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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