Backed out changeset 26baf1ec73c6 (bug 1510023) for browser_flexbox_highlighter_color_picker_on_RETURN.js failures. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Wed, 28 Nov 2018 20:53:39 +0200
changeset 507833 c65733e28a7460151569a933ac8323ad067e5cee
parent 507832 88831b1697c46e7f5c15f1e6d1776874cf214421
child 507834 14624418e02365e7839c6ab3a17a950a6f065ea8
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1510023
milestone65.0a1
backs out26baf1ec73c631623eddf90e7b75cb4e2d3ac2de
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
Backed out changeset 26baf1ec73c6 (bug 1510023) for browser_flexbox_highlighter_color_picker_on_RETURN.js failures. CLOSED TREE
devtools/client/inspector/shared/highlighters-overlay.js
--- a/devtools/client/inspector/shared/highlighters-overlay.js
+++ b/devtools/client/inspector/shared/highlighters-overlay.js
@@ -8,20 +8,17 @@
 
 const Services = require("Services");
 const EventEmitter = require("devtools/shared/event-emitter");
 const {
   VIEW_NODE_VALUE_TYPE,
   VIEW_NODE_SHAPE_POINT_TYPE,
 } = require("devtools/client/inspector/shared/node-types");
 
-loader.lazyRequireGetter(this, "parseURL", "devtools/client/shared/source-utils", true);
-loader.lazyRequireGetter(this, "asyncStorage", "devtools/shared/async-storage");
-
-const DEFAULT_HIGHLIGHTER_COLOR = "#9400FF";
+const DEFAULT_GRID_COLOR = "#4B0082";
 
 /**
  * Highlighters overlay is a singleton managing all highlighters in the Inspector.
  */
 class HighlightersOverlay {
   /**
    * @param  {Inspector} inspector
    *         Inspector toolbox panel.
@@ -242,27 +239,23 @@ class HighlightersOverlay {
     if (node == this.shapesHighlighterShown) {
       const options = Object.assign({}, this.state.shapes.options);
       options.hoverPoint = point;
       await this.showShapesHighlighter(node, options);
     }
   }
 
   /**
-   * Returns the flexbox highlighter color for the given node.
+   * Create a flexbox highlighter settings object from the Redux store containing any
+   * highlighter options that should be passed into the highlighter.
    */
-  async getFlexboxHighlighterColor() {
-    const customHostColors = await asyncStorage.getItem("flexboxInspectorHostColors") ||
-      {};
-    // Get the hostname, if there is no hostname, fall back on protocol
-    // ex: `data:` uri, and `about:` pages
-    const hostName = parseURL(this.inspector.target.url).hostname ||
-      parseURL(this.inspector.target.url).protocol;
-    return customHostColors[hostName] ?
-      customHostColors[hostName] : DEFAULT_HIGHLIGHTER_COLOR;
+  getFlexboxHighlighterSettings() {
+    const { flexbox } = this.store.getState();
+    const color = flexbox.color;
+    return { color };
   }
 
   /**
    * Toggle the flexbox highlighter for the given flexbox container element.
    *
    * @param  {NodeFront} node
    *         The NodeFront of the flexbox container element to highlight.
    * @param  {Object} options
@@ -286,20 +279,17 @@ class HighlightersOverlay {
    *         Object used for passing options to the flexbox highlighter.
    */
   async showFlexboxHighlighter(node, options) {
     const highlighter = await this._getHighlighter("FlexboxHighlighter");
     if (!highlighter) {
       return;
     }
 
-    options = {
-      ...options,
-      color: await this.getFlexboxHighlighterColor(node),
-    };
+    options = Object.assign({}, options, this.getFlexboxHighlighterSettings(node));
 
     const isShown = await highlighter.show(node, options);
     if (!isShown) {
       return;
     }
 
     this._toggleRuleViewIcon(node, true, ".ruleview-flex");
 
@@ -403,17 +393,17 @@ class HighlightersOverlay {
    * Create a grid highlighter settings object for the provided nodeFront.
    *
    * @param  {NodeFront} nodeFront
    *         The NodeFront for which we need highlighter settings.
    */
   getGridHighlighterSettings(nodeFront) {
     const { grids, highlighterSettings } = this.store.getState();
     const grid = grids.find(g => g.nodeFront === nodeFront);
-    const color = grid ? grid.color : DEFAULT_HIGHLIGHTER_COLOR;
+    const color = grid ? grid.color : DEFAULT_GRID_COLOR;
     return Object.assign({}, highlighterSettings, { color });
   }
 
   /**
    * Toggle the grid highlighter for the given grid container element.
    *
    * @param  {NodeFront} node
    *         The NodeFront of the grid container element to highlight.