JS window object only refers to topmost window - not to frames

VERIFIED FIXED

Status

()

P3
normal
VERIFIED FIXED
20 years ago
19 years ago

People

(Reporter: kairo, Assigned: vidur)

Tracking

Trunk
x86
Windows 95
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

20 years ago
Don't know if this is really a "JS Engine" bug, and it could also be a
duplicate, but I did not find it (is not easy in a list of thousands).

In my pages ("start.at/kairo" and, especially, "start.at/inconstruction") I work
with quite a lot of frames and there I'm using window.innerWidth for getting
right settings for the width of some bars. Also, I'm referring to other frames
dynamically, or only to objects (images) in those frames for changes specific to
a certain document in some frame.

All those techniques work with Nav4 but not with Mozilla/5.0 (build of
1999-06-17 and earlier - e.g. M6). It seems that a window object is not
generated for frames, so there's only one window object - the main window.

The window.innerWidth property gives back the main window (inner)width (see bug
#6886 for .innerHeight - the same problem).
And referring to a frame called "Nav" using "window.top.Nav.location" does not
work at all, the same with the <img> called "lcarsimg" in a frame called
"LCARS_top" (using "window.top.LCARS_top.document.lcarsimg.src").

Updated

20 years ago
Component: Javascript Engine → DOM Level 0

Updated

20 years ago
Assignee: mccabe → vidur
QA Contact: cbegle → gerardok

Comment 1

20 years ago
hmm, changing the component doesn't changed the contacts.  darn.  this is not
core js, trying to reassign to the right people.  if the right people is
not you, gerardo and vidur, sorry!

Updated

20 years ago
QA Contact: gerardok → desale
(Reporter)

Comment 2

20 years ago
OK, I saw now (with M7) that window.top.framename and so on works. It's only a
problem of the referring relative URLs (I opened Bug #9906 for that).

The problem of the window object properties in a frame remains!
Testing now (Sept 14 build from during tree closure), the window object in a
frame correctly refers to the frame and not the enclosing frameset/top-level:

[shaver@fights:8577]$ cat 8577.html
<frameset cols="*,*">
  <frame src="frame1.html">
  <frame src="frame2.html">
</frameset>
[shaver@fights:8577]$ cat frame1.html
<html>
<body>
frame1<br>
<script>document.write(window.location);</script>
</body>
</html>
[shaver@fights:8577]$ cat frame2.html
<html>
<body>
frame2<br>
<script>
document.write(window.location);
</script>
</body>
</html>
[shaver@fights:8577]$

I get the appropriate URLs in frame1 and frame2.

Marking FIXED.

Updated

19 years ago
Status: RESOLVED → VERIFIED

Comment 4

19 years ago
Working fine. Marking verified.
You need to log in before you can comment on or make changes to this bug.