Closed Bug 623447 Opened 9 years ago Closed 9 years ago

"ASSERTION: AreDialogsBlocked() called without a top window"

Categories

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

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla2.0b9

People

(Reporter: jruderman, Assigned: Natch)

References

(Blocks 2 open bugs)

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Attached file testcase
###!!! ASSERTION: AreDialogsBlocked() called without a top window?: 'Error', file dom/base/nsGlobalWindow.cpp, line 2557

nsGlobalWindow::AreDialogsBlocked [dom/base/nsGlobalWindow.cpp:2559]
nsGlobalWindow::ShowModalDialog [dom/base/nsGlobalWindow.cpp:6712]
NS_InvokeByIndex_P [xptcinvoke_x86_64_unix.cpp:208]

This assertion was added as part of:

changeset:   e036427942ff
user:        Johnny Stenback
date:        Thu Sep 16 18:24:14 2010 -0700
summary:     Fixing bug 61098. Give users a way out of inifinite modal dialog loops. Original patch by Nochum Sossonko. r=jonas@sicking.cc a=beta7+
The testcase also triggers the assertion in bug 608191, which might have the same underlying cause.
Bogus assertion since we bail anyhow, but this seems like a result of removing the following line:

2.509 -  NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);

from nsGlobalWindow::ShowModalDialog

Does this happen with alert/prompt/confirm dialogs, or only showModalDialog?
Attached file testcase using alert
Yes, also happens with alert.
That would be because this line was removed:

http://mxr.mozilla.org/mozilla1.9.2/source/dom/base/nsGlobalWindow.cpp#4224

But that came before this bug. These are bogus, ::GetTop fails because there is no docshell.
Attached patch patchSplinter Review
This quiets the assert when there's no docshell, which is what used to happen before. We'll bail anyhow, because AreDialogsBlocked will return true.
Assignee: nobody → highmind63
Attachment #501672 - Flags: review?(jst)
Attachment #501672 - Flags: review?(jst) → review+
Comment on attachment 501672 [details] [diff] [review]
patch

This is probably NPOTDB, but just to make sure a?....
Attachment #501672 - Flags: approval2.0?
http://hg.mozilla.org/mozilla-central/rev/5a420472acf6
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b9
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.