Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1503: Integrate XML5 parser #8278

Merged
merged 1 commit into from Nov 5, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

M1503 - Integrate XML parse -Initial Steps

  • Loading branch information
Jigar24 committed Nov 5, 2015
commit dca4e3730b537746b74adbd6e46327868d533a13
@@ -70,6 +70,10 @@ git = "https://github.com/pcwalton/ipc-channel"
version = "0.6"
features = [ "serde-serialization" ]

[dependencies.xml5ever]
git = "https://github.com/Ygg01/xml5ever"
features = ["unstable"]

[dependencies]
app_units = {version = "0.1", features = ["plugins"]}
log = "0.3"
@@ -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)
}
}
}
@@ -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;
@@ -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() {
}
}
@@ -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 {
};

@@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

pub mod html;
pub mod xml;

pub trait Parser {
fn parse_chunk(self, input: String);
@@ -0,0 +1,20 @@
/* 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/. */

#![allow(unrooted_must_root)]

use dom::document::Document;
use url::Url;
use util::str::DOMString;

pub enum ParseContext {
Owner(Option<i32>)
}


pub fn parse_xml(document: &Document,
input: DOMString,
url: Url,
context: ParseContext) {
}

Some generated files are not rendered by default. Learn more.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.