Bug 1119243 - The LineGraph should always show the gutter, even if arrows are disabled for tooltips, r=jsantell
authorVictor Porof <vporof@mozilla.com>
Sun, 11 Jan 2015 12:56:30 -0500
changeset 240008 ec51aa2aaefd02b5fd15c12890f5abfcdebe546e
parent 240007 8f5999879de82c176ef9d90a43ddb67b7834e046
child 240009 062050b11b10c12fa54246f3080db4595916e34a
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell
bugs1119243
milestone37.0a1
Bug 1119243 - The LineGraph should always show the gutter, even if arrows are disabled for tooltips, r=jsantell
browser/devtools/shared/test/browser_graphs-09b.js
browser/devtools/shared/widgets/Graphs.jsm
browser/themes/shared/devtools/widgets.inc.css
--- a/browser/devtools/shared/test/browser_graphs-09b.js
+++ b/browser/devtools/shared/test/browser_graphs-09b.js
@@ -26,18 +26,18 @@ function* performTest() {
 
   graph.destroy();
   host.destroy();
 }
 
 function* testGraph(graph) {
   yield graph.setDataWhenReady(TEST_DATA);
 
-  is(graph._gutter.hidden, true,
-    "The gutter should be hidden because the tooltips don't have arrows.");
+  is(graph._gutter.hidden, false,
+    "The gutter should be visible even if the tooltips don't have arrows.");
   is(graph._maxTooltip.hidden, false,
     "The max tooltip should not be hidden.");
   is(graph._avgTooltip.hidden, false,
     "The avg tooltip should not be hidden.");
   is(graph._minTooltip.hidden, false,
     "The min tooltip should not be hidden.");
 
   is(graph._maxTooltip.getAttribute("with-arrows"), "false",
--- a/browser/devtools/shared/widgets/Graphs.jsm
+++ b/browser/devtools/shared/widgets/Graphs.jsm
@@ -1451,17 +1451,17 @@ LineGraphWidget.prototype = Heritage.ext
     this._maxTooltip.setAttribute("with-arrows", this.withTooltipArrows);
     this._avgTooltip.setAttribute("with-arrows", this.withTooltipArrows);
     this._minTooltip.setAttribute("with-arrows", this.withTooltipArrows);
 
     let distanceMinMax = Math.abs(maxTooltipTop - minTooltipTop);
     this._maxTooltip.hidden = this._showMax === false || !totalTicks || distanceMinMax < LINE_GRAPH_MIN_MAX_TOOLTIP_DISTANCE;
     this._avgTooltip.hidden = this._showAvg === false || !totalTicks;
     this._minTooltip.hidden = this._showMin === false || !totalTicks;
-    this._gutter.hidden = (this._showMin === false && this._showMax === false) || !totalTicks || !this.withTooltipArrows;
+    this._gutter.hidden = (this._showMin === false && this._showAvg === false && this._showMax === false) || !totalTicks;
 
     this._maxGutterLine.hidden = this._showMax === false;
     this._avgGutterLine.hidden = this._showAvg === false;
     this._minGutterLine.hidden = this._showMin === false;
   },
 
   /**
    * Creates the gutter node when constructing this graph.
--- a/browser/themes/shared/devtools/widgets.inc.css
+++ b/browser/themes/shared/devtools/widgets.inc.css
@@ -930,36 +930,24 @@
 }
 
 .line-graph-widget-tooltip[arrow=end][with-arrows=true]::before {
   -moz-border-start: 3px solid rgba(255,255,255,0.75);
   right: -3px;
 }
 
 .line-graph-widget-tooltip[type=maximum] {
-  left: -1px;
+  left: 14px;
 }
 
 .line-graph-widget-tooltip[type=minimum] {
-  left: -1px;
+  left: 14px;
 }
 
 .line-graph-widget-tooltip[type=average] {
-  right: -1px;
-}
-
-.line-graph-widget-tooltip[type=maximum][with-arrows=true] {
-  left: 14px;
-}
-
-.line-graph-widget-tooltip[type=minimum][with-arrows=true] {
-  left: 14px;
-}
-
-.line-graph-widget-tooltip[type=average][with-arrows=true] {
   right: 4px;
 }
 
 .line-graph-widget-tooltip > [text=info] {
   color: #18191a;
 }
 
 .line-graph-widget-tooltip > [text=value] {