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/xmldocument.rs | |
parent | 2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff) | |
download | servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip |
Format script component
Diffstat (limited to 'components/script/dom/xmldocument.rs')
-rw-r--r-- | components/script/dom/xmldocument.rs | 83 |
1 files changed, 46 insertions, 37 deletions
diff --git a/components/script/dom/xmldocument.rs b/components/script/dom/xmldocument.rs index abd5ed64635..9854d503ed4 100644 --- a/components/script/dom/xmldocument.rs +++ b/components/script/dom/xmldocument.rs @@ -28,44 +28,49 @@ pub struct XMLDocument { } impl XMLDocument { - fn new_inherited(window: &Window, - has_browsing_context: HasBrowsingContext, - url: Option<ServoUrl>, - origin: MutableOrigin, - is_html_document: IsHTMLDocument, - content_type: Option<Mime>, - last_modified: Option<String>, - activity: DocumentActivity, - source: DocumentSource, - doc_loader: DocumentLoader) -> XMLDocument { + fn new_inherited( + window: &Window, + has_browsing_context: HasBrowsingContext, + url: Option<ServoUrl>, + origin: MutableOrigin, + is_html_document: IsHTMLDocument, + content_type: Option<Mime>, + last_modified: Option<String>, + activity: DocumentActivity, + source: DocumentSource, + doc_loader: DocumentLoader, + ) -> XMLDocument { XMLDocument { - document: Document::new_inherited(window, - has_browsing_context, - url, - origin, - is_html_document, - content_type, - last_modified, - activity, - source, - doc_loader, - None, - None, - Default::default()), + document: Document::new_inherited( + window, + has_browsing_context, + url, + origin, + is_html_document, + content_type, + last_modified, + activity, + source, + doc_loader, + None, + None, + Default::default(), + ), } } - pub fn new(window: &Window, - has_browsing_context: HasBrowsingContext, - url: Option<ServoUrl>, - origin: MutableOrigin, - doctype: IsHTMLDocument, - content_type: Option<Mime>, - last_modified: Option<String>, - activity: DocumentActivity, - source: DocumentSource, - doc_loader: DocumentLoader) - -> DomRoot<XMLDocument> { + pub fn new( + window: &Window, + has_browsing_context: HasBrowsingContext, + url: Option<ServoUrl>, + origin: MutableOrigin, + doctype: IsHTMLDocument, + content_type: Option<Mime>, + last_modified: Option<String>, + activity: DocumentActivity, + source: DocumentSource, + doc_loader: DocumentLoader, + ) -> DomRoot<XMLDocument> { let doc = reflect_dom_object( Box::new(XMLDocument::new_inherited( window, @@ -77,10 +82,10 @@ impl XMLDocument { last_modified, activity, source, - doc_loader + doc_loader, )), window, - XMLDocumentBinding::Wrap + XMLDocumentBinding::Wrap, ); { let node = doc.upcast::<Node>(); @@ -103,7 +108,11 @@ impl XMLDocumentMethods for XMLDocument { #[allow(unsafe_code)] // https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter - unsafe fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonNull<JSObject>> { + unsafe fn NamedGetter( + &self, + _cx: *mut JSContext, + name: DOMString, + ) -> Option<NonNull<JSObject>> { self.upcast::<Document>().NamedGetter(_cx, name) } } |