mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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 -->
This commit is contained in:
commit
65a1a28860
8 changed files with 81 additions and 6 deletions
|
@ -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;
|
||||
|
|
16
components/script/dom/servoxmlparser.rs
Normal file
16
components/script/dom/servoxmlparser.rs
Normal file
|
@ -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() {
|
||||
}
|
||||
}
|
12
components/script/dom/webidls/ServoXMLParser.webidl
Normal file
12
components/script/dom/webidls/ServoXMLParser.webidl
Normal file
|
@ -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 {
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue