Open Bug 893605 Opened 12 years ago Updated 3 years ago

History API not working properly in XSLT

Categories

(Core :: XSLT, defect)

21 Branch
x86_64
Linux
defect

Tracking

()

People

(Reporter: contacto, Unassigned)

Details

Attachments

(1 file)

3.82 KB, application/octet-stream
Details
Attached file firefox_bug.zip
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release) Build ID: 20130514193536 Steps to reproduce: To see the bug: http://share.nekmo.com/firefox_bug 1. The page starts as "http://share.nekmo.com/index.xml" 2. Using History API URL is changed to "http://share.nekmo.com/subdir/index.html" 3. An image with relative link to "image.png" is added to the document. Actual results: 4. The image points to "http://share.nekmo.com/image.png". Expected results: 5. The image should be directed to: "http://share.nekmo.com/subdir/image.png". In chromium works well. In Firefox with HTML also.
Component: Untriaged → DOM
Product: Firefox → Core
Justin, any idea what's going on here?
Flags: needinfo?(justin.lebar+bug)
nsImageLoadingContent::LoadImage ends up calling nsIContent::GetBaseURI (via http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsImageLoadingContent.cpp#1009), which in turns calls nsDocument::GetDocBaseURI (http://mxr.mozilla.org/mozilla-central/source/content/base/src/FragmentOrElement.cpp#269), which will always return an explicit base URI over the current document one. PushState ends up calling nsDocument::SetDocumentURI which sets mDocumentURI, but XMLDocument explicitly sets a base URI (http://mxr.mozilla.org/mozilla-central/source/content/xml/document/src/XMLDocument.cpp#146). That's my guess, at least.
Ah, hmm. I wonder whether we should avoid setting the base URI there if it's equal to the document URI...
Flags: needinfo?(bugs)
Flags: needinfo?(justin.lebar+bug)
But are there valid cases when we should have baseuri explicitly set? Anyhow, sounds like jdm is correct and XSLT shouldn't set baseuri by default.
Component: DOM → XSLT
Flags: needinfo?(bugs)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: