Closed
Bug 1297707
Opened 8 years ago
Closed 8 years ago
TypeError prevents alert dialog to display icon
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
VERIFIED
FIXED
Firefox 51
Tracking | Status | |
---|---|---|
firefox51 | --- | verified |
People
(Reporter: spohl, Assigned: spohl)
Details
Attachments
(1 file, 1 obsolete file)
1.31 KB,
patch
|
Felipe
:
review+
|
Details | Diff | Splinter Review |
Run this code in the browser console:
> setTimeout(() => Services.prompt.alert(window, "Hi", null), 5000);
Expected:
An alert dialog appears with a yellow triangle and exclamation point as icon.
Actual:
No icon is displayed in the dialog and the following error is printed in the browser console:
TypeError: this.args.text is null[Learn More]CommonDialog.jsm:132:13
CommonDialog.prototype.onLoadresource://gre/modules/CommonDialog.jsm:132:13commonDialogOnLoadchrome://global/content/commonDialog.js:52:5<anonymous>chrome://global/content/commonDialog.xul:27:7openModalWindowfile:///Users/Stephen/Documents/objdir-ff-release/dist/Nightly.app/Contents/Resources/components/nsPrompter.js:364:5ModalPrompter.prototype.openPromptfile:///Users/Stephen/Documents/objdir-ff-release/dist/Nightly.app/Contents/Resources/components/nsPrompter.js:554:9ModalPrompter.prototype.alertfile:///Users/Stephen/Documents/objdir-ff-release/dist/Nightly.app/Contents/Resources/components/nsPrompter.js:603:9Prompter.prototype.alertfile:///Users/Stephen/Documents/objdir-ff-release/dist/Nightly.app/Contents/Resources/components/nsPrompter.js:59:9<anonymous>debugger eval code
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → spohl.mozilla.bugs
Assignee | ||
Comment 1•8 years ago
|
||
Felipe, I see you've reviewed some code in this file but please feel free to forward the review if needed. Thank you!
Attachment #8784371 -
Flags: review?(felipc)
Assignee | ||
Comment 2•8 years ago
|
||
Cleaned this up a bit.
Attachment #8784371 -
Attachment is obsolete: true
Attachment #8784371 -
Flags: review?(felipc)
Attachment #8784374 -
Flags: review?(felipc)
Comment 3•8 years ago
|
||
Comment on attachment 8784371 [details] [diff] [review] Patch Review of attachment 8784371 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, but I prefer this first version. This way the text node will always be created and the DOM structure will be the same. Is this just clean-up, or is there any motivation for it? When would someone call a prompt without text?
Attachment #8784371 -
Flags: review+
Updated•8 years ago
|
Attachment #8784371 -
Attachment is obsolete: false
Updated•8 years ago
|
Attachment #8784374 -
Flags: review?(felipc)
Assignee | ||
Comment 4•8 years ago
|
||
So, the following code (from comment 0) actually triggers this, and we then fail to show the icon: > setTimeout(() => Services.prompt.alert(window, "Hi", null), 5000); I thought "Hi" was the text in question here, but it doesn't appear to be or we wouldn't hit this.
Flags: needinfo?(felipc)
Comment 5•8 years ago
|
||
Oh, by looking at http://searchfox.org/mozilla-central/source/embedding/components/windowwatcher/nsIPromptService.idl#53 the text is the third parameter. "Hi" is the title. They appear visually similar :)
Flags: needinfo?(felipc)
Assignee | ||
Comment 6•8 years ago
|
||
Good point, thanks for clearing that up! :-) I also went ahead and confirmed that we don't run into this same issue if the title is null but the text is a valid string; we already handle that situation properly.
Assignee | ||
Comment 7•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a5657c5416cec71c7d589a7d67a2b7ceb2bad635 Bug 1297707: Show icons in alert dialogs when text is null. r=felipe
Comment 8•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a5657c5416ce
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Assignee | ||
Updated•8 years ago
|
Attachment #8784374 -
Attachment is obsolete: true
I have reproduced this bug with Nightly 51.0a1 (2016-08-24)on Windows 8.1 (64 Bit!). This bug's fix is verified on Latest Nightly 51.0a1. Build ID : 20160831030224 User Agent : Mozilla/5.0 (Windows NT 6.3; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 [bugday-20160831]
You need to log in
before you can comment on or make changes to this bug.
Description
•