diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs index 6bfb195ee46..470a49968a3 100644 --- a/components/script/dom/domparser.rs +++ b/components/script/dom/domparser.rs @@ -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, diff --git a/components/script/dom/webidls/DOMParser.webidl b/components/script/dom/webidls/DOMParser.webidl index 8af1f309c78..90b3b6a8ff6 100644 --- a/components/script/dom/webidls/DOMParser.webidl +++ b/components/script/dom/webidls/DOMParser.webidl @@ -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] diff --git a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-base-pushstate.html.ini b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-base-pushstate.html.ini deleted file mode 100644 index d0d21c31128..00000000000 --- a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-base-pushstate.html.ini +++ /dev/null @@ -1,31 +0,0 @@ -[DOMParser-parseFromString-url-base-pushstate.html] - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - diff --git a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-base.html.ini b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-base.html.ini deleted file mode 100644 index b0a7140f246..00000000000 --- a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-base.html.ini +++ /dev/null @@ -1,31 +0,0 @@ -[DOMParser-parseFromString-url-base.html] - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - diff --git a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-moretests.html.ini b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-moretests.html.ini deleted file mode 100644 index e8cd29547c0..00000000000 --- a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-moretests.html.ini +++ /dev/null @@ -1,19 +0,0 @@ -[DOMParser-parseFromString-url-moretests.html] - [Child window after navigation (image/svg+xml)] - expected: FAIL - - [Child window with parent method (image/svg+xml)] - expected: FAIL - - [Parent window with child method (image/svg+xml)] - expected: FAIL - - [Child window (image/svg+xml)] - expected: FAIL - - [Child window crossing navigation (image/svg+xml)] - expected: FAIL - - [Parent window (image/svg+xml)] - expected: FAIL - diff --git a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-pushstate.html.ini b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-pushstate.html.ini deleted file mode 100644 index 21ae010ba60..00000000000 --- a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url-pushstate.html.ini +++ /dev/null @@ -1,31 +0,0 @@ -[DOMParser-parseFromString-url-pushstate.html] - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - diff --git a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url.html.ini b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url.html.ini deleted file mode 100644 index dc0df3f1683..00000000000 --- a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-url.html.ini +++ /dev/null @@ -1,31 +0,0 @@ -[DOMParser-parseFromString-url.html] - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - diff --git a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini index 3ae47fecf41..835fd4dad4e 100644 --- a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini +++ b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini @@ -49,7 +49,3 @@ [DOMParser: element added on error, 6] expected: FAIL - - [image/svg+xml is preserved in the error document] - expected: FAIL - diff --git a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml.html.ini b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml.html.ini index 89aa9aaf120..a925f0e493f 100644 --- a/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml.html.ini +++ b/tests/wpt/meta-legacy-layout/domparsing/DOMParser-parseFromString-xml.html.ini @@ -9,18 +9,5 @@ [Should return an error document for XML wellformedness errors in type application/xhtml+xml] expected: FAIL - [Should parse correctly in type image/svg+xml] - expected: FAIL - - [XMLDocument interface for correctly parsed document with type image/svg+xml] - expected: FAIL - [Should return an error document for XML wellformedness errors in type image/svg+xml] expected: FAIL - - [XMLDocument interface for incorrectly parsed document with type image/svg+xml] - expected: FAIL - - [scripting must be disabled with type image/svg+xml] - expected: FAIL - diff --git a/tests/wpt/meta/dom/nodes/Document-createElement-namespace.html.ini b/tests/wpt/meta/dom/nodes/Document-createElement-namespace.html.ini index 978dedb9717..cd9420d00a3 100644 --- a/tests/wpt/meta/dom/nodes/Document-createElement-namespace.html.ini +++ b/tests/wpt/meta/dom/nodes/Document-createElement-namespace.html.ini @@ -1,7 +1,4 @@ [Document-createElement-namespace.html] - [Created element's namespace in created SVG document by DOMParser ('image/svg+xml')] - expected: FAIL - [Created element's namespace in empty.svg] expected: FAIL diff --git a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-base-pushstate.html.ini b/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-base-pushstate.html.ini deleted file mode 100644 index baede27e6c6..00000000000 --- a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-base-pushstate.html.ini +++ /dev/null @@ -1,30 +0,0 @@ -[DOMParser-parseFromString-url-base-pushstate.html] - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL diff --git a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-base.html.ini b/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-base.html.ini deleted file mode 100644 index 987e33cfcef..00000000000 --- a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-base.html.ini +++ /dev/null @@ -1,30 +0,0 @@ -[DOMParser-parseFromString-url-base.html] - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL diff --git a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-moretests.html.ini b/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-moretests.html.ini deleted file mode 100644 index 22955ede9a1..00000000000 --- a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-moretests.html.ini +++ /dev/null @@ -1,18 +0,0 @@ -[DOMParser-parseFromString-url-moretests.html] - [Parent window (image/svg+xml)] - expected: FAIL - - [Child window (image/svg+xml)] - expected: FAIL - - [Parent window with child method (image/svg+xml)] - expected: FAIL - - [Child window with parent method (image/svg+xml)] - expected: FAIL - - [Child window crossing navigation (image/svg+xml)] - expected: FAIL - - [Child window after navigation (image/svg+xml)] - expected: FAIL diff --git a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-pushstate.html.ini b/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-pushstate.html.ini deleted file mode 100644 index 514df08bc5e..00000000000 --- a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url-pushstate.html.ini +++ /dev/null @@ -1,30 +0,0 @@ -[DOMParser-parseFromString-url-pushstate.html] - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL diff --git a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url.html.ini b/tests/wpt/meta/domparsing/DOMParser-parseFromString-url.html.ini deleted file mode 100644 index 1dee4e4f621..00000000000 --- a/tests/wpt/meta/domparsing/DOMParser-parseFromString-url.html.ini +++ /dev/null @@ -1,30 +0,0 @@ -[DOMParser-parseFromString-url.html] - [image/svg+xml valid: created normally] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml valid: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml valid: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml valid: created using a parser from the iframe and the method from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created normally] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from this frame] - expected: FAIL - - [image/svg+xml invalid XML: created using another iframe's DOMParser from that frame] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from this frame and the method from the iframe] - expected: FAIL - - [image/svg+xml invalid XML: created using a parser from the iframe and the method from this frame] - expected: FAIL diff --git a/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini b/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini index 2c96b2ca59c..b7a433e823d 100644 --- a/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini +++ b/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml-parsererror.html.ini @@ -49,6 +49,3 @@ [DOMParser: element added on error, 17] expected: FAIL - - [image/svg+xml is preserved in the error document] - expected: FAIL diff --git a/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml.html.ini b/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml.html.ini index 2e7c7109e9f..f71d8963b74 100644 --- a/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml.html.ini +++ b/tests/wpt/meta/domparsing/DOMParser-parseFromString-xml.html.ini @@ -8,17 +8,5 @@ [Should return an error document for XML wellformedness errors in type application/xhtml+xml] expected: FAIL - [Should parse correctly in type image/svg+xml] - expected: FAIL - - [XMLDocument interface for correctly parsed document with type image/svg+xml] - expected: FAIL - [Should return an error document for XML wellformedness errors in type image/svg+xml] expected: FAIL - - [XMLDocument interface for incorrectly parsed document with type image/svg+xml] - expected: FAIL - - [scripting must be disabled with type image/svg+xml] - expected: FAIL