Format script component

This commit is contained in:
chansuke 2018-09-18 23:24:15 +09:00 committed by Josh Matthews
parent 2ca7a13473
commit c37a345dc9
357 changed files with 25485 additions and 18076 deletions

View file

@ -14,30 +14,37 @@ use html5ever::{LocalName, Prefix};
#[dom_struct]
pub struct HTMLMapElement {
htmlelement: HTMLElement
htmlelement: HTMLElement,
}
impl HTMLMapElement {
fn new_inherited(local_name: LocalName,
prefix: Option<Prefix>,
document: &Document) -> HTMLMapElement {
fn new_inherited(
local_name: LocalName,
prefix: Option<Prefix>,
document: &Document,
) -> HTMLMapElement {
HTMLMapElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
}
}
#[allow(unrooted_must_root)]
pub fn new(local_name: LocalName,
prefix: Option<Prefix>,
document: &Document) -> DomRoot<HTMLMapElement> {
Node::reflect_node(Box::new(HTMLMapElement::new_inherited(local_name, prefix, document)),
document,
HTMLMapElementBinding::Wrap)
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
document: &Document,
) -> DomRoot<HTMLMapElement> {
Node::reflect_node(
Box::new(HTMLMapElement::new_inherited(local_name, prefix, document)),
document,
HTMLMapElementBinding::Wrap,
)
}
pub fn get_area_elements(&self) -> Vec<DomRoot<HTMLAreaElement>> {
self.upcast::<Node>()
.traverse_preorder()
.filter_map(DomRoot::downcast::<HTMLAreaElement>).collect()
.filter_map(DomRoot::downcast::<HTMLAreaElement>)
.collect()
}
}