Closed Bug 10644 Opened 25 years ago Closed 25 years ago

document.open doesn't clear page

Categories

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

x86
Windows 98
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: markoft, Assigned: vidur)

References

()

Details

(Whiteboard: [HAVE FIX])

Attachments

(1 file)

I have a gallery page at the above URL that was written to allow Netscape users
to view the gallery in a similar fashion to how IE veiws it.  The IE gallery
page still kills Mozilla but that is really kinda expected...
The problem is with the Netscape page.  It loads a frameset where you make
selections in the top frame and the top frame creates a new page in the bottom
page.  M8 loaded the page fine but it would not write new pages below, it would
just add to the current page shown, after you reselected the image you wished to
view.  I also downloaded the latest build (199072711) to see if there was still
a problem but this time it would not even write/render the bottom page.  This is
the first time I've used Mozilla so I do not know if you have added a Clear
command that needs to be used before writing to a new page or if this ia bug in
the Javascript code.
The zip file contains three HTML docs: the frameset and the two frames. The
first one (dom.html) contains the code. It works on Nav4 but not on Mozilla M8
under Win98.
I see two problems here:

1) javascript: URLs aren't working right now.  That's bug 1646.  This is why the
side arrows aren't working.  The drop-down box works, though.

2) document.open() doesn't empty the existing page, at least when called with
'text/html'.
Component: DOM Level 0 → DOM Level 1
Summary: DHTML/Javascript error or Bug in NGLayout? → document.open doesn't clear page
Since one part here is another bug, this one should be (as was the emphasis in
the original report) for #2 above.  Retitling appropriately.

DOM Level 1 is quite clear that document.open() should clear the page.
Therefore, changing component from DOM Level 0 to Level 1.  Simpler test case is
on its way.

See also bug 9787.
I can't replicate this in a simple test case... except when the document being
open()ed is the document containing the script, in which case mozilla mimics
NN4.6.

There are some strange things happening,though...

Note that the code here doesn't actually call document close - it doesn't have
the ().  That causes the text to disappear it 4.6 when I simplify it (in
frames).

I don't understand what's happening.  Sometimes, right as I'm leaving the URL
and loading a new one, though, I see three what I document.wrote() twice,
instead of once like it had and should have been.
The simple test case does work and the page itself works when you put the ()
after the document.close. Well, also after you apply the following patch (which
I'll try to check in after the tree reopens for M12). My current thought is to
mark this INVALID once I get in the patch - the content should be modified to be
valid. Ok with you, markoft@speakeasy.org?

Index: nsJSUtils.cpp
===================================================================
RCS file: /cvsroot/mozilla/dom/src/base/nsJSUtils.cpp,v
retrieving revision 1.19
diff -r1.19 nsJSUtils.cpp
423c423
<   if (JSVAL_IS_BOOLEAN(aValue) && JS_ValueToBoolean(aContext, aValue, &temp))
{
---
>   if (JS_ValueToBoolean(aContext, aValue, &temp)) {
Status: NEW → ASSIGNED
Whiteboard: [HAVE FIX]
Sounds like a plan to me vidur, so long as the () gets/is documented
somewhere.  Just spent 2 days fighting with a program and only reading the
source let me know what was wrong.  Thanks for fixing it, and my code...8-)...
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
Fixed on 12/14/1999. Note that the fix is the one that allows any type to be
passed in instead of a boolean. Marking this bug INVALID as agreed to earlier.
Status: RESOLVED → VERIFIED
Verified.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: