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};
16
17#[dom_struct]
18pub(crate) struct HTMLFrameSetElement {
19 htmlelement: HTMLElement,
20}
21
22impl HTMLFrameSetElement {
23 fn new_inherited(
24 local_name: LocalName,
25 prefix: Option<Prefix>,
26 document: &Document,
27 ) -> HTMLFrameSetElement {
28 HTMLFrameSetElement {
29 htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
30 }
31 }
32
33 pub(crate) fn new(
34 cx: &mut js::context::JSContext,
35 local_name: LocalName,
36 prefix: Option<Prefix>,
37 document: &Document,
38 proto: Option<HandleObject>,
39 ) -> DomRoot<HTMLFrameSetElement> {
40 let n = Node::reflect_node_with_proto(
41 cx,
42 Box::new(HTMLFrameSetElement::new_inherited(
43 local_name, prefix, document,
44 )),
45 document,
46 proto,
47 );
48 n.upcast::<Node>().set_weird_parser_insertion_mode();
49 n
50 }
51}
52
53impl HTMLFrameSetElementMethods<crate::DomTypeHolder> for HTMLFrameSetElement {
54 window_event_handlers!(ForwardToWindow);
56}