Support the parsing of image/svg+xml elements (#31318)

* Support the parsing of image/svg+xml elements

* Update WPT test expectations
This commit is contained in:
Keith Yeung 2024-02-14 16:16:37 +08:00 committed by GitHub
parent d00312eb08
commit 123854faee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 4 additions and 320 deletions

View file

@ -10,7 +10,7 @@ use crate::document_loader::DocumentLoader;
use crate::dom::bindings::codegen::Bindings::DOMParserBinding;
use crate::dom::bindings::codegen::Bindings::DOMParserBinding::DOMParserMethods;
use crate::dom::bindings::codegen::Bindings::DOMParserBinding::SupportedType::{
Application_xhtml_xml, Application_xml, Text_html, Text_xml,
Application_xhtml_xml, Application_xml, Image_svg_xml, Text_html, Text_xml,
};
use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentReadyState;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
@ -84,7 +84,7 @@ impl DOMParserMethods for DOMParser {
document.set_ready_state(DocumentReadyState::Complete);
Ok(document)
},
Text_xml | Application_xml | Application_xhtml_xml => {
Text_xml | Application_xml | Application_xhtml_xml | Image_svg_xml => {
let document = Document::new(
&self.window,
HasBrowsingContext::No,

View file

@ -10,8 +10,8 @@ enum SupportedType {
"text/html",
"text/xml",
"application/xml",
"application/xhtml+xml"/*,
"image/svg+xml"*/
"application/xhtml+xml",
"image/svg+xml"
};
[Exposed=Window]