Skip to main content

script/dom/svg/
svgtextpositioningelement.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};
7
8use crate::dom::bindings::inheritance::Castable;
9use crate::dom::document::Document;
10use crate::dom::node::virtualmethods::VirtualMethods;
11use crate::dom::svg::svgtextcontentelement::SVGTextContentElement;
12
13#[dom_struct]
14pub(crate) struct SVGTextPositioningElement {
15    svgtextcontentelement: SVGTextContentElement,
16}
17
18impl SVGTextPositioningElement {
19    pub(crate) fn new_inherited(
20        tag_name: LocalName,
21        prefix: Option<Prefix>,
22        document: &Document,
23    ) -> SVGTextPositioningElement {
24        SVGTextPositioningElement {
25            svgtextcontentelement: SVGTextContentElement::new_inherited(tag_name, prefix, document),
26        }
27    }
28}
29
30impl VirtualMethods for SVGTextPositioningElement {
31    fn super_type(&self) -> Option<&dyn VirtualMethods> {
32        Some(self.upcast::<SVGTextContentElement>() as &dyn VirtualMethods)
33    }
34}