Closed Bug 326183 Opened 19 years ago Closed 2 years ago

Typing "document.write('Hello')" in the JS Console changes cursor to hourglass

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: hickeyj, Unassigned)

References

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060206 Firefox/1.6a1

Evaluating a document.write() command in the JavaScript console changes the cursor to an hourglass and produces no output of any kind.  Despite the hourglass cursor, I am able to enter and evaluate other commands.  CPU/memory doesn't indicate that any processing is going on behind the scenes.  Closing the JS Console seems to be the only way to make the hourglass disappear

Reproducible: Always

Steps to Reproduce:
1. Type "document.write("Hello")" in the JS Console input field.  Press Evaluate.


Actual Results:  
The cursor changes to an hourglass and no output of any kind is produced from the evaluation. 

Expected Results:  
Expected an error message if document.write() is not valid within the JS Console context.
Confirmed on Mac.

document.open() has the same effect.

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060205 Firefox/1.6a1
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Summary: Typing "document.write("Hello")" in the JS Console changes cursor to hourglass → Typing "document.write('Hello')" in the JS Console changes cursor to hourglass
fwiw, document.close() makes the hourglass go away.
javascript:document.write() in a blank tab causes an hourglass cursor too.  So I guess the question is why the JavaScript Console uses an HTMLDocument for evaluating things in the console.  (Where is the HTMLDocument, anyway?)
Blocks: 331895
(In reply to comment #2)
> fwiw, document.close() makes the hourglass go away.

bug 81980
should this be duped to bug 81980?  Or, should bug 81980 depend on this?
No longer blocks: 331895
Component: Error Console → General
QA Contact: javascript.console → general
Version: unspecified → Trunk
(In reply to comment #3)
> javascript:document.write() in a blank tab causes an hourglass cursor too.  So
> I guess the question is why the JavaScript Console uses an HTMLDocument for
> evaluating things in the console.  (Where is the HTMLDocument, anyway?)

It uses an iframe with a blank HTML document in it to evaluate the JS. There isn't really any other way to evaluate JS and get useful exceptions/warnings (with the right line numbers, offset, etc).
Depends on: 81980

Potentially fixed by Bug 81980. Just smoke testing it on my end, running document.write in the browser console doesn't cause a hangup, and document.write("Hello") properly shows a blank HTML document with "Hello"

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.