Bug 620506 - Remove debugging rect code r=ian
authorRaymond Lee <raymond@raysquare.com>
Tue, 05 Apr 2011 18:05:01 +0800
changeset 67582 47cb90cc497c8c3575e7952a65dd84c55327f7db
parent 67581 06126c87665912448577a17d3ec1daa0c0f46c3c
child 67583 9bed272173d879b1ae7979afcec17cd0ec8631bc
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersian
bugs620506
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 620506 - Remove debugging rect code r=ian
browser/base/content/tabview/groupitems.js
browser/base/content/tabview/items.js
browser/base/content/tabview/tabitems.js
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -244,19 +244,16 @@ function GroupItem(listOfEls, options) {
 
   // ___ Undo Close
   this.$undoContainer = null;
   this._undoButtonTimeoutId = null;
 
   // ___ Superclass initialization
   this._init($container[0]);
 
-  if (this.$debug)
-    this.$debug.css({zIndex: -1000});
-
   // ___ Children
   Array.prototype.forEach.call(listOfEls, function(el) {
     self.add(el, options);
   });
 
   // ___ Finish Up
   this._addHandlers($container);
 
@@ -595,33 +592,29 @@ GroupItem.prototype = Utils.extend(new I
     }
 
     if (css.width) {      
       this.adjustTitleSize();
     }
 
     UI.clearShouldResizeItems();
 
-    this._updateDebugBounds();
     this.setTrenches(rect);
 
     this.save();
   },
 
   // ----------
   // Function: setZ
   // Set the Z order for the groupItem's container, as well as its children.
   setZ: function GroupItem_setZ(value) {
     this.zIndex = value;
 
     iQ(this.container).css({zIndex: value});
 
-    if (this.$debug)
-      this.$debug.css({zIndex: value + 1});
-
     var count = this._children.length;
     if (count) {
       var topZIndex = value + count + 1;
       var zIndex = topZIndex;
       var self = this;
       this._children.forEach(function(child) {
         if (child == self.topChild)
           child.setZ(topZIndex + 1);
--- a/browser/base/content/tabview/items.js
+++ b/browser/base/content/tabview/items.js
@@ -67,25 +67,16 @@ function Item() {
   // The position and size of this Item, represented as a <Rect>.
   // This should never be modified without using setBounds()
   this.bounds = null;
 
   // Variable: zIndex
   // The z-index for this item.
   this.zIndex = 0;
 
-  // Variable: debug
-  // When set to true, displays a rectangle on the screen that corresponds with bounds.
-  // May be used for additional debugging features in the future.
-  this.debug = false;
-
-  // Variable: $debug
-  // If <debug> is true, this will be the iQ object for the visible rectangle.
-  this.$debug = null;
-
   // Variable: container
   // The outermost DOM element that describes this item on screen.
   this.container = null;
 
   // Variable: parent
   // The groupItem that this item is a child of
   this.parent = null;
 
@@ -149,26 +140,16 @@ Item.prototype = {
     Utils.assert(typeof this.close == 'function', 'Subclass must provide close');
     Utils.assert(typeof this.save == 'function', 'Subclass must provide save');
     Utils.assert(Utils.isPoint(this.defaultSize), 'Subclass must provide defaultSize');
     Utils.assert(Utils.isRect(this.bounds), 'Subclass must provide bounds');
 
     this.container = container;
     this.$container = iQ(container);
 
-    if (this.debug) {
-      this.$debug = iQ('<div>')
-        .css({
-          border: '2px solid green',
-          zIndex: -10,
-          position: 'absolute'
-        })
-        .appendTo('body');
-    }
-
     iQ(this.container).data('item', this);
 
     // ___ drag
     this.dragOptions = {
       cancelClass: 'close stackExpander',
       start: function(e, ui) {
         if (this.isAGroupItem) {
           GroupItems.setActiveGroupItem(this);
@@ -506,26 +487,16 @@ Item.prototype = {
       var bounds = data.bounds;
       if (!bounds.equals(data.startBounds)) {
         item.setBounds(bounds, immediately);
       }
     });
   },
 
   // ----------
-  // Function: _updateDebugBounds
-  // Called by a subclass when its bounds change, to update the debugging rectangles on screen.
-  // This functionality is enabled only by the debug property.
-  _updateDebugBounds: function Item__updateDebugBounds() {
-    if (this.$debug) {
-      this.$debug.css(this.bounds);
-    }
-  },
-
-  // ----------
   // Function: setTrenches
   // Sets up/moves the trenches for snapping to this item.
   setTrenches: function Item_setTrenches(rect) {
     if (this.parent !== null)
       return;
 
     if (!this.borderTrenches)
       this.borderTrenches = Trenches.registerWithItem(this,"border");
--- a/browser/base/content/tabview/tabitems.js
+++ b/browser/base/content/tabview/tabitems.js
@@ -197,17 +197,16 @@ function TabItem(tab, options) {
     } else {
       if (!Items.item(this).isDragging)
         self.zoomIn();
     }
   });
 
   this.setResizable(true, options.immediately);
   this.droppable(true);
-  this._updateDebugBounds();
 
   TabItems.register(this);
 
   // ___ reconnect to data from Storage
   if (!TabItems.reconnectingPaused())
     this._reconnect();
 };
 
@@ -519,17 +518,16 @@ TabItem.prototype = Utils.extend(new Ite
        "border-color": "rgba(0,0,0,"+ alphaRange.scale(proportion) +")",
       });
     }
 
     this._hasBeenDrawn = true;
 
     UI.clearShouldResizeItems();
 
-    this._updateDebugBounds();
     rect = this.getBounds(); // ensure that it's a <Rect>
 
     if (!Utils.isRect(this.bounds))
       Utils.trace('TabItem.setBounds: this.bounds is not a real rectangle!', this.bounds);
 
     if (!this.parent && this.tab.parentNode != null)
       this.setTrenches(rect);