M1503 - Integrate XML parse -Initial Steps

This commit is contained in:
jsharda 2015-10-30 16:50:15 -04:00
parent 50e0c36eeb
commit dca4e3730b
8 changed files with 81 additions and 6 deletions

View file

@ -16,6 +16,7 @@ use dom::document::DocumentSource;
use dom::document::{Document, IsHTMLDocument};
use dom::window::Window;
use parse::html::{ParseContext, parse_html};
use parse::xml::{self, parse_xml};
use std::borrow::ToOwned;
use util::str::DOMString;
@ -68,12 +69,14 @@ impl DOMParserMethods for DOMParser {
}
Text_xml => {
//FIXME: this should probably be FromParser when we actually parse the string (#3756).
Ok(Document::new(&self.window, Some(url.clone()),
IsHTMLDocument::NonHTMLDocument,
Some(content_type),
None,
DocumentSource::NotFromParser,
loader))
let document = Document::new(&self.window, Some(url.clone()),
IsHTMLDocument::NonHTMLDocument,
Some(content_type),
None,
DocumentSource::NotFromParser,
loader);
parse_xml(document.r(), s, url, xml::ParseContext::Owner(None));
Ok(document)
}
}
}