UNCONFIRMED 43561
getSVGDocument doesn't work with an object containing a text/xml document
https://bugs.webkit.org/show_bug.cgi?id=43561
Summary getSVGDocument doesn't work with an object containing a text/xml document
Christian Schaller
Reported 2010-08-05 07:41:25 PDT
I made a page for my wedding with a countdown graphic done in SVG and Javascript. It works fine in Opera and Firefox, but in Chrome and Epiphany nothing happens. Page with graphic is here: http://www.linuxrising.org/wedding/index.html The ?? in the 'Days left' graphic should get replaced by a number, but instead nothing happens.
Attachments
test case (2.75 KB, patch)
2010-08-05 14:03 PDT, Gustavo Noronha (kov)
no flags
Gustavo Noronha (kov)
Comment 1 2010-08-05 07:46:45 PDT
I did a small investigation on this with the web inspector. The SVG renders fine, but the getSVGDocument() call returns undefined. It doesn't seem to be a problem in the SVG file, since downloading the file, and adding it to an <object> tag in a simple test html file has that call working, from the inspector. I was unable to reduce it up to now.
Gustavo Noronha (kov)
Comment 2 2010-08-05 07:58:11 PDT
The problem seems to only happen if the server gives text/xml as the Content-Type in its response (as the server in question does). If the server says the file is image/svg+xml, then it works. We need to either sniff the svg from the content (I'm afraid this needs an update to the content sniffing standard), or use the explicitely given type attribute in the object tag here.
Christian Schaller
Comment 3 2010-08-05 08:20:22 PDT
I updated the web server to give the proper document type for SVG and now it works.
Gustavo Noronha (kov)
Comment 4 2010-08-05 14:03:26 PDT
Created attachment 63632 [details] test case Here's a layout test for this issue, with a passing expected result. You can test it works with image/svg+xml by changing svg-as-xml.php to send that as the Content-Type. Now we just need to figure out how to fix it ;)
Alexey Proskuryakov
Comment 5 2010-08-06 06:21:12 PDT
I'm not sure if forcing a different MIME in loader is the right fix. Although getSVGDocument isn't defined in HTML5, it seems like it should work regardless of MIME type, and possibly even for text/html documents.
Ahmad Saleem
Comment 6 2023-03-04 06:54:39 PST
Alexey Proskuryakov
Comment 7 2023-03-05 11:00:49 PST
Doesn't seem obviously related at the first glance. It should be possible to test though: - apply the attached patch locally with `svn-apply` or just `patch`. - launch the testing server with `run-webkit-httpd`. - open http://127.0.0.1:8000/misc/svg-document-with-text-xml-type.html in MiniBrowser and/or in other browsers.
Note You need to log in before you can comment on or make changes to this bug.