document.location.href method seems not to use the "base" of an html document




8 years ago
8 years ago


(Reporter: ssba5206, Unassigned)


Firefox Tracking Flags

(Not tracked)




8 years ago
User-Agent:       Opera/9.80 (Windows NT 6.0; U; ru) Presto/2.7.62 Version/11.01
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv: Gecko/20101026 Firefox/3.6.12

For some reasons I sometimes create html "redirect" documents instead of soft OS links. Now I created one with a "base" element:

<html xmlns="" lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>A &quot;link&quot; page which redirects to the tw-node.</title>
	<base href="../../.." />
  <a HREF="0_d/innernet/TW nodes/chim.fiz.etc.html">TW-node to redirect into</a>

  <script type="text/javascript">
  document.location.href = "0_d/innernet/TW nodes/chim.fiz.etc.html";

I tested this in FF, Opera and IE. Only Opera redirects to
  ../../../0_d/innernet/TW nodes/chim.fiz.etc.html
while FF and IE redirect to
  ./0_d/innernet/TW nodes/chim.fiz.etc.html
I wonder which variant is due to standart, but the Opera behavior seems much more logical.

Reproducible: Always

Steps to Reproduce:
1. Create a document like the one described above.
2. Open it.
Actual Results:  
Like I said, it redirects to ./0_d/innernet/TW nodes/chim.fiz.etc.html ("." is the folder which contains the "redirect" document).

Expected Results:  
I expect to be redirected to
./../../../0_d/innernet/TW nodes/chim.fiz.etc.html
where ".." is the usual notation.

I don't use any extensions of FireFox.
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
In HTML 4, the "href" attribute of the <base> tag must be an absolute URI.  Yours is clearly not, which is why Gecko 1.9.2 ignores it.

HTML 5 allows relative URIs for <base>, and Gecko 2.0 implements that.
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME

Comment 2

8 years ago
I see. So, waiting for the FireFox 4.0.

Thanks for your time and your help.
You need to log in before you can comment on or make changes to this bug.