If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

In <win046.html> JavaScript Testcase: 'window.frames' value should be checked for 'Window' instead of 'WindowCollection'



Developer Documentation
16 years ago
5 years ago


(Reporter: TJ, Assigned: stefanh)





(2 attachments)



16 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.9) Gecko/20020311
BuildID:    2002031104

window.frames returns Window object instead of WindowCollection object on the
Client-Side JavaScript Test page.

Reproducible: Always
Steps to Reproduce:
1.Open the page.

Actual Results:  The test failed because the wrong type of Object is return.

Expected Results:  A WindowCollection object should be returned instead of a
Window object.

Comment 1

16 years ago
Confirming reported behavior with Mozilla trunk build 20020330xx WinNT.
The following javascript: URL may be used to test this:

         javascript: alert(window.frames)

For me, this is returning "[object Window]" in Mozilla, 
and not "[object WindowCollection]"

Reassigning to DOM Level 0, since this is a DOM property.
Assignee: rogerl → jst
Component: JavaScript Engine → DOM Level 0
Ever confirmed: true
OS: Windows XP → All
QA Contact: pschwartau → desale

Comment 2

16 years ago
Who says a WindowCollection object should be returned?
That testcase seems flawed to me.

Comment 3

16 years ago
At least until recently we were returning '[object WindowCollection]'; see:
This was changed something like a year ago, it's an intentional change for
backwards compatibility, we need window.frames === window since real sites out
there rely on window.frames to have properties like name and location. Don't ask

Over to desale, the testcase needs to be updated.
Assignee: jst → desale

Comment 5

16 years ago
*** Bug 142479 has been marked as a duplicate of this bug. ***
*** Bug 168865 has been marked as a duplicate of this bug. ***

Comment 7

15 years ago
*** Bug 177033 has been marked as a duplicate of this bug. ***

Comment 8

15 years ago
http://mozilla.org/quality/ngdriver/suites/javascript/win046.html needs to be
updated with reference to this bug so others (like me ;-) don't attempt to
report it.

This change should be made irrespective of whether the test needs to be changed.

Comment 9

15 years ago
Same issue here.  Please fix or remove the test.


15 years ago
Blocks: 142649
[Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.4a) Gecko/20030401]

Bug still there.

In the meantime, who can do comment 8 to avoid more duplicates ?

Based on <http://mozilla.org/quality/ngdriver/suites/javascript/nav006.html> source,
it seems straight forward:

In <http://mozilla.org/quality/ngdriver/suites/javascript/win046.html> source,
replace "Bug report required" by "Bug# 135793".
Summary: window.frames returns wrong object → In <win046.html> JavaScript Testcase: 'window.frames' value should be checked for 'Window' instead of 'WindowCollection'

Comment 11

15 years ago
Created attachment 121463 [details]
Revised win046.html

I changed the [object WindowCollection] lines to [object Window].  I'm not
totally sure about what, if anything, that should be added to the top comment
of the file. Anyone care to help me out?
As of version 1.5a, the test: still fails; the results still report it received
[object Window] when expecting [object WindowCollection]; this bug ID is not
displayed in the "Bug Number" column.

Either of two things is happening:  The test case has not been fixed/updated; or
the fixes are not getting into the build for some reason.

Comment 13

14 years ago
RE: Comment #12:

It's the testcase that has not been fixed/updated...

Comment 14

14 years ago
Created attachment 131113 [details] [diff] [review]
Simple fix, same as in comment #11.

Comment 15

14 years ago
Taking bug...
Assignee: desale → stefan_h


14 years ago

Comment 16

14 years ago
Comment on attachment 131113 [details] [diff] [review]
Simple fix, same as in comment #11.

Seeking "r" for simple fix of DOM 0 testcase.
Attachment #131113 - Flags: review?(caillon)
Comment on attachment 131113 [details] [diff] [review]
Simple fix, same as in comment #11.

We really should make these testcases check what type of object they are
instanceof rather than compares .toString() outputs....

Comment 18

14 years ago
Re comment 4
Is the change supposed to apply to standards-compliant mode as well?
Comment on attachment 131113 [details] [diff] [review]
Simple fix, same as in comment #11.

Let's fix the testcase to not check the .toString() value, but rather to check
instanceof instead.
Attachment #131113 - Flags: review?(caillon)

Comment 20

14 years ago
I checked in stefan's patch in the mean time so that people stop wondering about
this "bug". I filed bug 226711 for the instanceof issue. Marking this fixed.
Last Resolved: 14 years ago
Resolution: --- → FIXED


14 years ago
Component: DOM: Level 0 → Mozilla Developer
Product: Browser → Documentation
Version: Trunk → unspecified
Component: Mozilla Developer → Documentation Requests
Product: Documentation → Mozilla Developer Center
Component: Documentation Requests → Documentation
Product: Mozilla Developer Network → Mozilla Developer Network
Component: Documentation → General
Product: Mozilla Developer Network → Developer Documentation
You need to log in before you can comment on or make changes to this bug.