Closed Bug 8679 Opened 25 years ago Closed

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

Categories

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

x86
Windows 95
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: kairo, Assigned: vidur)

Details

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").
Component: Javascript Engine → DOM Level 0
Assignee: mccabe → vidur
QA Contact: cbegle → gerardok
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!
QA Contact: gerardok → desale
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.
Status: RESOLVED → VERIFIED
Working fine. Marking verified.
You need to log in before you can comment on or make changes to this bug.