Closed Bug 57534 Opened 26 years ago Closed 25 years ago

document.open() returns null and not the document.

Categories

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

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: nri_31, Assigned: jst)

References

()

Details

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16 i686; en-US; m18) Gecko/20001005 BuildID: 2000100521 Opening above page leads to alert dialog with the message "unable to open board frame" Reproducible: Always Steps to Reproduce: just go to http://www.acfcheckers.com/lassie.html Actual Results: mozilla cant display that page Expected Results: should display a checkers game board
seeing the warning on win98 trunk 200102108, over to html frames
Assignee: asa → pollmann
Status: UNCONFIRMED → NEW
Component: Browser-General → HTMLFrames
Ever confirmed: true
OS: Linux → All
QA Contact: doronr → petersen
Confirming on Mac Mozilla installer build 2000101808, Mac OS 9.0.4. At the above URL, Mozilla on an iMac DV displays a grey screen only. No warnings or alert box dialogs seen or given.
see http://www.acfcheckers.com/code.html: if(parent.frames[0].document.open() == null) { alert("Unable to open board frame."); return; }
http://www.w3.org/TR/2000/WD-DOM-Level-2-HTML-20001113/html.html#ID-26809268 According to DOM 2, it is |void open()|, so no return value should be expected. I guess this is a DOM 0 issue, assigning to jst for judgement. Can we get some tests on which browsers return what when?
Assignee: pollmann → jst
Brendan, do you happen to remember what document.open() returned in 4.x?
It returned the new document object on success, void (which is == to null and converts to false in boolean contexts). See http://lxr.mozilla.org/classic/source/lib/libmocha/lm_doc.c#1182. /be
Argh, touchpad mouse garbled my comment: Mozilla Classic DOM level 0 document.open returned the new doc on success, void on failure. /be
Status: NEW → ASSIGNED
Component: HTMLFrames → DOM Level 0
Hardware: PC → All
Summary: Mozilla cant display frames → document.open() returns null and not the document.
The patch I just attached makes the JS version of open() (nsIDOMNSHTMLDocument::Open()) return the document and it makes the checkers site work in mozilla. r= and sr= anyone?
Whiteboard: [HAVE FIX]
ooh and code cleanup :-). I guess brendan can sr=.
Keywords: approval, patch, review
Whiteboard: [HAVE FIX]
if (NS_OK != result) { How about using NS_FAILED instead? Also, watch those 80th column (or 132nd column) violations with the long lines, ok? sr=brendan@mozilla.org if you pick these nits. /be
Looks good, with Brendan's suggestions. r=blake
Thanks for the reviews and suggestions, patch (with suggested fixes) checked in. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Marking verified per last comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: