rem: var strDefaultFontFace = ""; var fontName; while (aDataObject.hasMoreElements()) { fontName = aDataObject.getNext(); fontName = fontName.QueryInterface(Components.interfaces.nsISupportsString); var fontNameStr = fontName.toString(); if (strDefaultFontFace == "") strDefaultFontFace = fontNameStr; var itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "value", fontNameStr ); itemNode.setAttribute( "label", fontNameStr ); popupNode.appendChild( itemNode ); } if (strDefaultFontFace != "") { this.listElement.removeAttribute( "disabled" ); } else { this.listElement.setAttribute( "value", strDefaultFontFace ); this.listElement.setAttribute( "label", gPrefutilitiesBundle.getString("nofontsforlang") ); this.listElement.setAttribute( "disabled", "true" ); } 
add: if (fonts.length > 0) {  if (defaultFont) { var label = gPrefutilitiesBundle .getString("labelDefaultFont") .replace(/%font_family%/, defaultFont); itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "label", label ); itemNode.setAttribute( "value", "" ); popupNode.appendChild( itemNode );  separatorNode = document.createElement( "menuseparator" ); popupNode.appendChild( separatorNode ); }  for (i = 0; i < fonts.length; i++) { itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "value", fonts[i] ); itemNode.setAttribute( "label", fonts[i] ); popupNode.appendChild( itemNode ); } }   if (!globalFonts) { globalFonts = getFontEnumerator().EnumerateAllFonts( count ); }     if (globalFonts.length > fonts.length) { var menuItem = separatorNode ? separatorNode.nextSibling : popupNode.firstChild; var menuValue = menuItem ? menuItem.getAttribute( "value" ) : null;  separatorNode = document.createElement( "menuseparator" ); popupNode.appendChild( separatorNode ); for (i = 0; i < globalFonts.length; i++) { if (globalFonts[i] != menuValue) { itemNode = document.createElement( "menuitem" ); itemNode.setAttribute( "value", globalFonts[i] ); itemNode.setAttribute( "label", globalFonts[i] ); popupNode.appendChild( itemNode ); } else { menuItem = menuItem.nextSibling; menuValue = menuItem ? menuItem.getAttribute( "value" ) : null; } } }  
context:     appendFontNames:       function ( aDataObject )         {           var popupNode = document.createElement( "menupopup" );           var strDefaultFontFace = "";          var fontName;          while (aDataObject.hasMoreElements()) {            fontName = aDataObject.getNext();            fontName = fontName.QueryInterface(Components.interfaces.nsISupportsString);            var fontNameStr = fontName.toString();            if (strDefaultFontFace == "")              strDefaultFontFace = fontNameStr;            var itemNode = document.createElement( "menuitem" );            itemNode.setAttribute( "value", fontNameStr );            itemNode.setAttribute( "label", fontNameStr );            popupNode.appendChild( itemNode );          }          if (strDefaultFontFace != "") {            this.listElement.removeAttribute( "disabled" );          } else {            this.listElement.setAttribute( "value", strDefaultFontFace );            this.listElement.setAttribute( "label",                                    gPrefutilitiesBundle.getString("nofontsforlang") );            this.listElement.setAttribute( "disabled", "true" );          }          this.listElement.appendChild( popupNode );           return strDefaultFontFace;        } 
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/adf8fc19dc18a62d513eccc7d367aeb4501cc987/pref-fonts.js/clean/browser/components/prefwindow/content/pref-fonts.js