script/dom/html/
htmlmarqueeelement.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 HTMLMarqueeElement {
17    htmlelement: HTMLElement,
18}
19
20impl HTMLMarqueeElement {
21    fn new_inherited(local_name: LocalName, prefix: Option<Prefix>, document: &Document) -> Self {
22        Self {
23            htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
24        }
25    }
26
27    pub(crate) fn new(
28        local_name: LocalName,
29        prefix: Option<Prefix>,
30        document: &Document,
31        proto: Option<HandleObject>,
32        can_gc: CanGc,
33    ) -> DomRoot<Self> {
34        Node::reflect_node_with_proto(
35            Box::new(Self::new_inherited(local_name, prefix, document)),
36            document,
37            proto,
38            can_gc,
39        )
40    }
41}