script::dom::event

Struct Event

Source
#[repr(C)]
pub(crate) struct Event {
Show 18 fields reflector_: Reflector, current_target: MutNullableDom<EventTarget>, target: MutNullableDom<EventTarget>, type_: DomRefCell<Atom>, phase: Cell<EventPhase>, canceled: Cell<EventDefault>, stop_propagation: Cell<bool>, stop_immediate_propagation: Cell<bool>, cancelable: Cell<bool>, bubbles: Cell<bool>, composed: Cell<bool>, is_trusted: Cell<bool>, dispatch: Cell<bool>, initialized: Cell<bool>, time_stamp: CrossProcessInstant, path: DomRefCell<Vec<EventPathSegment>>, related_target: MutNullableDom<EventTarget>, in_passive_listener: Cell<bool>,
}
Expand description

Fields§

§reflector_: Reflector§current_target: MutNullableDom<EventTarget>§target: MutNullableDom<EventTarget>§type_: DomRefCell<Atom>§phase: Cell<EventPhase>§canceled: Cell<EventDefault>§stop_propagation: Cell<bool>§stop_immediate_propagation: Cell<bool>§cancelable: Cell<bool>§bubbles: Cell<bool>§composed: Cell<bool>§is_trusted: Cell<bool>§dispatch: Cell<bool>§initialized: Cell<bool>§time_stamp: CrossProcessInstant§path: DomRefCell<Vec<EventPathSegment>>§related_target: MutNullableDom<EventTarget>§in_passive_listener: Cell<bool>

Implementations§

Source§

impl Event

§

impl Event

pub(crate) fn type_id(&self) -> &'static EventTypeId

Source§

impl Event

Source

pub(crate) fn new_inherited() -> Event

Source

pub(crate) fn new_uninitialized( global: &GlobalScope, can_gc: CanGc, ) -> DomRoot<Event>

Source

