Bug 985555 - Fix inspector loading when browsing a tab history r=bgrins
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 24 Mar 2014 11:53:00 +0100
changeset 175420 85244371da5db5c7be63f76249bcc31ecb82c572
parent 175419 dff900f56c49cba46f59e89a792e984c868e1fcc
child 175421 9c128455092caad1d93a0734c046b7fe66e1fa5e
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbgrins
bugs985555
milestone31.0a1
Bug 985555 - Fix inspector loading when browsing a tab history r=bgrins
browser/devtools/inspector/inspector-panel.js
--- a/browser/devtools/inspector/inspector-panel.js
+++ b/browser/devtools/inspector/inspector-panel.js
@@ -620,32 +620,31 @@ InspectorPanel.prototype = {
 
     // create tool iframe
     this._markupFrame = doc.createElement("iframe");
     this._markupFrame.setAttribute("flex", "1");
     this._markupFrame.setAttribute("tooltip", "aHTMLTooltip");
     this._markupFrame.setAttribute("context", "inspector-node-popup");
 
     // This is needed to enable tooltips inside the iframe document.
-    this._boundMarkupFrameLoad = function InspectorPanel_initMarkupPanel_onload() {
-      this._markupFrame.contentWindow.focus();
-      this._onMarkupFrameLoad();
-    }.bind(this);
+    this._boundMarkupFrameLoad = this._onMarkupFrameLoad.bind(this);
     this._markupFrame.addEventListener("load", this._boundMarkupFrameLoad, true);
 
-    this._markupBox.setAttribute("hidden", true);
+    this._markupBox.setAttribute("collapsed", true);
     this._markupBox.appendChild(this._markupFrame);
     this._markupFrame.setAttribute("src", "chrome://browser/content/devtools/markup-view.xhtml");
   },
 
   _onMarkupFrameLoad: function InspectorPanel__onMarkupFrameLoad() {
     this._markupFrame.removeEventListener("load", this._boundMarkupFrameLoad, true);
     delete this._boundMarkupFrameLoad;
 
-    this._markupBox.removeAttribute("hidden");
+    this._markupFrame.contentWindow.focus();
+
+    this._markupBox.removeAttribute("collapsed");
 
     let controllerWindow = this._toolbox.doc.defaultView;
     this.markup = new MarkupView(this, this._markupFrame, controllerWindow);
 
     this.emit("markuploaded");
   },
 
   _destroyMarkup: function InspectorPanel__destroyMarkup() {