script/dom/html/
htmlparamelement.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use dom_struct::dom_struct;
6use html5ever::{LocalName, Prefix};
7use js::rust::HandleObject;
8
9use crate::dom::bindings::root::DomRoot;
10use crate::dom::document::Document;
11use crate::dom::html::htmlelement::HTMLElement;
12use crate::dom::node::Node;
13use crate::script_runtime::CanGc;
14
15#[dom_struct]
16pub(crate) struct HTMLParamElement {
17    htmlelement: HTMLElement,
18}
19
20impl HTMLParamElement {
21    fn new_inherited(
22        local_name: LocalName,
23        prefix: Option<Prefix>,
24        document: &Document,
25    ) -> HTMLParamElement {
26        HTMLParamElement {
27            htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
28        }
29    }
30
31    pub(crate) fn new(
32        local_name: LocalName,
33        prefix: Option<Prefix>,
34        document: &Document,
35        proto: Option<HandleObject>,
36        can_gc: CanGc,
37    ) -> DomRoot<HTMLParamElement> {
38        Node::reflect_node_with_proto(
39            Box::new(HTMLParamElement::new_inherited(
40                local_name, prefix, document,
41            )),
42            document,
43            proto,
44            can_gc,
45        )
46    }
47}