script/dom/debugger/
debuggerinterruptevent.rs1use std::fmt::Debug;
6
7use dom_struct::dom_struct;
8use js::context::JSContext;
9use script_bindings::reflector::reflect_dom_object_with_cx;
10
11use crate::dom::bindings::codegen::Bindings::DebuggerInterruptEventBinding::DebuggerInterruptEventMethods;
12use crate::dom::bindings::codegen::Bindings::EventBinding::Event_Binding::EventMethods;
13use crate::dom::bindings::root::DomRoot;
14use crate::dom::event::Event;
15use crate::dom::types::GlobalScope;
16
17#[dom_struct]
18pub(crate) struct DebuggerInterruptEvent {
20 event: Event,
21}
22
23impl DebuggerInterruptEvent {
24 pub(crate) fn new(cx: &mut JSContext, debugger_global: &GlobalScope) -> DomRoot<Self> {
25 let result = Box::new(Self {
26 event: Event::new_inherited(),
27 });
28 let result = reflect_dom_object_with_cx(result, debugger_global, cx);
29 result.event.init_event("interrupt".into(), false, false);
30
31 result
32 }
33}
34
35impl DebuggerInterruptEventMethods<crate::DomTypeHolder> for DebuggerInterruptEvent {
36 fn IsTrusted(&self) -> bool {
38 self.event.IsTrusted()
39 }
40}
41
42impl Debug for DebuggerInterruptEvent {
43 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
44 f.debug_struct("DebuggerInterruptEvent").finish()
45 }
46}