Bug 1349335 - Use new colours for the grid cell and area fills. r?gl draft
authorMicah Tigley <tigleym@gmail.com>
Fri, 02 Jun 2017 22:49:26 -0600
changeset 588573 45751c0f12d6ca415cbfea3fb0fd2a0b1d13dea4
parent 588100 d35c5311aa72123eb5044bc2901fcd50fcb8357f
child 631621 c768de58c53496885e585ccfc559d1a1ca64cd86
push id62089
push userbmo:tigleym@gmail.com
push dateSat, 03 Jun 2017 04:50:07 +0000
reviewersgl
bugs1349335
milestone55.0a1
Bug 1349335 - Use new colours for the grid cell and area fills. r?gl MozReview-Commit-ID: 4etwnse2jZu
devtools/server/actors/highlighters.css
devtools/server/actors/highlighters/css-grid.js
--- a/devtools/server/actors/highlighters.css
+++ b/devtools/server/actors/highlighters.css
@@ -227,17 +227,17 @@
 }
 
 :-moz-native-anonymous .css-grid-regions {
   opacity: 0.6;
 }
 
 :-moz-native-anonymous .css-grid-areas,
 :-moz-native-anonymous .css-grid-cells {
-  fill: #CEC0ED;
+  opacity: 0.5;
   stroke: none;
 }
 
 :-moz-native-anonymous .css-grid-area-infobar-name,
 :-moz-native-anonymous .css-grid-cell-infobar-position,
 :-moz-native-anonymous .css-grid-line-infobar-number {
   color: hsl(285, 100%, 75%);
 }
--- a/devtools/server/actors/highlighters/css-grid.js
+++ b/devtools/server/actors/highlighters/css-grid.js
@@ -737,21 +737,28 @@ CssGridHighlighter.prototype = extend(Au
    * Update the highlighter on the current highlighted node (the one that was
    * passed as an argument to show(node)).
    * Should be called whenever node's geometry or grid changes.
    */
   _update() {
     setIgnoreLayoutChanges(true);
 
     let root = this.getElement("root");
+    let cells = this.getElement("cells");
+    let areas = this.getElement("areas");
+
     // Hide the root element and force the reflow in order to get the proper window's
     // dimensions without increasing them.
     root.setAttribute("style", "display: none");
     this.win.document.documentElement.offsetWidth;
 
+    // Set the grid cells and areas fill to the current grid colour.
+    cells.setAttribute("style", `fill: ${this.color}`);
+    areas.setAttribute("style", `fill: ${this.color}`);
+
     let { width, height } = this._winDimensions;
 
     // Updates the <canvas> element's position and size.
     // It also clear the <canvas>'s drawing context.
     this.updateCanvasElement();
 
     // Clear the grid area highlights.
     this.clearGridAreas();