diff options
author | chansuke <chansuke@georepublic.de> | 2018-09-18 23:24:15 +0900 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2018-09-19 17:40:47 -0400 |
commit | c37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch) | |
tree | 1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/htmldialogelement.rs | |
parent | 2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff) | |
download | servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip |
Format script component
Diffstat (limited to 'components/script/dom/htmldialogelement.rs')
-rw-r--r-- | components/script/dom/htmldialogelement.rs | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs index 9762a6c3c97..97643bf691f 100644 --- a/components/script/dom/htmldialogelement.rs +++ b/components/script/dom/htmldialogelement.rs @@ -23,23 +23,30 @@ pub struct HTMLDialogElement { } impl HTMLDialogElement { - fn new_inherited(local_name: LocalName, - prefix: Option<Prefix>, - document: &Document) -> HTMLDialogElement { + fn new_inherited( + local_name: LocalName, + prefix: Option<Prefix>, + document: &Document, + ) -> HTMLDialogElement { HTMLDialogElement { - htmlelement: - HTMLElement::new_inherited(local_name, prefix, document), + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), return_value: DomRefCell::new(DOMString::new()), } } #[allow(unrooted_must_root)] - pub fn new(local_name: LocalName, - prefix: Option<Prefix>, - document: &Document) -> DomRoot<HTMLDialogElement> { - Node::reflect_node(Box::new(HTMLDialogElement::new_inherited(local_name, prefix, document)), - document, - HTMLDialogElementBinding::Wrap) + pub fn new( + local_name: LocalName, + prefix: Option<Prefix>, + document: &Document, + ) -> DomRoot<HTMLDialogElement> { + Node::reflect_node( + Box::new(HTMLDialogElement::new_inherited( + local_name, prefix, document, + )), + document, + HTMLDialogElementBinding::Wrap, + ) } } @@ -68,7 +75,10 @@ impl HTMLDialogElementMethods for HTMLDialogElement { let win = window_from_node(self); // Step 1 & 2 - if element.remove_attribute(&ns!(), &local_name!("open")).is_none() { + if element + .remove_attribute(&ns!(), &local_name!("open")) + .is_none() + { return; } @@ -80,6 +90,7 @@ impl HTMLDialogElementMethods for HTMLDialogElement { // TODO: Step 4 implement pending dialog stack removal // Step 5 - win.dom_manipulation_task_source().queue_simple_event(target, atom!("close"), &win); + win.dom_manipulation_task_source() + .queue_simple_event(target, atom!("close"), &win); } } |