xmlHttpRequest mishandles local xml files

RESOLVED FIXED in mozilla1.9alpha1

Status

()

Core
XML
P1
normal
RESOLVED FIXED
13 years ago
7 years ago

People

(Reporter: Sean McMurray, Assigned: Biesinger)

Tracking

Trunk
mozilla1.9alpha1
Points:
---
Bug Flags:
blocking1.8b5 -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
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
Created attachment 193210 [details] [diff] [review]
patch
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
Last Resolved: 13 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?

Comment 5

13 years ago
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.

Updated

13 years ago
Attachment #193210 - Flags: approval1.8b5? → approval1.8b5+

Comment 7

13 years ago
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

Comment 9

13 years ago
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

Updated

13 years ago
Flags: blocking1.8b5+ → blocking1.8b5-

Updated

13 years ago
Attachment #193210 - Flags: approval1.8b5+
You need to log in before you can comment on or make changes to this bug.