B2G/gecko/browser/components/tabview/groupitems.js
//   force - true to always update the DOM even if the bounds haven't changed; default false
true to always update the DOM even if the bounds haven't changed; default false
true to always update the DOM even if the bounds haven ' t changed ; default false
function GroupItem_setBounds(inRect, immediately, options) {
      Utils.assert(Utils.isRect(inRect), 'GroupItem.setBounds: rect is not a real rectangle!');
    let validSize = GroupItems.calcValidSize(
      new Point(inRect.width, inRect.height));
    let rect = new Rect(inRect.left, inRect.top, validSize.x, validSize.y);
    if (!options)
      options = {};
    var titleHeight = this.$titlebar.height();
    var css = {};
    var titlebarCSS = {};
    var contentCSS = {};
    if (rect.left != this.bounds.left || options.force)
      css.left = rect.left;
    if (rect.top != this.bounds.top || options.force)
      css.top = rect.top;
    if (rect.width != this.bounds.width || options.force) {
      css.width = rect.width;
      titlebarCSS.width = rect.width;
      contentCSS.width = rect.width;
    }
    if (rect.height != this.bounds.height || options.force) {
      css.height = rect.height;
      contentCSS.height = rect.height - titleHeight;
    }
    if (Utils.isEmptyObject(css))
      return;
    var offset = new Point(rect.left - this.bounds.left, rect.top - this.bounds.top);
    this.bounds = new Rect(rect);
    if (css.width || css.height)
      this.adjustAppTabTray();
    if (css.width || css.height) {
      this.arrange({animate: !immediately}); 
    } else if (css.left || css.top) {
      this._children.forEach(function(child) {
        if (!child.getHidden()) {
          var box = child.getBounds();
          child.setPosition(box.left + offset.x, box.top + offset.y, immediately);
        }
      });
    }
    if (immediately) {
      iQ(this.container).css(css);
      this.$titlebar.css(titlebarCSS);
    } else {
      TabItems.pausePainting();
      iQ(this.container).animate(css, {
        duration: 350,
        easing: "tabviewBounce",
        complete: function() {
          TabItems.resumePainting();
        }
      });
      this.$titlebar.animate(titlebarCSS, {
        duration: 350
      });
    }
    UI.clearShouldResizeItems();
    this.setTrenches(rect);
    this.save();
  }
function GroupItem_setBounds ( inRect , immediately , options ) { Utils . assert ( Utils . isRect ( inRect ) , 'GroupItem.setBounds: rect is not a real rectangle!' ) ; let validSize = GroupItems . calcValidSize ( new Point ( inRect . width , inRect . height ) ) ; let rect = new Rect ( inRect . left , inRect . top , validSize . x , validSize . y ) ; if ( ! options ) options = { } ; var titleHeight = this . $titlebar . height ( ) ; var css = { } ; var titlebarCSS = { } ; var contentCSS = { } ; if ( rect . left != this . bounds . left || options . force ) css . left = rect . left ; if ( rect . top != this . bounds . top || options . force ) css . top = rect . top ; if ( rect . width != this . bounds . width || options . force ) { css . width = rect . width ; titlebarCSS . width = rect . width ; contentCSS . width = rect . width ; } if ( rect . height != this . bounds . height || options . force ) { css . height = rect . height ; contentCSS . height = rect . height - titleHeight ; } if ( Utils . isEmptyObject ( css ) ) return ; var offset = new Point ( rect . left - this . bounds . left , rect . top - this . bounds . top ) ; this . bounds = new Rect ( rect ) ; if ( css . width || css . height ) this . adjustAppTabTray ( ) ; if ( css . width || css . height ) { this . arrange ( { animate : ! immediately } ) ; } else if ( css . left || css . top ) { this . _children . forEach ( function ( child ) { if ( ! child . getHidden ( ) ) { var box = child . getBounds ( ) ; child . setPosition ( box . left + offset . x , box . top + offset . y , immediately ) ; } } ) ; } if ( immediately ) { iQ ( this . container ) . css ( css ) ; this . $titlebar . css ( titlebarCSS ) ; } else { TabItems . pausePainting ( ) ; iQ ( this . container ) . animate ( css , { duration : 350 , easing : "tabviewBounce" , complete : function ( ) { TabItems . resumePainting ( ) ; } } ) ; this . $titlebar . animate ( titlebarCSS , { duration : 350 } ) ; } UI . clearShouldResizeItems ( ) ; this . setTrenches ( rect ) ; this . save ( ) ; }
force - true to always update the DOM even if the bounds haven't changed; default false
force - true to always update the DOM even if the bounds haven ' t changed ; default false
// Validate and conform passed in size // ___ Determine what has changed // Make sure the AppTab icons fit the new groupItem size. // ___ Deal with children //(immediately ? 'sometimes' : true)}); // ___ Update our representation