Closed Bug 305243 Opened 19 years ago Closed 19 years ago

xmlHttpRequest mishandles local xml files

Categories

(Core :: XML, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: sean, Assigned: Biesinger)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.11) Gecko/20050729
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.11) Gecko/20050729

A well-formed, valid xsl file loaded from local disk via xmlHttpRequest has
valid contentText, but contentXML is null.

Mozilla seems to think the document is not XML.

(Local mime type for .xsl files is text/xsl.)

Reproducible: Always

Steps to Reproduce:
1.load local file with non-XML mime type via xmlHttpRequest
2.display xmlHttpRequest.contentXML

Actual Results:  
contentXML is null

Expected Results:  
The contentXML should be an XMLDocument.
Assignee: nobody → xml
Status: UNCONFIRMED → NEW
Component: File Handling → XML
Ever confirmed: true
Product: Firefox → Core
QA Contact: file.handling → ashshbhatt
Version: unspecified → Trunk
Attached patch patchSplinter Review
Assignee: xml → cbiesinger
Status: NEW → ASSIGNED
Attachment #193210 - Flags: superreview?(bzbarsky)
Attachment #193210 - Flags: review?(jst)
OS: Linux → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.8beta4
Attachment #193210 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 193210 [details] [diff] [review]
patch

r=jst
Attachment #193210 - Flags: review?(jst) → review+
fixed on trunk:
Checking in xmlextras/base/src/nsXMLHttpRequest.cpp;
/cvsroot/mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp,v  <-- 
nsXMLHttpRequest.cpp
new revision: 1.136; previous revision: 1.135
done
Checking in xmlextras/tests/TestXMLExtras.cpp;
/cvsroot/mozilla/extensions/xmlextras/tests/TestXMLExtras.cpp,v  <-- 
TestXMLExtras.cpp
new revision: 1.24; previous revision: 1.23
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 193210 [details] [diff] [review]
patch

this is a low risk patch to make XMLHttpRequest behave better for file:// URIs,
this'd be nice to have in 1.8.
Attachment #193210 - Flags: approval1.8b5?
cbiesinger, how is this used and why is it important?
Extensions can use this to load XML files from the local disk. This is important
because without it, loading (say) "foo.xsl" might or might not work, depending
on OS configuration.
Attachment #193210 - Flags: approval1.8b5? → approval1.8b5+
please add the fixed1.8 keyword when you land this on the branch
Flags: blocking1.8b5+
fixed on MOZILLA_1_8_BRANCH
Checking in extensions/xmlextras/base/src/nsXMLHttpRequest.cpp;
/cvsroot/mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp,v  <-- 
nsXMLHttpRequest.cpp
new revision: 1.134.2.1; previous revision: 1.134
done
Checking in extensions/xmlextras/tests/TestXMLExtras.cpp;
/cvsroot/mozilla/extensions/xmlextras/tests/TestXMLExtras.cpp,v  <-- 
TestXMLExtras.cpp
new revision: 1.23.4.1; previous revision: 1.23
done
Keywords: fixed1.8
Is it intentional that XMLHttpRequest can retrieve any type of content from the
web but only XML data from local files? I found it at least somewhat confusing
that one of my extensions suddenly stopped working because of a not further
specified NS_ERROR_FAILURE in nsIXMLHttpRequest.Send.
not at all. please file a new bug with testcase.
I backed this patch out of the 1.8 branch because it caused bug 309078; see also
that bug for the reasoning. if people do think we should have this on the
branch, we need to take bug 293046 too.
Keywords: fixed1.8
Target Milestone: mozilla1.8beta4 → mozilla1.9alpha
Flags: blocking1.8b5+ → blocking1.8b5-
Attachment #193210 - Flags: approval1.8b5+
Depends on: 384298
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: