B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * on popup windows, the XULWindow's attributes seem not to be set correctly
   * we use thus JSDOMWindow attributes for sizemode and normal window attributes
   * (and hope for reasonable values when maximized/minimized - since then
   * outerWidth/outerHeight aren't the dimensions of the restored window)
   * @param aWindow
   *        Window reference
   * @param aAttribute
   *        String sizemode | width | height | other window attribute
   * @returns string
   */
on popup windows, the XULWindow's attributes seem not to be set correctly
we use thus JSDOMWindow attributes for sizemode and normal window attributes
(and hope for reasonable values when maximized/minimized - since then
outerWidth/outerHeight aren't the dimensions of the restored window)
@param aWindow
Window reference
@param aAttribute
String sizemode | width | height | other window attribute
@returns string
on popup windows the XULWindow ' s attributes seem not to be set correctly we use thus JSDOMWindow attributes for sizemode and normal window attributes ( and hope for reasonable values when maximized / minimized - since then outerWidth / outerHeight aren ' t the dimensions of the restored window ) @param aWindow Window reference @param aAttribute String sizemode | width | height | other window attribute @returns string
function ssi_getWindowDimension(aWindow, aAttribute) {
    if (aAttribute == "sizemode") {
      switch (aWindow.windowState) {
      case aWindow.STATE_FULLSCREEN:
      case aWindow.STATE_MAXIMIZED:
        return "maximized";
      case aWindow.STATE_MINIMIZED:
        return "minimized";
      default:
        return "normal";
      }
    }
    var dimension;
    switch (aAttribute) {
    case "width":
      dimension = aWindow.outerWidth;
      break;
    case "height":
      dimension = aWindow.outerHeight;
      break;
    default:
      dimension = aAttribute in aWindow ? aWindow[aAttribute] : "";
      break;
    }
    if (aWindow.windowState == aWindow.STATE_NORMAL) {
      return dimension;
    }
    return aWindow.document.documentElement.getAttribute(aAttribute) || dimension;
  }
function ssi_getWindowDimension ( aWindow , aAttribute ) { if ( aAttribute == "sizemode" ) { switch ( aWindow . windowState ) { case aWindow . STATE_FULLSCREEN : case aWindow . STATE_MAXIMIZED : return "maximized" ; case aWindow . STATE_MINIMIZED : return "minimized" ; default : return "normal" ; } } var dimension ; switch ( aAttribute ) { case "width" : dimension = aWindow . outerWidth ; break ; case "height" : dimension = aWindow . outerHeight ; break ; default : dimension = aAttribute in aWindow ? aWindow [ aAttribute ] : "" ; break ; } if ( aWindow . windowState == aWindow . STATE_NORMAL ) { return dimension ; } return aWindow . document . documentElement . getAttribute ( aAttribute ) || dimension ; }
on popup windows, the XULWindow's attributes seem not to be set correctly
 we use thus JSDOMWindow attributes for sizemode and normal window attributes
 (and hope for reasonable values when maximized/minimized - since then
 outerWidth/outerHeight aren't the dimensions of the restored window)
 @param aWindow
        Window reference
 @param aAttribute
        String sizemode | width | height | other window attribute
 @returns string
on popup windows the XULWindow ' s attributes seem not to be set correctly we use thus JSDOMWindow attributes for sizemode and normal window attributes ( and hope for reasonable values when maximized / minimized - since then outerWidth / outerHeight aren ' t the dimensions of the restored window ) @param aWindow Window reference @param aAttribute String sizemode | width | height | other window attribute @returns string