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