bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Theme dropdowns allow selecting of item with no content



4 years ago
2 years ago


(Reporter: Mic, Unassigned)




(1 attachment)



4 years ago
*** Original post on bio 463 at 2010-08-02 08:31:00 UTC ***

Using the keyboard and a collapsed drop down menu it is possible to select an item in the Message Style and Emoticon Theme boxes that has no label/value.
Occurs only if no additional themes are installed, so most likely the "no themes installed" item.

Effects: doesn't break display of preview if only cylced though, breaks style if saved.

Error console gives following error when saving the "empty style" and opening the Options dialog again: 
"Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIIOService.newChannel]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///<Instantbird path>/modules/imThemes.jsm :: getInfoPlistContent :: line 187"  data: no]
Source File: file:///<Instantbird path>/modules/imThemes.jsm
Line: 201"

Comment 1

4 years ago
*** Original post on bio 463 at 2010-08-02 12:34:33 UTC ***

There's a bug on this in the Mozilla bugtracker: https://bugzilla.mozilla.org/show_bug.cgi?id=302060.

Still we should think about a solution, e.g. checking if the choice is valid before saving the "theme" preference.
See Also: → bug 302060

Comment 2

4 years ago
Created attachment 8352077 [details] [diff] [review]
Patch v1

*** Original post on bio 463 as attmnt 336 at 2010-08-24 19:27:00 UTC ***

This patch saves the old selected theme names of messagestyle and emoticon themes and will restore them if an empty value is detected "on select".
Attachment #8352077 - Flags: review?(florian)


4 years ago
Assignee: nobody → benediktp

Comment 3

4 years ago
*** Original post on bio 463 at 2010-08-24 21:09:04 UTC ***

Some comments on the code:

// Here we store the name of the latest valid selected theme
previousThemeValue: "",

currentThemeChanged: function() {
  if (!this._loaded)

  // Element with id="themename" is the menulist
  let themeName = document.getElementById("themename");

  let currentTheme = themeName.value;

  // If there's no current value, then we have hit the disabled item ('no other themes installed' or the separator if that is possible at all)
  if (!currentTheme) {
    // Set back to previous value, will fire new 'select'-event and stop here
    themeName.value = this.previousThemeValue;

  // Update preview only if the theme has changed, this prevents flickering if 
  //  someone keeps the up- or down-key pressed. (Due to the nature of the fix, 
  //  it won't jump from start to end of the list, but stop at top and at bottom)
  if(this.previousThemeValue != themeName.value)
  // Everything is fine now, the current theme is valid, set it as new fallback
  this.previousThemeValue = themeName.value;
*** Original post on bio 463 at 2010-09-13 17:04:37 UTC ***

Can you still reproduce this on a nightly using Mozilla2?

Comment 5

4 years ago
*** Original post on bio 463 at 2010-09-13 17:43:18 UTC ***



4 years ago
OS: Windows XP → All
Hardware: x86 → All
Comment on attachment 8352077 [details] [diff] [review]
Patch v1

*** Original change on bio 463 attmnt 336 at 2010-12-16 09:35:20 UTC ***

I haven't really looked at this patch, but I have a feeling we should try to understand and fix the Mozilla real bug first, before deciding we want to clutter our code with a workaround.
Mic agreed over IRC.
Attachment #8352077 - Flags: review?(florian) → review-


4 years ago

Comment 7

2 years ago
Mass-removing myself from being assignee of any Chat related bug as I'm no longer active.
Assignee: benediktp → nobody
You need to log in before you can comment on or make changes to this bug.