pub(crate) fn new_uninitialized_with_proto( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> DomRoot<Event>

Source

pub(crate) fn new( global: &GlobalScope, type_: Atom, bubbles: EventBubbles, cancelable: EventCancelable, can_gc: CanGc, ) -> DomRoot<Event>

Source

fn new_with_proto( global: &GlobalScope, proto: Option<HandleObject<'_>>, type_: Atom, bubbles: EventBubbles, cancelable: EventCancelable, can_gc: CanGc, ) -> DomRoot<Event>

Source

pub(crate) fn init_event(&self, type_: Atom, bubbles: bool, cancelable: bool)

Source

pub(crate) fn set_target(&self, target_: Option<&EventTarget>)

Source

pub(crate) fn set_in_passive_listener(&self, value: bool)

Source

pub(crate) fn append_to_path( &self, invocation_target: &EventTarget, shadow_adjusted_target: Option<&EventTarget>, related_target: Option<&EventTarget>, slot_in_closed_tree: bool, )

Source

pub(crate) fn dispatch( &self, target: &EventTarget, legacy_target_override: bool, can_gc: CanGc, ) -> EventStatus

Source

pub(crate) fn status(&self) -> EventStatus

Source

pub(crate) fn dispatching(&self) -> bool

Source

pub(crate) fn initialized(&self) -> bool

Source

pub(crate) fn type_(&self) -> Atom

Source

pub(crate) fn mark_as_handled(&self)

Source

pub(crate) fn get_cancel_state(&self) -> EventDefault

Source

pub(crate) fn set_trusted(&self, trusted: bool)

Source

pub(crate) fn set_composed(&self, composed: bool)

Source

pub(crate) fn fire(&self, target: &EventTarget, can_gc: CanGc) -> EventStatus

Source

fn inner_creation_steps( global: &GlobalScope, proto: Option<HandleObject<'_>>, init: &EventInit, can_gc: CanGc, ) -> DomRoot<Event>

Source

pub(crate) fn should_pass_shadow_boundary( &self, shadow_root: &ShadowRoot, ) -> bool

Implements the logic behind the get the parent algorithm for shadow roots.

Source

fn set_the_cancelled_flag(&self)

Trait Implementations§

§

impl Castable for Event

Source§

fn is<T>(&self) -> bool
where T: DerivedFrom<Self>,

Check whether a DOM object implements one of its deriving interfaces.
Source§

fn upcast<T>(&self) -> &T
where T: Castable, Self: DerivedFrom<T>,

Cast a DOM object upwards to one of the interfaces it derives from.
Source§

fn downcast<T>(&self) -> Option<&T>
where T: DerivedFrom<Self>,

Cast a DOM object downwards to one of the interfaces it might implement.
Source§

impl DomObject for Event

Source§

fn reflector(&self) -> &Reflector

Returns the receiver’s reflector.
Source§

impl DomObjectWrap<DomTypeHolder> for Event

Source§

const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::GenericBindings::EventBinding::Event_Binding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::event::Event>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::event::Event>>}

Function pointer to the general wrap function type
Source§

impl EventMethods<DomTypeHolder> for Event

Source§

fn Constructor( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, type_: DOMString, init: &EventInit, ) -> Fallible<DomRoot<Event>>

Source§

fn EventPhase(&self) -> u16

Source§

fn Type(&self) -> DOMString

Source§

fn GetTarget(&self) -> Option<DomRoot<EventTarget>>

Source§

fn GetSrcElement(&self) -> Option<DomRoot<EventTarget>>

Source§

fn GetCurrentTarget(&self) -> Option<DomRoot<EventTarget>>

Source§

fn ComposedPath(&self) -> Vec<DomRoot<EventTarget>>

Source§

fn DefaultPrevented(&self) -> bool

Source§

fn Composed(&self) -> bool

Source§

fn PreventDefault(&self)

Source§

fn StopPropagation(&self)

Source§

fn StopImmediatePropagation(&self)

Source§

fn Bubbles(&self) -> bool

Source§

fn Cancelable(&self) -> bool

Source§

fn ReturnValue(&self) -> bool

Source§

fn SetReturnValue(&self, val: bool)

Source§

fn CancelBubble(&self) -> bool

Source§

fn SetCancelBubble(&self, value: bool)

Source§

fn TimeStamp(&self) -> Finite<f64>

Source§

fn InitEvent(&self, type_: DOMString, bubbles: bool, cancelable: bool)

Source§

fn IsTrusted(&self) -> bool

Source§

impl HasParent for Event

Source§

fn as_parent(&self) -> &Reflector

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

Source§

type Parent = Reflector

Source§

impl IDLInterface for Event

Source§

fn derives(class: &'static DOMClass) -> bool

Returns whether the given DOM class derives that interface.
Source§

impl MallocSizeOf for Event

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl MutDomObject for Event

Source§

unsafe fn init_reflector(&self, obj: *mut JSObject)

Initializes the Reflector Read more
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToJSValConvertible for Event

Source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
Source§

impl Traceable for Event

Source§

unsafe fn trace(&self, tracer: *mut JSTracer)

Trace self.
§

impl DerivedFrom<Event> for AnimationEvent

§

impl DerivedFrom<Event> for BeforeUnloadEvent

§

impl DerivedFrom<Event> for BluetoothAdvertisingEvent

§

impl DerivedFrom<Event> for ClipboardEvent

§

impl DerivedFrom<Event> for CloseEvent

§

impl DerivedFrom<Event> for CompositionEvent

§

impl DerivedFrom<Event> for CustomEvent

§

impl DerivedFrom<Event> for ErrorEvent

§

impl DerivedFrom<Event> for Event

§

impl DerivedFrom<Event> for ExtendableEvent

§

impl DerivedFrom<Event> for ExtendableMessageEvent

§

impl DerivedFrom<Event> for FocusEvent

§

impl DerivedFrom<Event> for FormDataEvent

§

impl DerivedFrom<Event> for GPUUncapturedErrorEvent

§

impl DerivedFrom<Event> for GamepadEvent

§

impl DerivedFrom<Event> for HashChangeEvent

§

impl DerivedFrom<Event> for InputEvent

§

impl DerivedFrom<Event> for KeyboardEvent

§

impl DerivedFrom<Event> for MediaQueryListEvent

§

impl DerivedFrom<Event> for MessageEvent

§

impl DerivedFrom<Event> for MouseEvent

§

impl DerivedFrom<Event> for OfflineAudioCompletionEvent

§

impl DerivedFrom<Event> for PageTransitionEvent

§

impl DerivedFrom<Event> for PointerEvent

§

impl DerivedFrom<Event> for PopStateEvent

§

impl DerivedFrom<Event> for ProgressEvent

§

impl DerivedFrom<Event> for PromiseRejectionEvent

§

impl DerivedFrom<Event> for RTCDataChannelEvent

§

impl DerivedFrom<Event> for RTCErrorEvent

§

impl DerivedFrom<Event> for RTCPeerConnectionIceEvent

§

impl DerivedFrom<Event> for RTCTrackEvent

§

impl DerivedFrom<Event> for SecurityPolicyViolationEvent

§

impl DerivedFrom<Event> for StorageEvent

§

impl DerivedFrom<Event> for SubmitEvent

§

impl DerivedFrom<Event> for TouchEvent

§

impl DerivedFrom<Event> for TrackEvent

§

impl DerivedFrom<Event> for TransitionEvent

§

impl DerivedFrom<Event> for UIEvent

§

impl DerivedFrom<Event> for WebGLContextEvent

§

impl DerivedFrom<Event> for WheelEvent

§

impl DerivedFrom<Event> for XRInputSourceEvent

§

impl DerivedFrom<Event> for XRInputSourcesChangeEvent

§

impl DerivedFrom<Event> for XRLayerEvent

§

impl DerivedFrom<Event> for XRReferenceSpaceEvent

§

impl DerivedFrom<Event> for XRSessionEvent

Source§

impl Eq for Event

Auto Trait Implementations§

§

impl !Freeze for Event

§

impl !RefUnwindSafe for Event

§

impl !Send for Event

§

impl !Sync for Event

§

impl Unpin for Event

§

impl !UnwindSafe for Event

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> Filterable for T

Source§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ThisReflector for T
where T: DomObject,

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T