script/dom/html/
htmlulistelement.rs1use dom_struct::dom_struct;
6use html5ever::{LocalName, Prefix};
7use js::rust::HandleObject;
8
9use crate::dom::bindings::codegen::Bindings::HTMLUListElementBinding::HTMLUListElementMethods;
10use crate::dom::bindings::root::DomRoot;
11use crate::dom::bindings::str::DOMString;
12use crate::dom::document::Document;
13use crate::dom::html::htmlelement::HTMLElement;
14use crate::dom::node::Node;
15use crate::script_runtime::CanGc;
16
17#[dom_struct]
18pub(crate) struct HTMLUListElement {
19 htmlelement: HTMLElement,
20}
21
22impl HTMLUListElement {
23 fn new_inherited(
24 local_name: LocalName,
25 prefix: Option<Prefix>,
26 document: &Document,
27 ) -> HTMLUListElement {
28 HTMLUListElement {
29 htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
30 }
31 }
32
33 #[cfg_attr(crown, allow(crown::unrooted_must_root))]
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<HTMLUListElement> {
41 Node::reflect_node_with_proto(
42 Box::new(HTMLUListElement::new_inherited(
43 local_name, prefix, document,
44 )),
45 document,
46 proto,
47 can_gc,
48 )
49 }
50}
51
52impl HTMLUListElementMethods<crate::DomTypeHolder> for HTMLUListElement {
53 make_bool_getter!(Compact, "compact");
55
56 make_bool_setter!(SetCompact, "compact");
58
59 make_getter!(Type, "type");
61
62 make_setter!(SetType, "type");
64}