mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Rustfmt some of script.
This commit is contained in:
parent
ceb72e54e4
commit
0c61be7a57
50 changed files with 1499 additions and 885 deletions
|
@ -22,7 +22,7 @@ use util::str::DOMString;
|
|||
#[dom_struct]
|
||||
pub struct DOMParser {
|
||||
reflector_: Reflector,
|
||||
window: JS<Window>, //XXXjdm Document instead?
|
||||
window: JS<Window>, // XXXjdm Document instead?
|
||||
}
|
||||
|
||||
impl DOMParser {
|
||||
|
@ -34,7 +34,8 @@ impl DOMParser {
|
|||
}
|
||||
|
||||
pub fn new(window: &Window) -> Root<DOMParser> {
|
||||
reflect_dom_object(box DOMParser::new_inherited(window), GlobalRef::Window(window),
|
||||
reflect_dom_object(box DOMParser::new_inherited(window),
|
||||
GlobalRef::Window(window),
|
||||
DOMParserBinding::Wrap)
|
||||
}
|
||||
|
||||
|
@ -50,13 +51,15 @@ impl DOMParserMethods for DOMParser {
|
|||
ty: DOMParserBinding::SupportedType)
|
||||
-> Fallible<Root<Document>> {
|
||||
let url = self.window.get_url();
|
||||
let content_type = DOMString::from(DOMParserBinding::SupportedTypeValues::strings[ty as usize]);
|
||||
let content_type =
|
||||
DOMString::from(DOMParserBinding::SupportedTypeValues::strings[ty as usize]);
|
||||
let doc = self.window.Document();
|
||||
let doc = doc.r();
|
||||
let loader = DocumentLoader::new(&*doc.loader());
|
||||
match ty {
|
||||
Text_html => {
|
||||
let document = Document::new(&self.window, Some(url.clone()),
|
||||
let document = Document::new(&self.window,
|
||||
Some(url.clone()),
|
||||
IsHTMLDocument::HTMLDocument,
|
||||
Some(content_type),
|
||||
None,
|
||||
|
@ -67,8 +70,9 @@ impl DOMParserMethods for DOMParser {
|
|||
Ok(document)
|
||||
}
|
||||
Text_xml => {
|
||||
//FIXME: this should probably be FromParser when we actually parse the string (#3756).
|
||||
let document = Document::new(&self.window, Some(url.clone()),
|
||||
// FIXME: this should probably be FromParser when we actually parse the string (#3756).
|
||||
let document = Document::new(&self.window,
|
||||
Some(url.clone()),
|
||||
IsHTMLDocument::NonHTMLDocument,
|
||||
Some(content_type),
|
||||
None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue