Bug 1069829 - 3 - Clean styles.js off of eslint errors; r=me
authorPatrick Brosset <pbrosset@mozilla.com>
Tue, 10 May 2016 13:29:55 +0200
changeset 335787 3b16eb206789de73633f240a7156d86ec7852437
parent 335786 eb721f4d509f8826886fea9716ce06903bd3af0d
child 335788 095afcba84a3dcd4b23e2d96f22ca32ea23fbbaf
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1069829
milestone49.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 1069829 - 3 - Clean styles.js off of eslint errors; r=me MozReview-Commit-ID: JxEJRM3KUPQ
.eslintignore
devtools/server/actors/styles.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -112,16 +112,17 @@ devtools/client/shared/widgets/**
 devtools/client/sourceeditor/**
 devtools/client/webaudioeditor/**
 devtools/client/webconsole/**
 !devtools/client/webconsole/panel.js
 !devtools/client/webconsole/jsterm.js
 devtools/client/webide/**
 devtools/server/**
 !devtools/server/actors/webbrowser.js
+!devtools/server/actors/styles.js
 devtools/shared/*.js
 !devtools/shared/css-lexer.js
 devtools/shared/*.jsm
 devtools/shared/apps/**
 devtools/shared/client/**
 devtools/shared/discovery/**
 devtools/shared/gcli/**
 devtools/shared/heapsnapshot/**
--- a/devtools/server/actors/styles.js
+++ b/devtools/server/actors/styles.js
@@ -2,23 +2,22 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cc, Ci} = require("chrome");
 const promise = require("promise");
 const protocol = require("devtools/shared/protocol");
-const {Arg, Option, method, RetVal, types} = protocol;
 const events = require("sdk/event/core");
-const {Class} = require("sdk/core/heritage");
-const {PageStyleFront, StyleRuleFront} = require("devtools/client/fronts/styles");
+const {PageStyleFront, StyleRuleFront} = require("devtools/client/fronts/styles"); // eslint-disable-line
 const {LongStringActor} = require("devtools/server/actors/string");
 const {getDefinedGeometryProperties} = require("devtools/server/actors/highlighters/geometry-editor");
 const {parseDeclarations} = require("devtools/client/shared/css-parsing-utils");
+const {Task} = require("resource://gre/modules/Task.jsm");
 
 // This will also add the "stylesheet" actor type for protocol.js to recognize
 const {UPDATE_PRESERVING_RULES, UPDATE_GENERAL} = require("devtools/server/actors/stylesheets");
 const {pageStyleSpec, styleRuleSpec} = require("devtools/shared/specs/styles");
 
 loader.lazyRequireGetter(this, "CSS", "CSS");
 loader.lazyGetter(this, "CssLogic", () => require("devtools/shared/inspector/css-logic").CssLogic);
 loader.lazyGetter(this, "DOMUtils", () => Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils));
@@ -54,17 +53,17 @@ var PageStyleActor = protocol.ActorClass
   /**
    * Create a PageStyleActor.
    *
    * @param inspector
    *    The InspectorActor that owns this PageStyleActor.
    *
    * @constructor
    */
-  initialize: function(inspector) {
+  initialize: function (inspector) {
     protocol.Actor.prototype.initialize.call(this, null);
     this.inspector = inspector;
     if (!this.inspector.walker) {
       throw Error("The inspector's WalkerActor must be created before " +
                    "creating a PageStyleActor.");
     }
     this.walker = inspector.walker;
     this.cssLogic = new CssLogic();
@@ -77,17 +76,17 @@ var PageStyleActor = protocol.ActorClass
 
     this.onFrameUnload = this.onFrameUnload.bind(this);
     events.on(this.inspector.tabActor, "will-navigate", this.onFrameUnload);
 
     this._styleApplied = this._styleApplied.bind(this);
     this._watchedSheets = new Set();
   },
 
-  destroy: function() {
+  destroy: function () {
     if (!this.walker) {
       return;
     }
     protocol.Actor.prototype.destroy.call(this);
     events.off(this.inspector.tabActor, "will-navigate", this.onFrameUnload);
     this.inspector = null;
     this.walker = null;
     this.refMap = null;
@@ -99,17 +98,17 @@ var PageStyleActor = protocol.ActorClass
     }
     this._watchedSheets.clear();
   },
 
   get conn() {
     return this.inspector.conn;
   },
 
-  form: function(detail) {
+  form: function (detail) {
     if (detail === "actorid") {
       return this.actorID;
     }
 
     return {
       actor: this.actorID,
       traits: {
         // Whether the actor has had bug 1103993 fixed, which means that the
@@ -121,30 +120,30 @@ var PageStyleActor = protocol.ActorClass
         authoredStyles: true
       }
     };
   },
 
   /**
    * Called when a style sheet is updated.
    */
-  _styleApplied: function(kind, styleSheet) {
+  _styleApplied: function (kind, styleSheet) {
     // No matter what kind of update is done, we need to invalidate
     // the keyframe cache.
     this.cssLogic.reset();
     if (kind === UPDATE_GENERAL) {
       events.emit(this, "stylesheet-updated", styleSheet);
     }
   },
 
   /**
    * Return or create a StyleRuleActor for the given item.
    * @param item Either a CSSStyleRule or a DOM element.
    */
-  _styleRef: function(item) {
+  _styleRef: function (item) {
     if (this.refMap.has(item)) {
       return this.refMap.get(item);
     }
     let actor = StyleRuleActor(this, item);
     this.manage(actor);
     this.refMap.set(item, actor);
 
     return actor;
@@ -155,29 +154,29 @@ var PageStyleActor = protocol.ActorClass
    * corresponding item.  This is used when a StyleRuleActor updates
    * as style sheet and starts using a new rule.
    *
    * @param oldItem The old association; either a CSSStyleRule or a
    *                DOM element.
    * @param item Either a CSSStyleRule or a DOM element.
    * @param actor a StyleRuleActor
    */
-  updateStyleRef: function(oldItem, item, actor) {
+  updateStyleRef: function (oldItem, item, actor) {
     this.refMap.delete(oldItem);
     this.refMap.set(item, actor);
   },
 
   /**
    * Return or create a StyleSheetActor for the given nsIDOMCSSStyleSheet.
    * @param  {DOMStyleSheet} sheet
    *         The style sheet to create an actor for.
    * @return {StyleSheetActor}
    *         The actor for this style sheet
    */
-  _sheetRef: function(sheet) {
+  _sheetRef: function (sheet) {
     let tabActor = this.inspector.tabActor;
     let actor = tabActor.createStyleSheetActor(sheet);
     if (!this._watchedSheets.has(actor)) {
       this._watchedSheets.add(actor);
       actor.on("style-applied", this._styleApplied);
     }
     return actor;
   },
@@ -201,17 +200,17 @@ var PageStyleActor = protocol.ActorClass
    *     "property-name": {
    *       value: "property-value",
    *       priority: "!important" <optional>
    *       matched: <true if there are matched selectors for this value>
    *     },
    *     ...
    *   }
    */
-  getComputed: function(node, options) {
+  getComputed: function (node, options) {
     let ret = Object.create(null);
 
     this.cssLogic.sourceFilter = options.filter || CssLogic.FILTER.UA;
     this.cssLogic.highlight(node.rawNode);
     let computed = this.cssLogic.computedStyle || [];
 
     Array.prototype.forEach.call(computed, name => {
       ret[name] = {
@@ -240,17 +239,17 @@ var PageStyleActor = protocol.ActorClass
    * @param object options
    *   `includePreviews`: Whether to also return image previews of the fonts.
    *   `previewText`: The text to display in the previews.
    *   `previewFontSize`: The font size of the text in the previews.
    *
    * @returns object
    *   object with 'fontFaces', a list of fonts that apply to this node.
    */
-  getAllUsedFontFaces: function(options) {
+  getAllUsedFontFaces: function (options) {
     let windows = this.inspector.tabActor.windows;
     let fontsList = [];
     for (let win of windows) {
       fontsList = [...fontsList,
                    ...this.getUsedFontFaces(win.document.body, options)];
     }
     return fontsList;
   },
@@ -263,17 +262,17 @@ var PageStyleActor = protocol.ActorClass
    * @param object options
    *   `includePreviews`: Whether to also return image previews of the fonts.
    *   `previewText`: The text to display in the previews.
    *   `previewFontSize`: The font size of the text in the previews.
    *
    * @returns object
    *   object with 'fontFaces', a list of fonts that apply to this node.
    */
-  getUsedFontFaces: function(node, options) {
+  getUsedFontFaces: function (node, options) {
     // node.rawNode is defined for NodeActor objects
     let actualNode = node.rawNode || node;
     let contentDocument = actualNode.ownerDocument;
     // We don't get fonts for a node, but for a range
     let rng = contentDocument.createRange();
     rng.selectNodeContents(actualNode);
     let fonts = DOMUtils.getUsedFontFaces(rng);
     let fontsArray = [];
@@ -326,26 +325,26 @@ var PageStyleActor = protocol.ActorClass
           data: LongStringActor(this.conn, dataURL),
           size: size
         };
       }
       fontsArray.push(fontFace);
     }
 
     // @font-face fonts at the top, then alphabetically, then by weight
-    fontsArray.sort(function(a, b) {
+    fontsArray.sort(function (a, b) {
       return a.weight > b.weight ? 1 : -1;
     });
-    fontsArray.sort(function(a, b) {
+    fontsArray.sort(function (a, b) {
       if (a.CSSFamilyName == b.CSSFamilyName) {
         return 0;
       }
       return a.CSSFamilyName > b.CSSFamilyName ? 1 : -1;
     });
-    fontsArray.sort(function(a, b) {
+    fontsArray.sort(function (a, b) {
       if ((a.rule && b.rule) || (!a.rule && !b.rule)) {
         return 0;
       }
       return !a.rule && b.rule ? 1 : -1;
     });
 
     return fontsArray;
   },
@@ -381,17 +380,17 @@ var PageStyleActor = protocol.ActorClass
    *
    *     // The full form of any domrule referenced.
    *     rules: [ <domrule>, ... ], // The full form of any domrule referenced
    *
    *     // The full form of any sheets referenced.
    *     sheets: [ <domsheet>, ... ]
    *  }
    */
-  getMatchedSelectors: function(node, property, options) {
+  getMatchedSelectors: function (node, property, options) {
     this.cssLogic.sourceFilter = options.filter || CssLogic.FILTER.UA;
     this.cssLogic.highlight(node.rawNode);
 
     let rules = new Set();
     let sheets = new Set();
 
     let matched = [];
     let propInfo = this.cssLogic.getPropertyInfo(property);
@@ -418,17 +417,17 @@ var PageStyleActor = protocol.ActorClass
       matched: matched,
       rules: [...rules],
       sheets: [...sheets]
     };
   },
 
   // Get a selector source for a CssSelectorInfo relative to a given
   // node.
-  getSelectorSource: function(selectorInfo, relativeTo) {
+  getSelectorSource: function (selectorInfo, relativeTo) {
     let result = selectorInfo.selector.text;
     if (selectorInfo.elementStyle) {
       let source = selectorInfo.sourceElement;
       if (source === relativeTo) {
         result = "this";
       } else {
         result = CssLogic.getShortName(source);
       }
@@ -462,17 +461,17 @@ var PageStyleActor = protocol.ActorClass
     let result = this.getAppliedProps(node, entries, options);
     for (let rule of result.rules) {
       // See the comment in |form| to understand this.
       yield rule.getAuthoredCssText();
     }
     return result;
   }),
 
-  _hasInheritedProps: function(style) {
+  _hasInheritedProps: function (style) {
     return Array.prototype.some.call(style, prop => {
       return DOMUtils.isInheritedProperty(prop);
     });
   },
 
   isPositionEditable: Task.async(function* (node) {
     if (!node || node.rawNode.nodeType !== node.rawNode.ELEMENT_NODE) {
       return false;
@@ -497,17 +496,17 @@ var PageStyleActor = protocol.ActorClass
 
    * @return Array The rules for a given element. Each item in the
    *               array has the following signature:
    *                - rule RuleActor
    *                - isSystem Boolean
    *                - inherited Boolean
    *                - pseudoElement String
    */
-  _getAllElementRules: function(node, inherited, options) {
+  _getAllElementRules: function (node, inherited, options) {
     let {bindingElement, pseudo} =
         CssLogic.getBindingElementAndPseudo(node.rawNode);
     let rules = [];
 
     if (!bindingElement || !bindingElement.style) {
       return rules;
     }
 
@@ -566,17 +565,17 @@ var PageStyleActor = protocol.ActorClass
    * element. See getApplied for documentation on parameters.
    * @param DOMNode node
    * @param string pseudo
    * @param DOMNode inherited
    * @param object options
    *
    * @returns Array
    */
-  _getElementRules: function(node, pseudo, inherited, options) {
+  _getElementRules: function (node, pseudo, inherited, options) {
     let domRules = DOMUtils.getCSSStyleRules(node, pseudo);
     if (!domRules) {
       return [];
     }
 
     let rules = [];
 
     // getCSSStyleRules returns ordered from least-specific to
@@ -618,17 +617,17 @@ var PageStyleActor = protocol.ActorClass
    * the form generated by _getAllElementRules.  Note that this will
    * always return an array of either zero or one element.
    *
    * @param {NodeActor} node the node
    * @param {CSSStyleRule} filterRule the rule to filter for
    * @return {Array} array of zero or one elements; if one, the element
    *                 is the entry as returned by _getAllElementRules.
    */
-  findEntryMatchingRule: function(node, filterRule) {
+  findEntryMatchingRule: function (node, filterRule) {
     const options = {matchedSelectors: true, inherited: true};
     let entries = [];
     let parent = this.walker.parentNode(node);
     while (parent && parent.rawNode.nodeType != Ci.nsIDOMNode.DOCUMENT_NODE) {
       entries = entries.concat(this._getAllElementRules(parent, parent,
                                                         options));
       parent = this.walker.parentNode(parent);
     }
@@ -652,17 +651,17 @@ var PageStyleActor = protocol.ActorClass
    *   List of appliedstyle objects that lists the rules that apply to the
    *   node. If adding a new rule to the stylesheet, only the new rule entry
    *   is provided and only the style properties that apply to the new
    *   rule is fetched.
    * @returns Object containing the list of rule entries, rule actors and
    *   stylesheet actors that applies to the given node and its associated
    *   rules.
    */
-  getAppliedProps: function(node, entries, options) {
+  getAppliedProps: function (node, entries, options) {
     if (options.inherited) {
       let parent = this.walker.parentNode(node);
       while (parent && parent.rawNode.nodeType != Ci.nsIDOMNode.DOCUMENT_NODE) {
         entries = entries.concat(this._getAllElementRules(parent, parent,
                                                           options));
         parent = this.walker.parentNode(parent);
       }
     }
@@ -721,17 +720,17 @@ var PageStyleActor = protocol.ActorClass
       rules: [...rules],
       sheets: [...sheets]
     };
   },
 
   /**
    * Expand Sets of rules and sheets to include all parent rules and sheets.
    */
-  expandSets: function(ruleSet, sheetSet) {
+  expandSets: function (ruleSet, sheetSet) {
     // Sets include new items in their iteration
     for (let rule of ruleSet) {
       if (rule.rawRule.parentRule) {
         let parent = this._styleRef(rule.rawRule.parentRule);
         if (!ruleSet.has(parent)) {
           ruleSet.add(parent);
         }
       }
@@ -762,17 +761,17 @@ var PageStyleActor = protocol.ActorClass
    * @param {Object} options The only available option is autoMargins.
    * If set to true, the element's margins will receive an extra check to see
    * whether they are set to "auto" (knowing that the computed-style in this
    * case would return "0px").
    * The returned object will contain an extra property (autoMargins) listing
    * all margins that are set to auto, e.g. {top: "auto", left: "auto"}.
    * @return {Object}
    */
-  getLayout: function(node, options) {
+  getLayout: function (node, options) {
     this.cssLogic.highlight(node.rawNode);
 
     let layout = {};
 
     // First, we update the first part of the layout view, with
     // the size of the element.
 
     let clientRect = node.rawNode.getBoundingClientRect();
@@ -812,46 +811,46 @@ var PageStyleActor = protocol.ActorClass
     }
 
     return layout;
   },
 
   /**
    * Find 'auto' margin properties.
    */
-  processMargins: function(cssLogic) {
+  processMargins: function (cssLogic) {
     let margins = {};
 
     for (let prop of ["top", "bottom", "left", "right"]) {
       let info = cssLogic.getPropertyInfo("margin-" + prop);
       let selectors = info.matchedSelectors;
       if (selectors && selectors.length > 0 && selectors[0].value == "auto") {
         margins[prop] = "auto";
       }
     }
 
     return margins;
   },
 
   /**
    * On page navigation, tidy up remaining objects.
    */
-  onFrameUnload: function() {
+  onFrameUnload: function () {
     this.styleElements = new WeakMap();
   },
 
   /**
    * Helper function to addNewRule to get or create a style tag in the provided
    * document.
    *
    * @param {Document} document
    *        The document in which the style element should be appended.
    * @returns DOMElement of the style tag
    */
-  getStyleElement: function(document) {
+  getStyleElement: function (document) {
     if (!this.styleElements.has(document)) {
       let style = document.createElementNS(XHTML_NS, "style");
       style.setAttribute("type", "text/css");
       document.documentElement.appendChild(style);
       this.styleElements.set(document, style);
     }
 
     return this.styleElements.get(document);
@@ -859,17 +858,17 @@ var PageStyleActor = protocol.ActorClass
 
   /**
    * Helper function for adding a new rule and getting its applied style
    * properties
    * @param NodeActor node
    * @param CSSStyleRule rule
    * @returns Object containing its applied style properties
    */
-  getNewAppliedProps: function(node, rule) {
+  getNewAppliedProps: function (node, rule) {
     let ruleActor = this._styleRef(rule);
     return this.getAppliedProps(node, [{ rule: ruleActor }],
       { matchedSelectors: true });
   },
 
   /**
    * Adds a new rule, and returns the new StyleRuleActor.
    * @param {NodeActor} node
@@ -920,17 +919,17 @@ exports.PageStyleActor = PageStyleActor;
  * An actor that represents a CSS style object on the protocol.
  *
  * We slightly flatten the CSSOM for this actor, it represents
  * both the CSSRule and CSSStyle objects in one actor.  For nodes
  * (which have a CSSStyle but no CSSRule) we create a StyleRuleActor
  * with a special rule type (100).
  */
 var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
-  initialize: function(pageStyle, item) {
+  initialize: function (pageStyle, item) {
     protocol.Actor.prototype.initialize.call(this, null);
     this.pageStyle = pageStyle;
     this.rawStyle = item.style;
     this._parentSheet = null;
     this._onStyleApplied = this._onStyleApplied.bind(this);
 
     if (item instanceof (Ci.nsIDOMCSSRule)) {
       this.type = item.type;
@@ -946,28 +945,28 @@ var StyleRuleActor = protocol.ActorClass
         this.sheetActor.on("style-applied", this._onStyleApplied);
       }
     } else {
       // Fake a rule
       this.type = ELEMENT_STYLE;
       this.rawNode = item;
       this.rawRule = {
         style: item.style,
-        toString: function() {
+        toString: function () {
           return "[element rule " + this.style + "]";
         }
       };
     }
   },
 
   get conn() {
     return this.pageStyle.conn;
   },
 
-  destroy: function() {
+  destroy: function () {
     if (!this.rawStyle) {
       return;
     }
     protocol.Actor.prototype.destroy.call(this);
     this.rawStyle = null;
     this.pageStyle = null;
     this.rawNode = null;
     this.rawRule = null;
@@ -992,33 +991,33 @@ var StyleRuleActor = protocol.ActorClass
             // https://bugzilla.mozilla.org/show_bug.cgi?id=1224121
             this.sheetActor.allRulesHaveSource() &&
             // Special case about:PreferenceStyleSheet, as it is generated on
             // the fly and the URI is not registered with the about:handler
             // https://bugzilla.mozilla.org/show_bug.cgi?id=935803#c37
             this._parentSheet.href !== "about:PreferenceStyleSheet");
   },
 
-  getDocument: function(sheet) {
+  getDocument: function (sheet) {
     let document;
 
     if (sheet.ownerNode instanceof Ci.nsIDOMHTMLDocument) {
       document = sheet.ownerNode;
     } else {
       document = sheet.ownerNode.ownerDocument;
     }
 
     return document;
   },
 
-  toString: function() {
+  toString: function () {
     return "[StyleRuleActor for " + this.rawRule + "]";
   },
 
-  form: function(detail) {
+  form: function (detail) {
     if (detail === "actorid") {
       return this.actorID;
     }
 
     let form = {
       actor: this.actorID,
       type: this.type,
       line: this.line || undefined,
@@ -1107,27 +1106,27 @@ var StyleRuleActor = protocol.ActorClass
 
   /**
    * Send an event notifying that the location of the rule has
    * changed.
    *
    * @param {Number} line the new line number
    * @param {Number} column the new column number
    */
-  _notifyLocationChanged: function(line, column) {
+  _notifyLocationChanged: function (line, column) {
     events.emit(this, "location-changed", line, column);
   },
 
   /**
    * Compute the index of this actor's raw rule in its parent style
    * sheet.  The index is a vector where each element is the index of
    * a given CSS rule in its parent.  A vector is used to support
    * nested rules.
    */
-  _computeRuleIndex: function() {
+  _computeRuleIndex: function () {
     let rule = this.rawRule;
     let result = [];
 
     while (rule) {
       let cssRules;
       if (rule.parentRule) {
         cssRules = rule.parentRule.cssRules;
       } else {
@@ -1158,33 +1157,33 @@ var StyleRuleActor = protocol.ActorClass
    * Get the rule corresponding to |this._ruleIndex| from the given
    * style sheet.
    *
    * @param  {DOMStyleSheet} sheet
    *         The style sheet.
    * @return {CSSStyleRule} the rule corresponding to
    * |this._ruleIndex|
    */
-  _getRuleFromIndex: function(parentSheet) {
+  _getRuleFromIndex: function (parentSheet) {
     let currentRule = null;
     for (let i of this._ruleIndex) {
       if (currentRule === null) {
         currentRule = parentSheet.cssRules[i];
       } else {
         currentRule = currentRule.cssRules.item(i);
       }
     }
     return currentRule;
   },
 
   /**
    * This is attached to the parent style sheet actor's
    * "style-applied" event.
    */
-  _onStyleApplied: function(kind) {
+  _onStyleApplied: function (kind) {
     if (kind === UPDATE_GENERAL) {
       // A general change means that the rule actors are invalidated,
       // so stop listening to events now.
       if (this.sheetActor) {
         this.sheetActor.off("style-applied", this._onStyleApplied);
       }
     } else if (this._ruleIndex) {
       // The sheet was updated by this actor, in a way that preserves
@@ -1208,17 +1207,17 @@ var StyleRuleActor = protocol.ActorClass
   /**
    * Return a promise that resolves to the authored form of a rule's
    * text, if available.  If the authored form is not available, the
    * returned promise simply resolves to the empty string.  If the
    * authored form is available, this also sets |this.authoredText|.
    * The authored text will include invalid and otherwise ignored
    * properties.
    */
-  getAuthoredCssText: function() {
+  getAuthoredCssText: function () {
     if (!this.canSetRuleText ||
         (this.type !== Ci.nsIDOMCSSRule.STYLE_RULE &&
          this.type !== Ci.nsIDOMCSSRule.KEYFRAME_RULE)) {
       return promise.resolve("");
     }
 
     if (typeof this.authoredText === "string") {
       return promise.resolve(this.authoredText);
@@ -1279,17 +1278,17 @@ var StyleRuleActor = protocol.ActorClass
    *  or
    * {
    *   type: "remove",
    *   name: <string>,
    * }
    *
    * @returns the rule with updated properties
    */
-  modifyProperties: function(modifications) {
+  modifyProperties: function (modifications) {
     // Use a fresh element for each call to this function to prevent side
     // effects that pop up based on property values that were already set on the
     // element.
 
     let document;
     if (this.rawNode) {
       document = this.rawNode.ownerDocument;
     } else {
@@ -1435,17 +1434,17 @@ var StyleRuleActor = protocol.ActorClass
    *        True if the selector should be updated by editing the
    *        authored text; false if the selector should be updated via
    *        CSSOM.
    * @returns {Object}
    *        Returns an object that contains the applied style properties of the
    *        new rule and a boolean indicating whether or not the new selector
    *        matches the current selected element
    */
-  modifySelector2: function(node, value, editAuthored = false) {
+  modifySelector2: function (node, value, editAuthored = false) {
     if (this.type === ELEMENT_STYLE ||
         this.rawRule.selectorText === value) {
       return { ruleProps: null, isMatching: true };
     }
 
     let selectorPromise = this._addNewSelector(value, editAuthored);
 
     if (editAuthored) {