B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * determine the title of the currently enabled style sheet (if any)
   * and recurse through the frameset if necessary
   * @param   aContent is a frame reference
   * @returns the title style sheet determined to be enabled (empty string if none)
   */
determine the title of the currently enabled style sheet (if any)
and recurse through the frameset if necessary
@param   aContent is a frame reference
@returns the title style sheet determined to be enabled (empty string if none)
determine the title of the currently enabled style sheet ( if any ) and recurse through the frameset if necessary @param aContent is a frame reference @returns the title style sheet determined to be enabled ( empty string if none )
function ssi_getSelectedPageStyle(aContent) {
    const forScreen = /(?:^|,)\s*(?:all|screen)\s*(?:,|$)/i;
    for (let i = 0; i < aContent.document.styleSheets.length; i++) {
      let ss = aContent.document.styleSheets[i];
      let media = ss.media.mediaText;
      if (!ss.disabled && ss.title && (!media || forScreen.test(media)))
        return ss.title
    }
    for (let i = 0; i < aContent.frames.length; i++) {
      let selectedPageStyle = this._getSelectedPageStyle(aContent.frames[i]);
      if (selectedPageStyle)
        return selectedPageStyle;
    }
    return "";
  }
function ssi_getSelectedPageStyle ( aContent ) { const forScreen = / (?:^|,)\s*(?:all|screen)\s*(?:,|$) / i ; for ( let i = 0 ; i < aContent . document . styleSheets . length ; i ++ ) { let ss = aContent . document . styleSheets [ i ] ; let media = ss . media . mediaText ; if ( ! ss . disabled && ss . title && ( ! media || forScreen . test ( media ) ) ) return ss . title } for ( let i = 0 ; i < aContent . frames . length ; i ++ ) { let selectedPageStyle = this . _getSelectedPageStyle ( aContent . frames [ i ] ) ; if ( selectedPageStyle ) return selectedPageStyle ; } return "" ; }
determine the title of the currently enabled style sheet (if any)
 and recurse through the frameset if necessary
 @param   aContent is a frame reference
 @returns the title style sheet determined to be enabled (empty string if none)
determine the title of the currently enabled style sheet ( if any ) and recurse through the frameset if necessary @param aContent is a frame reference @returns the title style sheet determined to be enabled ( empty string if none )