Bug 14187 - No responseXML for SVG files with image/svg+xml
Summary: No responseXML for SVG files with image/svg+xml
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac All
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-15 17:03 PDT by Martin Czuchra
Modified: 2007-09-30 02:08 PDT (History)
1 user (show)

See Also:


Attachments
Fix for the bug (770 bytes, patch)
2007-06-15 21:51 PDT, Oliver Hunt
oliver: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Czuchra 2007-06-15 17:03:30 PDT
When getting a svg file by means of XMLHTTPRequest, there is a responseText field in the response that actually holds the information, but there is no responseXML field that holds the SVG's parsed DOM. It instead is undefined. Since the content type says it's image/svg+xml, WebKit should treat it as such.
Comment 1 Oliver Hunt 2007-06-15 21:00:00 PDT
Oh wow, this should be really simple
Comment 2 Oliver Hunt 2007-06-15 21:51:25 PDT
Created attachment 15078 [details]
Fix for the bug

Still need to make a test case for this.
Comment 3 Oliver Hunt 2007-06-15 22:53:01 PDT
Comment on attachment 15078 [details]
Fix for the bug

Just realised this is really really wrong
Comment 4 Martin Czuchra 2007-06-16 19:16:21 PDT
IMHO, this should work more generic, I think. There are a lot more cases in which parsing as XML is reasonable, and they all have in common that they're ending with '/xml' or '+xml'.
Comment 5 Alexey Proskuryakov 2007-06-16 19:21:31 PDT
I'm surprised - this is supposed to work really well with nightly builds. Can you reproduce this issue with a nightly build, or just with shipping Safari?
Comment 6 Oliver Hunt 2007-06-16 19:23:48 PDT
Yeah, the above patch was incorrect (hence me r-ing my own patch)

Immediately following that check we do a regex check that *should* pick up */*+xml as an xml doc.

For reasons beyond comprehension in this particulr case it does nopt aapear to be working.  Alas i haven't been able to produce a case where it would screw up, so fixing/testing is proving difficult.
Comment 7 Alexey Proskuryakov 2007-06-16 20:37:41 PDT
(In reply to comment #6)
> For reasons beyond comprehension in this particulr case it does nopt aapear to
> be working.

So, is there some site where this problem can be seen?
Comment 8 Eric Seidel (no email) 2007-09-27 07:19:12 PDT
I wonder if someone might have expected a responseXML when fetching an SVG with the wrong mime type... say image/svg-xml instead of +xml.
Comment 9 Maciej Stachowiak 2007-09-30 02:05:13 PDT
This clearly works on at least some sites. If a reproducible case is found, please reopen.
Comment 10 Maciej Stachowiak 2007-09-30 02:08:48 PDT
Comment on attachment 15078 [details]
Fix for the bug

Obsoleted this since the idea is wrong and the bug does not appear relevant any more.