script: display top-level SVG image documents. (#39494)

SVG images served with the image/svg+xml mime type were recognized as
XML documents instead of images, so were not displayed.

Testing: compare the results of `./mach run
https://raw.githubusercontent.com/servo/servo/467821598b59bd84273d91c9d8a33651e10578b8/resources/resource_protocol/servo-color-negative-no-container.svg`

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2025-09-29 02:16:22 -07:00 committed by GitHub
parent 7a7129edd7
commit 47382e0c2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 41 additions and 7 deletions

View file

@ -380751,6 +380751,21 @@
]
]
}
},
"top-level-document": {
"svg-image-document-svg-xml-mime-type.tentative.html": [
"d5e09d234a4e6de481a43a05f2d8ce0b40af2f5f",
[
null,
[
[
"/svg/top-level-document/svg-image-document-svg-xml-mime-type-ref.html",
"=="
]
],
{}
]
]
}
},
"visual-viewport": {
@ -517989,6 +518004,12 @@
]
}
},
"top-level-document": {
"svg-image-document-svg-xml-mime-type-ref.html": [
"ce7462f10d87730479d5488fd9a98a453a342177",
[]
]
},
"types": {
"helper-SVGElement.ownerSVGElement-02.svg": [
"2335bb42c5142ca96a63a4ec457d67ea439638ab",

View file

@ -1,2 +1,2 @@
[Document-createElement-svg.svg]
expected: ERROR
expected: TIMEOUT

View file

@ -1,2 +1,2 @@
[parser-uses-create-an-element-for-a-token-svg.svg]
expected: ERROR
expected: TIMEOUT

View file

@ -1,2 +1,2 @@
[user-interaction-editing-designMode-svg.svg]
expected: ERROR
expected: TIMEOUT

View file

@ -0,0 +1,3 @@
<!doctype html>
<meta charset="utf-8">
<iframe src="../shapes/circle-01.svg?pipe=header(Content-Type,image/svg)">

View file

@ -0,0 +1,6 @@
<!doctype html>
<meta charset="utf-8">
<title>Display image/svg+xml top level documents</title>
<link rel='match' href='svg-image-document-svg-xml-mime-type-ref.html'>
<link rel="author" title="webbeef" href="mailto:me@webbeef.org">
<iframe src="../shapes/circle-01.svg?pipe=header(Content-Type,image/svg+xml)">