context: function updatePageStyles(evt){  // XXX - Accessing window.content.document can generate an  // onLocationChange for the current tab, this can cause the url  // bar to be cleared. Prevent that happening by setting the clear  // state to false for the duration of this function.  var browser = getBrowser().selectedBrowser;  var userTypedClear = browser.userTypedClear;  browser.userTypedClear = false;  if (!gPageStyleButton)    gPageStyleButton = document.getElementById("page-theme-button");  var hasAltSS = false;  var stylesheets = window.content.document.styleSheets;  var preferredSheet = window.content.document.preferredStylesheetSet;  for (var i = 0; i < stylesheets.length; ++i) {    var currentStyleSheet = stylesheets[i];        if (currentStyleSheet.title && currentStyleSheet.title != preferredSheet) {        // Skip any stylesheets that don't match the screen media type.        var media = currentStyleSheet.media.mediaText.toLowerCase();        if (media && (media.indexOf("screen") == -1) && (media.indexOf("all") == -1))            continue;        hasAltSS = true;        break;    }  }  if (hasAltSS) {    gPageStyleButton.setAttribute("themes", "true");    // FIXME: Do a first-time explanation of page styles here perhaps?    // Avoid for now since Firebird's default home page has an alt sheet.  }  else    gPageStyleButton.removeAttribute("themes");  // Restore clear state  browser.userTypedClear = userTypedClear;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/2fb9feaadc992e3ccd442db789244b253d0427f8/browser.js/buggy/browser/base/content/browser.js