Skip to main content

IntersectionObserverMethods

pub trait IntersectionObserverMethods<D: DomTypes> {
    // Required methods
    fn GetRoot(&self) -> Option<ElementOrDocument<D>>;
    fn RootMargin(&self) -> DOMString;
    fn ScrollMargin(&self) -> DOMString;
    fn Thresholds(&self, cx: &mut JSContext, retval: MutableHandle<'_, Value>);
    fn Delay(&self) -> i32;
    fn TrackVisibility(&self) -> bool;
    fn Observe(&self, cx: &NoGC, target: &D::Element);
    fn Unobserve(&self, cx: &NoGC, target: &D::Element);
    fn Disconnect(&self, cx: &NoGC);
    fn TakeRecords(&self) -> Vec<DomRoot<D::IntersectionObserverEntry>> ;
    fn Constructor(
        cx: &mut JSContext,
        global: &D::Window,
        proto: Option<HandleObject<'_>>,
        callback: Rc<IntersectionObserverCallback<D>>,
        options: &IntersectionObserverInit<D>,
    ) -> Fallible<DomRoot<D::IntersectionObserver>>;
}

Required Methods§

Source

fn GetRoot(&self) -> Option<ElementOrDocument<D>>

Source

fn RootMargin(&self) -> DOMString

Source

fn ScrollMargin(&self) -> DOMString

Source

fn Thresholds(&self, cx: &mut JSContext, retval: MutableHandle<'_, Value>)

Source

fn Delay(&self) -> i32

Source

fn TrackVisibility(&self) -> bool

Source

fn Observe(&self, cx: &NoGC, target: &D::Element)

Source

fn Unobserve(&self, cx: &NoGC, target: &D::Element)

Source

fn Disconnect(&self, cx: &NoGC)

Source

fn TakeRecords(&self) -> Vec<DomRoot<D::IntersectionObserverEntry>>

Source

fn Constructor( cx: &mut JSContext, global: &D::Window, proto: Option<HandleObject<'_>>, callback: Rc<IntersectionObserverCallback<D>>, options: &IntersectionObserverInit<D>, ) -> Fallible<DomRoot<D::IntersectionObserver>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§