Mess on the screen with using document.write with undefined variable.

RESOLVED DUPLICATE of bug 81980

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 81980
12 years ago
11 years ago

People

(Reporter: Igor Zhbanov, Unassigned)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.12) Gecko/20050915
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.12) Gecko/20050915

Hello!

Consider the follwing example:
----- BEGIN -----
<html>
<head>
<script language="JavaScript">
function start ()
{
  document.open ();
  document.writeln ("<html><body>"+ UndefinedVariable + "</body></html>");
  document.close ();
}
</script>
</head>
<body>
Scroll down below and click the link.
<hr size="800">
<a href="javascript: start ();">START</a>.
<hr size="800">
</body>
</html>
----- END -----

Here we creating a new document from Javascript function by printing it with document.writeln() when a user clicks a link. But if we trying to print any undefined variable, browser will display mess (on lower part of screen)on Mozilla and black background in Firefox. And animated Mozilla icon will never stop. If we define variable as usual, everything will be ok.

By mess I mean some strange color dots on gray background.

<hr> tags are used only to create document large than window, so user must scroll it down to access the link. Without scrolling there will no be mess but only forever runing Mozilla icon. So if you have a very big screen resolution, adjust <hr> size accordingly. ;-)

This bug is actual both for Mozilla and Firefox on Linux and Windows.

P.S. If we printing correct document but forget about call to document.close(), then animated Mozilla icon will never stop too (because document is not closed). Is it good?

Thanks.

Reproducible: Always

Actual Results:  
Mess or black background on lover part of screen.

Expected Results:  
I don't know. ;-) I seean error on Javascript console about undefined variable, but I'm sure I don't have to see a mess. :-)

Comment 1

12 years ago
WFM with Firefox trunk.

Do you see the problem with just document.open(), or do you need the bogus document.write attempt to see the problem?

> P.S. If we printing correct document but forget about call to document.close(),
> then animated Mozilla icon will never stop too (because document is not
> closed). Is it good?

See bug 81980.
(Reporter)

Comment 2

12 years ago
You are right. The test case can be much simplier:
----- BEGIN -----
<html>
<body>
Scroll down below and click the link.
<hr size="800">
<a href="javascript: document.open ();">START</a>.
<hr size="800">
</body>
</html>
------ END ------

So to see a mess you need an event handler that opens document and not closes it.
(Reporter)

Comment 3

12 years ago
So, it seems it's all about bug 81980 with missed document.close(). And when there is no document.close(), you will see neverending icon animation and garbage on screen. And even if you press Stop button, animation will stop, but garbage will stay.
Created attachment 217653 [details]
reporter's testcase

For next time: bugs are easier to read if, instead of pasting code into the report when you are filing, you instead file the bug, and then add the code in an attachment.
Assignee: nobody → general
Component: General → DOM
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk

Updated

11 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 81980
You need to log in before you can comment on or make changes to this bug.