B2G/gecko/browser/devtools/responsivedesign/responsivedesign.jsm
/**
   * Change the size of the browser.
   *
   * @param aWidth width of the browser.
   * @param aHeight height of the browser.
   */
Change the size of the browser.
@param aWidth width of the browser.
@param aHeight height of the browser.
Change the size of the browser . @param aWidth width of the browser . @param aHeight height of the browser .
function RUI_setSize(aWidth, aHeight) {
    aWidth = Math.min(Math.max(aWidth, MIN_WIDTH), MAX_WIDTH);
    aHeight = Math.min(Math.max(aHeight, MIN_HEIGHT), MAX_WIDTH);
    let style = "max-width: %width;" +
                "min-width: %width;" +
                "max-height: %height;" +
                "min-height: %height;";
    style = style.replace(/%width/g, aWidth + "px");
    style = style.replace(/%height/g, aHeight + "px");
    this.stack.setAttribute("style", style);
    if (!this.ignoreY)
      this.resizeBar.setAttribute("top", Math.round(aHeight / 2));
    let selectedPreset = this.menuitems.get(this.selectedItem);
    if (selectedPreset.custom) {
      selectedPreset.width = aWidth;
      selectedPreset.height = aHeight;
      this.setMenuLabel(this.selectedItem, selectedPreset);
    }
  }
function RUI_setSize ( aWidth , aHeight ) { aWidth = Math . min ( Math . max ( aWidth , MIN_WIDTH ) , MAX_WIDTH ) ; aHeight = Math . min ( Math . max ( aHeight , MIN_HEIGHT ) , MAX_WIDTH ) ; let style = "max-width: %width;" + "min-width: %width;" + "max-height: %height;" + "min-height: %height;" ; style = style . replace ( / %width / g , aWidth + "px" ) ; style = style . replace ( / %height / g , aHeight + "px" ) ; this . stack . setAttribute ( "style" , style ) ; if ( ! this . ignoreY ) this . resizeBar . setAttribute ( "top" , Math . round ( aHeight / 2 ) ) ; let selectedPreset = this . menuitems . get ( this . selectedItem ) ; if ( selectedPreset . custom ) { selectedPreset . width = aWidth ; selectedPreset . height = aHeight ; this . setMenuLabel ( this . selectedItem , selectedPreset ) ; } }
Change the size of the browser.
Change the size of the browser .
// We resize the containing stack. // We uptate the custom menuitem if we are using it