Bug 950656 - The separator string between the headers name and value isn't shown, r=past
authorVictor Porof <vporof@mozilla.com>
Wed, 18 Dec 2013 19:01:38 +0200
changeset 161087 8ac6db4d1199c3602387b4732a1ea3c207c05aea
parent 161086 4053bdc8e0c0fb54e9db9e231c22f2e28ea1c0ab
child 161088 e472c39cc2bbe9fa5391bf74b5905614228a613a
push id25867
push userryanvm@gmail.com
push dateThu, 19 Dec 2013 02:19:33 +0000
treeherdermozilla-central@04a70c8908de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs950656
milestone29.0a1
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 950656 - The separator string between the headers name and value isn't shown, r=past
browser/devtools/debugger/test/browser_dbg_variables-view-05.js
browser/devtools/netmonitor/netmonitor-view.js
browser/devtools/shared/widgets/VariablesView.jsm
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-05.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-05.js
@@ -12,25 +12,45 @@ function test() {
     let variables = aPanel.panelWin.DebuggerView.Variables;
 
     let globalScope = variables.addScope("Test-Global");
     let localScope = variables.addScope("Test-Local");
 
     ok(globalScope, "The globalScope hasn't been created correctly.");
     ok(localScope, "The localScope hasn't been created correctly.");
 
+    is(globalScope.target.querySelector(".separator"), null,
+      "No separator string should be created for scopes (1).");
+    is(localScope.target.querySelector(".separator"), null,
+      "No separator string should be created for scopes (2).");
+
     let windowVar = globalScope.addItem("window");
     let documentVar = globalScope.addItem("document");
 
     ok(windowVar, "The windowVar hasn't been created correctly.");
     ok(documentVar, "The documentVar hasn't been created correctly.");
 
+    ok(windowVar.target.querySelector(".separator").hidden,
+      "No separator string should be shown for variables without a grip (1).");
+    ok(documentVar.target.querySelector(".separator").hidden,
+      "No separator string should be shown for variables without a grip (2).");
+
     windowVar.setGrip({ type: "object", class: "Window" });
     documentVar.setGrip({ type: "object", class: "HTMLDocument" });
 
+    is(windowVar.target.querySelector(".separator").hidden, false,
+      "A separator string should now be shown after setting the grip (1).");
+    is(documentVar.target.querySelector(".separator").hidden, false,
+      "A separator string should now be shown after setting the grip (2).");
+
+    is(windowVar.target.querySelector(".separator").getAttribute("value"), ": ",
+      "The separator string label is correct (1).");
+    is(documentVar.target.querySelector(".separator").getAttribute("value"), ": ",
+      "The separator string label is correct (2).");
+
     let localVar0 = localScope.addItem("localVar0");
     let localVar1 = localScope.addItem("localVar1");
     let localVar2 = localScope.addItem("localVar2");
     let localVar3 = localScope.addItem("localVar3");
     let localVar4 = localScope.addItem("localVar4");
     let localVar5 = localScope.addItem("localVar5");
 
     let localVar6 = localScope.addItem("localVar6");
--- a/browser/devtools/netmonitor/netmonitor-view.js
+++ b/browser/devtools/netmonitor/netmonitor-view.js
@@ -1745,18 +1745,17 @@ NetworkDetailsView.prototype = {
     let kb = aResponse.headersSize / 1024;
     let size = L10N.numberWithDecimals(kb, HEADERS_SIZE_DECIMALS);
     let text = L10N.getFormatStr("networkMenu.sizeKB", size);
     let headersScope = this._headers.addScope(aName + " (" + text + ")");
     headersScope.expanded = true;
 
     return promise.all(aResponse.headers.map(header => {
       let headerVar = headersScope.addItem(header.name, {}, true);
-      return gNetwork.getString(header.value)
-             .then(aString => headerVar.setGrip(aString));
+      return gNetwork.getString(header.value).then(aString => headerVar.setGrip(aString));
     }));
   },
 
   /**
    * Sets the network request cookies shown in this view.
    *
    * @param object aResponse
    *        The message received from the server.
--- a/browser/devtools/shared/widgets/VariablesView.jsm
+++ b/browser/devtools/shared/widgets/VariablesView.jsm
@@ -2366,16 +2366,17 @@ Variable.prototype = Heritage.extend(Sco
       this._valueLabel.classList.remove(VariablesView.getClass(prevGrip));
     }
     this._valueGrip = aGrip;
     this._valueString = VariablesView.getString(aGrip, true);
     this._valueClassName = VariablesView.getClass(aGrip);
 
     this._valueLabel.classList.add(this._valueClassName);
     this._valueLabel.setAttribute("value", this._valueString);
+    this._separatorLabel.hidden = false;
   },
 
   /**
    * Marks this variable as overridden.
    *
    * @param boolean aFlag
    *        Whether this variable is overridden or not.
    */
@@ -2449,17 +2450,17 @@ Variable.prototype = Heritage.extend(Sco
    * Creates the necessary nodes for this variable.
    */
   _displayVariable: function() {
     let document = this.document;
     let descriptor = this._initialDescriptor;
 
     let separatorLabel = this._separatorLabel = document.createElement("label");
     separatorLabel.className = "plain separator";
-    separatorLabel.setAttribute("value", this.ownerView.separatorStr + " ");
+    separatorLabel.setAttribute("value", this.separatorStr + " ");
 
     let valueLabel = this._valueLabel = document.createElement("label");
     valueLabel.className = "plain value";
     valueLabel.setAttribute("crop", "center");
 
     let spacer = this._spacer = document.createElement("spacer");
     spacer.setAttribute("optional-visibility", "");
     spacer.setAttribute("flex", "1");