Closed Bug 459470 Opened 16 years ago Closed 16 years ago

Need to set documentURI and baseURI correctly for XHR documents

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sicking, Assigned: sicking)

References

Details

(Keywords: verified1.9.0.7)

Attachments

(2 files)

Attached patch Patch to fixSplinter Review
HR documents are created with the wrong documentURI.

It doesn't actually look like we ever expose documents of the wrong URI anywhere, but the live internally as such while loading sometimes which seems risky.

It also seems like a waste of cycles to create the document when not needed.

Patch to fix attached
Attachment #342683 - Flags: superreview?(bzbarsky)
Attachment #342683 - Flags: review?(bzbarsky)
Comment on attachment 342683 [details] [diff] [review]
Patch to fix

Actually, we can delay document creation even more. Will write new patch
Attachment #342683 - Flags: superreview?(bzbarsky)
Attachment #342683 - Flags: review?(bzbarsky)
Attachment #342683 - Flags: superreview?(bzbarsky)
Attachment #342683 - Flags: review?(bzbarsky)
Comment on attachment 342683 [details] [diff] [review]
Patch to fix

Ok, leaving as is.

What we could do is to move the parsing into GetResponseXML. However that would mean parsing the whole document when the script gets .responseXML which might take a while. Bz measured 5 sec to parse a 13MB doc. Seems bad to freeze the UI for so long time so lets stick with the current strategy for now.
Ugh, left some dump() statements in the testfile. Please ignore those.
Comment on attachment 342683 [details] [diff] [review]
Patch to fix

>+++ b/content/base/src/nsXMLHttpRequest.cpp
>+    // Setting the base URI to |uri| won't work if the document has a null

s/|uri|/|baseURI/

With that and the dump()s removed, looks good.
Attachment #342683 - Flags: superreview?(bzbarsky)
Attachment #342683 - Flags: superreview+
Attachment #342683 - Flags: review?(bzbarsky)
Attachment #342683 - Flags: review+
Checked in: http://hg.mozilla.org/mozilla-central/rev/ee5135f3f773
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Blocks: 474211
Weshould take this on 1.9.0, since that would fix bug 474211 there.
Flags: blocking1.9.0.7?
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.7?
Flags: blocking1.9.0.7+
Attached patch Branch patchSplinter Review
Porting was really easy so if you don't get to review this I feel confident enough to just check in. All I did was remove the parts that did
s/mDocument/mResponseXML/, and removed code and tests to deal with xs-xhr.
Attachment #359877 - Flags: superreview?(bzbarsky)
Attachment #359877 - Flags: review?(bzbarsky)
Attachment #359877 - Flags: superreview?(bzbarsky)
Attachment #359877 - Flags: superreview+
Attachment #359877 - Flags: review?(bzbarsky)
Attachment #359877 - Flags: review+
Comment on attachment 359877 [details] [diff] [review]
Branch patch

Looks good.
Comment on attachment 359877 [details] [diff] [review]
Branch patch

Approved for 1.9.0.7, a=dveditz for release-drivers.
Attachment #359877 - Flags: approval1.9.0.7? → approval1.9.0.7+
The checked in tests in the patch pass. Is there any manual way to verify this fix?
Marking as verified then for 1.9.0.7.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: