Closed
Bug 573808
Opened 15 years ago
Closed 15 years ago
"domWin is null" error with new prompting backend and no active window
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
FIXED
mozilla2.0b1
People
(Reporter: davemgarrett, Assigned: Dolske)
References
Details
(Keywords: regression, testcase)
Attachments
(1 file, 2 obsolete files)
4.50 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
The new prompting backend will throw the JavaScript error "domWin is null" (from nsPrompter.js line 391) in some instances. If the given domWin is null ModalPrompter.openPrompt resorts to Services.ww.activeWindow, which would also be null on startup and possibly also when called from other odd places. (I was also getting this when called by a pref listener)
Reporter | ||
Comment 1•15 years ago
|
||
Here's a minimal testcase for the startup prompt error. Will give a prompt on startup under Firefox 3.6 and an error console message under current Trunk.
Comment 2•15 years ago
|
||
Looks like the only code that actually relies on a non-null domWin is dead code - fireEvent isn't called, and winUtils is unused (and removed by the WIP patch in bug 573649).
Comment 3•15 years ago
|
||
Assignee | ||
Comment 4•15 years ago
|
||
Assignee: gavin.sharp → dolske
Attachment #453160 -
Attachment is obsolete: true
Attachment #453543 -
Attachment is obsolete: true
Attachment #453557 -
Flags: review?(gavin.sharp)
Attachment #453543 -
Flags: review?(dolske)
Assignee | ||
Updated•15 years ago
|
Attachment #453557 -
Attachment is patch: true
Attachment #453557 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Comment 5•15 years ago
|
||
Bah, we were both working on this. Mine added a test, though. So neener-neener. ;-)
Comment 6•15 years ago
|
||
Comment on attachment 453557 [details] [diff] [review]
Patch v.1
>diff --git a/toolkit/components/prompts/src/nsPrompter.js b/toolkit/components/prompts/src/nsPrompter.js
> openPrompt : function (uri, args) {
>+ // XXX domWin may still be null here if there are _no_ windows open.
Don't think this is necessary (or at least not the "XXX" marker)
>diff --git a/toolkit/components/prompts/test/test_modal_prompts.html b/toolkit/components/prompts
>+// ===== test 29 =====
>+// Alert, no window
>+testNum++;
>+startCallbackTimer();
>+prompter.alert(null, "TestTitle", "This is the alert text.");
>+ok(didDialog, "handleDialog was invoked");
This doesn't actually cover the current failure case here, does it? I would expect activeWindow to be non-null when these tests are running. Doesn't hurt to add it anyways, though.
Attachment #453557 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 7•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
OS: Linux → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a6
Assignee | ||
Comment 8•15 years ago
|
||
(In reply to comment #6)
> >+ok(didDialog, "handleDialog was invoked");
>
> This doesn't actually cover the current failure case here, does it? I would
> expect activeWindow to be non-null when these tests are running. Doesn't hurt
> to add it anyways, though.
Oops, saw you comments after the push. :/
Yeah, the tests don't test this particular failure (and I'm not too sure how they could). But I did make sure they catch it if a future change removes the "if no domWin then use activeWindow" code, and it's good to have at least one case of window == null in the test.
You need to log in
before you can comment on or make changes to this bug.
Description
•