aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/domparser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/domparser.rs')
-rw-r--r--components/script/dom/domparser.rs25
1 files changed, 15 insertions, 10 deletions
diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs
index fe543162da8..91d340aa791 100644
--- a/components/script/dom/domparser.rs
+++ b/components/script/dom/domparser.rs
@@ -2,17 +2,18 @@
* 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::codegen::Bindings::DocumentBinding::DocumentReadyStateValues;
+use dom::bindings::codegen::Bindings::DocumentBinding::DocumentReadyState;
use dom::bindings::codegen::Bindings::DOMParserBinding;
use dom::bindings::codegen::Bindings::DOMParserBinding::DOMParserMethods;
-use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedTypeValues::{Text_html, Text_xml};
-use dom::bindings::error::{Fallible, FailureUnknown};
+use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::{Text_html, Text_xml};
+use dom::bindings::error::Fallible;
+use dom::bindings::error::Error::FailureUnknown;
use dom::bindings::global::GlobalRef;
use dom::bindings::global;
use dom::bindings::js::{JS, JSRef, Temporary};
use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object};
-use dom::document::{Document, DocumentHelpers, HTMLDocument, NonHTMLDocument};
-use dom::document::{FromParser, NotFromParser};
+use dom::document::{Document, DocumentHelpers, IsHTMLDocument};
+use dom::document::DocumentSource;
use dom::servohtmlparser::ServoHTMLParser;
use dom::window::Window;
use parse::Parser;
@@ -53,18 +54,22 @@ impl<'a> DOMParserMethods for JSRef<'a, DOMParser> {
let content_type = DOMParserBinding::SupportedTypeValues::strings[ty as uint].to_string();
match ty {
Text_html => {
- let document = Document::new(window, url.clone(), HTMLDocument,
- Some(content_type), FromParser).root().clone();
+ let document = Document::new(window, url.clone(),
+ IsHTMLDocument::HTMLDocument,
+ Some(content_type),
+ DocumentSource::FromParser).root().clone();
let parser = ServoHTMLParser::new(url.clone(), document).root().clone();
parser.parse_chunk(s);
parser.finish();
- document.set_ready_state(DocumentReadyStateValues::Complete);
+ document.set_ready_state(DocumentReadyState::Complete);
Ok(Temporary::from_rooted(document))
}
Text_xml => {
//FIXME: this should probably be FromParser when we actually parse the string (#3756).
- Ok(Document::new(window, url.clone(), NonHTMLDocument, Some(content_type),
- NotFromParser))
+ Ok(Document::new(window, url.clone(),
+ IsHTMLDocument::NonHTMLDocument,
+ Some(content_type),
+ DocumentSource::NotFromParser))
}
_ => {
Err(FailureUnknown)