script/dom/html/
htmlframesetelement.rs1use dom_struct::dom_struct;
6use html5ever::{LocalName, Prefix};
7use js::rust::HandleObject;
8
9use crate::dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding::HTMLFrameSetElementMethods;
10use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
11use crate::dom::bindings::inheritance::Castable;
12use crate::dom::bindings::root::DomRoot;
13use crate::dom::document::Document;
14use crate::dom::html::htmlelement::HTMLElement;
15use crate::dom::node::{Node, NodeTraits};
16use crate::script_runtime::CanGc;
17
18#[dom_struct]
19pub(crate) struct HTMLFrameSetElement {
20 htmlelement: HTMLElement,
21}
22
23impl HTMLFrameSetElement {
24 fn new_inherited(
25 local_name: LocalName,
26 prefix: Option<Prefix>,
27 document: &Document,
28 ) -> HTMLFrameSetElement {
29 HTMLFrameSetElement {
30 htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
31 }
32 }
33
34 pub(crate) fn new(
35 local_name: LocalName,
36 prefix: Option<Prefix>,
37 document: &Document,
38 proto: Option<HandleObject>,
39 can_gc: CanGc,
40 ) -> DomRoot<HTMLFrameSetElement> {
41 let n = Node::reflect_node_with_proto(
42 Box::new(HTMLFrameSetElement::new_inherited(
43 local_name, prefix, document,
44 )),
45 document,
46 proto,
47 can_gc,
48 );
49 n.upcast::<Node>().set_weird_parser_insertion_mode();
50 n
51 }
52}
53
54impl HTMLFrameSetElementMethods<crate::DomTypeHolder> for HTMLFrameSetElement {
55 window_event_handlers!(ForwardToWindow);
57}