Added support for additional xml types to DOMParser::parseFromString

This commit is contained in:
Andrew Fluth 2016-06-01 20:30:12 -05:00
parent 0594d58bc8
commit 9f2bd6779a
3 changed files with 7 additions and 22 deletions

View file

@ -5,7 +5,10 @@
use document_loader::DocumentLoader; use document_loader::DocumentLoader;
use dom::bindings::codegen::Bindings::DOMParserBinding; use dom::bindings::codegen::Bindings::DOMParserBinding;
use dom::bindings::codegen::Bindings::DOMParserBinding::DOMParserMethods; use dom::bindings::codegen::Bindings::DOMParserBinding::DOMParserMethods;
use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::{Text_html, Text_xml}; use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::Application_xhtml_xml;
use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::Application_xml;
use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::Text_html;
use dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::Text_xml;
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentReadyState; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentReadyState;
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
@ -70,7 +73,7 @@ impl DOMParserMethods for DOMParser {
document.set_ready_state(DocumentReadyState::Complete); document.set_ready_state(DocumentReadyState::Complete);
Ok(document) Ok(document)
} }
Text_xml => { Text_xml | Application_xml | Application_xhtml_xml => {
// FIXME: this should probably be FromParser when we actually parse the string (#3756). // FIXME: this should probably be FromParser when we actually parse the string (#3756).
let document = Document::new(&self.window, let document = Document::new(&self.window,
None, None,

View file

@ -8,9 +8,9 @@
enum SupportedType { enum SupportedType {
"text/html", "text/html",
"text/xml"/*, "text/xml",
"application/xml", "application/xml",
"application/xhtml+xml", "application/xhtml+xml"/*,
"image/svg+xml"*/ "image/svg+xml"*/
}; };

View file

@ -3,30 +3,12 @@
[Should return an error document for XML wellformedness errors in type text/xml] [Should return an error document for XML wellformedness errors in type text/xml]
expected: FAIL expected: FAIL
[Should parse correctly in type application/xml]
expected: FAIL
[XMLDocument interface for correctly parsed document with type application/xml]
expected: FAIL
[Should return an error document for XML wellformedness errors in type application/xml] [Should return an error document for XML wellformedness errors in type application/xml]
expected: FAIL expected: FAIL
[XMLDocument interface for incorrectly parsed document with type application/xml]
expected: FAIL
[Should parse correctly in type application/xhtml+xml]
expected: FAIL
[XMLDocument interface for correctly parsed document with type application/xhtml+xml]
expected: FAIL
[Should return an error document for XML wellformedness errors in type application/xhtml+xml] [Should return an error document for XML wellformedness errors in type application/xhtml+xml]
expected: FAIL expected: FAIL
[XMLDocument interface for incorrectly parsed document with type application/xhtml+xml]
expected: FAIL
[Should parse correctly in type image/svg+xml] [Should parse correctly in type image/svg+xml]
expected: FAIL expected: FAIL