aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/domparser.rs
diff options
context:
space:
mode:
authorjsharda <jsharda@ncsu.edu>2015-10-30 16:50:15 -0400
committerjsharda <jsharda@ncsu.edu>2015-11-04 19:18:20 -0500
commitdca4e3730b537746b74adbd6e46327868d533a13 (patch)
treeda5b95c303fc9c8547cdbf837976a3b0d773c73c /components/script/dom/domparser.rs
parent50e0c36eeb8cd52b90dba24b5b3692abc25d8d4d (diff)
downloadservo-dca4e3730b537746b74adbd6e46327868d533a13.tar.gz
servo-dca4e3730b537746b74adbd6e46327868d533a13.zip
M1503 - Integrate XML parse -Initial Steps
Diffstat (limited to 'components/script/dom/domparser.rs')
-rw-r--r--components/script/dom/domparser.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs
index 386c2e1ab4a..f11f92ba6e6 100644
--- a/components/script/dom/domparser.rs
+++ b/components/script/dom/domparser.rs
@@ -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)
}
}
}