aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2015-11-05 09:12:44 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2015-11-05 09:12:44 +0530
commit65a1a28860ac8858a02be6d26b262a61d040beb1 (patch)
tree9cc37432d19b5480a4ef35f99b6ffb1decf54a16 /components/script/dom
parentacc0bf68736d6e4aee2e370bf91fc2465415aa6e (diff)
parentdca4e3730b537746b74adbd6e46327868d533a13 (diff)
downloadservo-65a1a28860ac8858a02be6d26b262a61d040beb1.tar.gz
servo-65a1a28860ac8858a02be6d26b262a61d040beb1.zip
Auto merge of #8278 - Ronak6892:master, r=eefriedman
M1503: Integrate XML5 parser Hi, This is for NCSU fall 15 project for Mozilla. We have included changes for initial steps in this pull request. https://github.com/servo/servo/wiki/Integrate-xml5ever Kindly review ! <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8278) <!-- Reviewable:end -->
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 {
+};
+