aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
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
parent50e0c36eeb8cd52b90dba24b5b3692abc25d8d4d (diff)
downloadservo-dca4e3730b537746b74adbd6e46327868d533a13.tar.gz
servo-dca4e3730b537746b74adbd6e46327868d533a13.zip
M1503 - Integrate XML parse -Initial Steps
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/domparser.rs15
-rw-r--r--components/script/dom/mod.rs1
-rw-r--r--components/script/dom/servoxmlparser.rs16
-rw-r--r--components/script/dom/webidls/ServoXMLParser.webidl12
4 files changed, 38 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)
}
}
}
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs
index bacc88834f9..46b61834f73 100644
--- a/components/script/dom/mod.rs
+++ b/components/script/dom/mod.rs
@@ -338,6 +338,7 @@ pub mod progressevent;
pub mod range;
pub mod screen;
pub mod servohtmlparser;
+pub mod servoxmlparser;
pub mod storage;
pub mod storageevent;
pub mod testbinding;
diff --git a/components/script/dom/servoxmlparser.rs b/components/script/dom/servoxmlparser.rs
new file mode 100644
index 00000000000..9de29cb392d
--- /dev/null
+++ b/components/script/dom/servoxmlparser.rs
@@ -0,0 +1,16 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+use dom::bindings::reflector::Reflector;
+
+#[must_root]
+#[dom_struct]
+pub struct ServoXMLParser {
+ reflector_: Reflector,
+}
+
+impl ServoXMLParser {
+ pub fn new() {
+ }
+}
diff --git a/components/script/dom/webidls/ServoXMLParser.webidl b/components/script/dom/webidls/ServoXMLParser.webidl
new file mode 100644
index 00000000000..0b5a20addd3
--- /dev/null
+++ b/components/script/dom/webidls/ServoXMLParser.webidl
@@ -0,0 +1,12 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+// This interface is entirely internal to Servo, and should not be accessible to
+// web pages.
+
+[NoInterfaceObject]
+interface ServoXMLParser {
+};
+